Jelajahi Sumber

提交更新保存Rowkey

黄贺彬 6 tahun lalu
induk
melakukan
2e3dced132

+ 16 - 0
TEAMModelOS.Model/Core/Models/SchoolSubject.cs

@@ -11,9 +11,25 @@ namespace TEAMModelOS.Model.Core.Models
     [MessagePackObject(keyAsPropertyName: true)]
     public class SchoolSubject :TableEntity
     {
+        /// <summary>
+        /// 学科名称
+        /// </summary>
         public string Name { get; set; }
+        /// <summary>
+        /// 学科编码
+        /// </summary>
         public string Code { get; set; }
+        /// <summary>
+        /// 学校编码
+        /// </summary>
         public string SchoolCode { get; set; }
+        /// <summary>
+        /// 学校名称
+        /// </summary>
         public string SchoolName { get; set; }
+        /// <summary>
+        /// 删除状态
+        /// </summary>
+        public int Status { get; set; } = 1;
     }
 }

+ 12 - 0
TEAMModelOS.Model/Core/Models/SchoolTerm.cs

@@ -11,9 +11,21 @@ namespace TEAMModelOS.Model.Core.Models
     [MessagePackObject(keyAsPropertyName: true)]
     public class SchoolTerm :TableEntity
     {
+        /// <summary>
+        /// 学期名称
+        /// </summary>
         public string Name { get; set; }
+        /// <summary>
+        /// 学期编码
+        /// </summary>
         public int Code { get; set; }
+        /// <summary>
+        /// 学校编码
+        /// </summary>
         public string SchoolCode { get; set; }
+        /// <summary>
+        /// 学校名称
+        /// </summary>
         public string SchoolName { get; set; }
     }
 }

+ 41 - 4
TEAMModelOS.Model/Syllabus/Models/SchoolVolume.cs

@@ -11,16 +11,53 @@ namespace TEAMModelOS.Model.Syllabus.Models
     [MessagePackObject(keyAsPropertyName: true)]
     public class SchoolVolume : TableEntity
     {
+        /// <summary>
+        /// 册别名称
+        /// </summary>
         public string Name { get; set; }
-        public string SchoolCode { get; set; }
-        public string SchoolName { get; set; }
+        /// <summary>
+        /// 学段编码
+        /// </summary>
         public string PeriodCode { get; set; }
+        /// <summary>
+        /// 学段名称
+        /// </summary>
         public string PeriodName { get; set; }
-        public string GradeCode { get; set; }
+        /// <summary>
+        /// 年级编码
+        /// </summary>
+        public int GradeCode { get; set; }
+        /// <summary>
+        /// 年级名称
+        /// </summary>
         public string GradeName { get; set; }
-        public string TermCode { get; set; }
+        /// <summary>
+        /// 学期编码
+        /// </summary>
+        public int TermCode { get; set; }
+        /// <summary>
+        /// 学期名称
+        /// </summary>
         public string TermName { get; set; }
+        /// <summary>
+        /// 科目编码
+        /// </summary>
         public string SubjectCode { get; set; }
+        /// <summary>
+        /// 科目名称
+        /// </summary>
         public string SubjectName { get; set; }
+        /// <summary>
+        /// 学校编码
+        /// </summary>
+        public string SchoolCode { get; set; }
+        /// <summary>
+        /// 学校名称
+        /// </summary>
+        public string SchoolName { get; set; }
+        /// <summary>
+        /// 状态
+        /// </summary>
+        public int Status { get; set; } = 1;
     }
 }

+ 27 - 0
TEAMModelOS.Model/Syllabus/Models/Volume.cs

@@ -11,14 +11,41 @@ namespace TEAMModelOS.Model.Syllabus.Models
     [MessagePackObject(keyAsPropertyName: true)]
     public class Volume : TableEntity
     {
+        /// <summary>
+        /// 册别名称
+        /// </summary>
         public string Name { get; set; }
+        /// <summary>
+        /// 学段编码
+        /// </summary>
         public string PeriodCode { get; set; }
+        /// <summary>
+        /// 学段名称
+        /// </summary>
         public string PeriodName { get; set; }
+        /// <summary>
+        /// 年级编码
+        /// </summary>
         public string GradeCode { get; set; }
+        /// <summary>
+        /// 年级名称
+        /// </summary>
         public string GradeName { get; set; }
+        /// <summary>
+        /// 学期编码
+        /// </summary>
         public string TermCode { get; set; }
+        /// <summary>
+        /// 学期名称
+        /// </summary>
         public string TermName { get; set; }
+        /// <summary>
+        /// 科目编码
+        /// </summary>
         public string SubjectCode { get; set; }
+        /// <summary>
+        /// 科目名称
+        /// </summary>
         public string SubjectName { get; set; }
     }
 }

+ 28 - 28
TEAMModelOS.SDK/Module/AzureCosmosDB/Implements/AzureCosmosDBRepository.cs

@@ -41,8 +41,8 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
             private DocumentClient CosmosClient { get; set; }
             private DocumentCollection CosmosCollection { get; set; }
 
-            private string _Database { get; set; }
-            private int _CollectionThroughput { get; set; }
+            private string  Database { get; set; }
+            private int CollectionThroughput { get; set; }
             public AzureCosmosDBRepository(AzureCosmosDBOptions options)
             {
                 try
@@ -65,9 +65,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                     {
                         throw new BizException("请设置正确的AzureCosmosDB数据库配置信息!");
                     }
-                    _Database = options.Database;
-                    _CollectionThroughput = options.CollectionThroughput;
-                    CosmosClient.CreateDatabaseIfNotExistsAsync(new Database { Id = _Database });
+                    Database = options.Database;
+                CollectionThroughput = options.CollectionThroughput;
+                    CosmosClient.CreateDatabaseIfNotExistsAsync(new Database { Id = Database });
                     // _connectionString = options.ConnectionString;
                 }
                 catch (DocumentClientException de)
@@ -102,9 +102,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                         collectionDefinition.PartitionKey.Paths.Add("/" + partitionKey);
 
                     }
-                    // CosmosCollection = await this.CosmosClient.CreateDocumentCollectionIfNotExistsAsync(UriFactory.CreateDatabaseUri(_Database), collectionDefinition);
+                    // CosmosCollection = await this.CosmosClient.CreateDocumentCollectionIfNotExistsAsync(UriFactory.CreateDatabaseUri(Database), collectionDefinition);
                     CosmosCollection = await this.CosmosClient.CreateDocumentCollectionIfNotExistsAsync(
-                        UriFactory.CreateDatabaseUri(_Database), collectionDefinition, new RequestOptions { OfferThroughput = _CollectionThroughput }
+                        UriFactory.CreateDatabaseUri(Database), collectionDefinition, new RequestOptions { OfferThroughput = CollectionThroughput }
                         );
                 }
 
@@ -151,7 +151,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 Type t = typeof(T);
                 DocumentCollection documentCollection = await InitializeCollection<T>();
                 ResourceResponse<Document> doc =
-                    await CosmosClient.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), entity);
+                    await CosmosClient.CreateDocumentAsync(UriFactory.CreateDocumentCollectionUri(Database, t.Name), entity);
                 //Console.WriteLine(doc.ActivityId);
 
 
@@ -163,7 +163,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 Type t = typeof(T);
                 await InitializeCollection<T>();
                 ResourceResponse<Document> doc =
-                    await CosmosClient.UpsertDocumentAsync(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), entity);
+                    await CosmosClient.UpsertDocumentAsync(UriFactory.CreateDocumentCollectionUri(Database, t.Name), entity);
                 return entity;
             }
             public async Task<string> ReplaceObject<T>(T entity, string key)
@@ -173,7 +173,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 try
                 {
                     ResourceResponse<Document> doc =
-                    await CosmosClient.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(_Database, t.Name, key), entity);
+                    await CosmosClient.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(Database, t.Name, key), entity);
                     return key;
                 }
                 catch (Exception e)
@@ -192,7 +192,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 try
                 {
                     ResourceResponse<Document> doc =
-                    await CosmosClient.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(_Database, t.Name, key),
+                    await CosmosClient.ReplaceDocumentAsync(UriFactory.CreateDocumentUri(Database, t.Name, key),
                     entity,
                     new RequestOptions { PartitionKey = new PartitionKey(partitionKey) });
                     return key;
@@ -215,7 +215,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 //await InitializeCollection<T>();
                 //查询条数 -1是全部
                 FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = open };
-                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), queryOptions).AsDocumentQuery();
+                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), queryOptions).AsDocumentQuery();
                 while (query.HasMoreResults)
                 {
                     foreach (T obj in await query.ExecuteNextAsync())
@@ -224,7 +224,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                     }
                 }
                 return objs;
-                //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name),sql);
+                //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name),sql);
 
             }
 
@@ -236,11 +236,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 await InitializeCollection<T>();
                 //查询条数 -1是全部
                 FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1 };
-                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), queryOptions);
+                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), queryOptions);
 
                 //  query.Where();
                 return objs;
-                //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name),sql);
+                //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name),sql);
 
             }
 
@@ -249,7 +249,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 Type t = typeof(T);
                 List<T> objs = new List<T>();
                 await InitializeCollection<T>();
-                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), sql);
+                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), sql);
                 foreach (var item in query)
                 {
                     objs.Add(item);
@@ -266,7 +266,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 await InitializeCollection<T>();
                 //查询条数 -1是全部
                 FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = open };
-                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), sql, queryOptions);
+                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), sql, queryOptions);
                 foreach (var item in query)
                 {
                     objs.Add(item);
@@ -286,7 +286,6 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
 
                 string PKname = "";
                 PropertyInfo[] properties = t.GetProperties();
-                List<PropertyInfo> attrProperties = new List<PropertyInfo>();
                 foreach (PropertyInfo property in properties)
                 {
                     object[] attributes = property.GetCustomAttributes(true);
@@ -318,11 +317,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 await InitializeCollection<T>();
                 //查询条数 -1是全部
                 FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = open };
-                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name), queryOptions);
+                var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), queryOptions);
 
                 List<T> list = DynamicLinq.GenerateFilter<T>(query, filters).ToList();
                 return list;
-                //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(_Database, t.Name),sql);
+                //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name),sql);
 
             }
             public async Task<string> DeleteAsync<T>(string id)
@@ -330,7 +329,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                 Type t = typeof(T);
                 await InitializeCollection<T>();
                 ResourceResponse<Document> doc =
-                    await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(_Database, t.Name, id));
+                    await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(Database, t.Name, id));
                 //Console.WriteLine(doc.ActivityId);
                 return id;
             }
@@ -344,13 +343,13 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                     string pkValue = entity.GetType().GetProperty(PartitionKey).GetValue(entity).ToString();
                     string idValue = entity.GetType().GetProperty("id").GetValue(entity).ToString();
                     ResourceResponse<Document> doc =
-                  await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(_Database, t.Name, idValue), new RequestOptions { PartitionKey = new PartitionKey(pkValue) });
+                  await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(Database, t.Name, idValue), new RequestOptions { PartitionKey = new PartitionKey(pkValue) });
                 }
                 else
                 {
                     string idValue = entity.GetType().GetProperty("id").GetValue(entity).ToString();
                     ResourceResponse<Document> doc =
-                    await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(_Database, t.Name, idValue));
+                    await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(Database, t.Name, idValue));
                 }
 
 
@@ -364,7 +363,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
 
                 await InitializeCollection<T>();
                 ResourceResponse<Document> doc =
-                    await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(_Database, t.Name, id), new RequestOptions { PartitionKey = new PartitionKey(partitionKey) });
+                    await CosmosClient.DeleteDocumentAsync(UriFactory.CreateDocumentUri(Database, t.Name, id), new RequestOptions { PartitionKey = new PartitionKey(partitionKey) });
                 //Console.WriteLine(doc.ActivityId);
                 return id;
 
@@ -483,8 +482,8 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                         string id = lists[j].GetType().GetProperty("id").GetValue(lists[j]) + "";
                         updateItemsInBatch.Add(new UpdateItem(id, partitionKeyValue, updateOperations));
                     }
-                    var tasks = new List<Task>();
-                    tasks.Add(Task.Run(async () =>
+                var tasks = new List<Task>
+                { Task.Run(async () =>
                     {
                         do
                         {
@@ -508,8 +507,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
                         totalRequestUnitsConsumed += bulkUpdateResponse.TotalRequestUnitsConsumed;
                         totalTimeTakenSec += bulkUpdateResponse.TotalTimeTaken.TotalSeconds;
                     },
-                    token));
-                    await Task.WhenAll(tasks);
+                token)
+                };
+                await Task.WhenAll(tasks);
                 }
                 return list;
             }

+ 4 - 6
TEAMModelOS.Service/Core/Implements/LoginInfoService.cs

@@ -32,12 +32,10 @@ namespace TEAMModelOS.Service.Core.Implements
     public class LoginInfoService : BaseService,  ILoginInfoService
     {
         //private IAzureTableDBRepository _repository;
-        private IOptions<JwtSetting> _options;
-        private IHttpContextAccessor _httpContextAccessor;
-        private HttpClientUserInfo _httpClientService;
-        public LoginInfoService( IOptions<JwtSetting> options, IHttpContextAccessor httpContextAccessor  , HttpClientUserInfo httpClientService)
+        private readonly IOptions<JwtSetting> _options;
+        private readonly HttpClientUserInfo _httpClientService;
+        public LoginInfoService( IOptions<JwtSetting> options, HttpClientUserInfo httpClientService)
         {
-            _httpContextAccessor = httpContextAccessor;
             _options = options;
            // _repository = repository;
             _httpClientService = httpClientService;
@@ -45,7 +43,7 @@ namespace TEAMModelOS.Service.Core.Implements
 
         public async Task<LoginResult> CheckLoginAsync(TicketInfo ticketInfo) {
 
-            string jtoken = HttpContextHelper.GetValueInHttp(_httpContextAccessor.HttpContext.Request, Constants.AUTHORIZATION);
+           // string jtoken = HttpContextHelper.GetValueInHttp(_httpContextAccessor.HttpContext.Request, Constants.AUTHORIZATION);
             if (string.IsNullOrEmpty(ticketInfo.Token))
             {
                 LoginResult result = new LoginResult();

+ 2 - 2
TEAMModelOS.Service/Core/Implements/SchoolService.cs

@@ -26,8 +26,8 @@ namespace TEAMModelOS.Service.Core.Implements
     public class SchoolService : BaseService,  ISchoolService
     {
         //private IAzureTableDBRepository _azureTableDBRepository; 
-        private HttpClientSchool _httpClientSchool;
-        private IHttpContextAccessor _httpContextAccessor;
+        private readonly HttpClientSchool _httpClientSchool;
+        private readonly IHttpContextAccessor _httpContextAccessor;
         public SchoolService(HttpClientSchool httpClientSchool  ,IHttpContextAccessor httpContextAccessor) {
             _httpClientSchool = httpClientSchool;
             //_azureTableDBRepository = azureTableDBRepository;

+ 11 - 0
TEAMModelOS.Service/Core/Implements/TermService.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using TEAMModelOS.Service.Core.Interfaces;
+
+namespace TEAMModelOS.Service.Core.Implements
+{
+    public class TermService: BaseService, ITermService
+    {
+    }
+}

+ 10 - 0
TEAMModelOS.Service/Core/Interfaces/ITermService.cs

@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.Service.Core.Interfaces
+{
+    public interface ITermService : IBusinessService, IBaseService
+    {
+    }
+}

+ 2 - 4
TEAMModelOS.Service/Syllabus/Implements/SyllabusService.cs

@@ -17,11 +17,9 @@ namespace TEAMModelOS.Service.Syllabus.Implements
     public class SyllabusService : ISyllabusService
     {
 
-        private IAzureTableDBRepository _azureTableDBRepository;
-        private IHttpContextAccessor _httpContextAccessor;
-        public SyllabusService(IAzureTableDBRepository azureTableDBRepository , IHttpContextAccessor httpContextAccessor) {
+        private readonly IAzureTableDBRepository _azureTableDBRepository;
+        public SyllabusService(IAzureTableDBRepository azureTableDBRepository) {
             _azureTableDBRepository = azureTableDBRepository;
-            _httpContextAccessor = httpContextAccessor;
         }
 
 

+ 12 - 0
TEAMModelOS.Service/Syllabus/Implements/VolumeService.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using TEAMModelOS.Service.Core.Implements;
+using TEAMModelOS.Service.Syllabus.Interfaces;
+
+namespace TEAMModelOS.Service.Syllabus.Implements
+{
+    public class VolumeService :BaseService, IVolumeService
+    {
+    }
+}

+ 11 - 0
TEAMModelOS.Service/Syllabus/Interfaces/IVolumeService.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using TEAMModelOS.Service.Core.Interfaces;
+
+namespace TEAMModelOS.Service.Syllabus.Interfaces
+{
+    public interface IVolumeService : IBusinessService, IBaseService
+    {
+    }
+}

+ 2 - 4
TEAMModelOS/Controllers/Core/GradeController.cs

@@ -17,12 +17,10 @@ namespace TEAMModelOS.Controllers.Core
     [Authorize]
     public class GradeController :BaseController
     {
-        private IGradeService _GradeSeservice;
-        private IHttpContextAccessor _httpContextAccessor;
-        public GradeController(IGradeService GradeService, IHttpContextAccessor httpContextAccessor)
+        private readonly IGradeService _GradeSeservice;
+        public GradeController(IGradeService GradeService)
         {
             _GradeSeservice = GradeService;
-            _httpContextAccessor = httpContextAccessor;
         }
         [HttpPost("FindGradesByDict")]
         public async Task<BaseJosnRPCResponse> FindGradesByDict(JosnRPCRequest<Dictionary<string, object>> request)

+ 12 - 11
TEAMModelOS/Controllers/Core/RoleController.cs

@@ -22,12 +22,10 @@ namespace TEAMModelOS.Controllers.Core
     [Authorize]
     public class RoleController : BaseController
     {
-        private IRoleService _roleSeservice;
-        private IHttpContextAccessor _httpContextAccessor;
-        public RoleController(IRoleService roleService, IHttpContextAccessor httpContextAccessor)
+        private readonly IRoleService _roleSeservice;
+        public RoleController(IRoleService roleService)
         {
             _roleSeservice = roleService;
-            _httpContextAccessor = httpContextAccessor;
         }
         [HttpPost("FindRoleByDict")]
         public async Task<BaseJosnRPCResponse> FindRoleByDict(JosnRPCRequest<Dictionary<string, object>> request)
@@ -42,7 +40,6 @@ namespace TEAMModelOS.Controllers.Core
         {
             JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
             List<string> rolecodes = GetLoginUser(JwtClaimTypes.Role);
-            List<string> Id = GetLoginUser(JwtClaimTypes.Id);
             List<Role> roles = new List<Role>();
             if (rolecodes.IsNotEmpty()) {
                 foreach (string code in rolecodes)
@@ -81,14 +78,18 @@ namespace TEAMModelOS.Controllers.Core
 
                         List<RoleIdentityClaimValue> claimValue = claimValues.Where(x => x.GroupKey.Equals(group.Key)).ToList();
                         claimValue= claimValue.OrderBy(s => s.ClaimOrder).ToList() ;
-                        Dictionary<string, object> claim = new Dictionary<string, object>();
-                        claim.Add("claim", claimValue);
-                        claim.Add("group", group.Key);
+                        Dictionary<string, object> claim = new Dictionary<string, object>
+                        {
+                            { "claim", claimValue },
+                            { "group", group.Key }
+                        };
                         claims.Add(claim);
                     }
-                    Dictionary<string, object> roleClaim = new Dictionary<string, object>();
-                    roleClaim.Add("roleClaim", claims);
-                    roleClaim.Add("role",  await _roleSeservice.FindOneByDict<Role>(new Dictionary<string, object> { { "RowKey",code }, { "PartitionKey", request.lang } }));
+                    Dictionary<string, object> roleClaim = new Dictionary<string, object>
+                    {
+                        { "roleClaim", claims },
+                        { "role", await _roleSeservice.FindOneByDict<Role>(new Dictionary<string, object> { { "RowKey", code }, { "PartitionKey", request.lang } }) }
+                    };
                     roleClaims.Add(roleClaim);
                 }
             }

+ 1 - 1
TEAMModelOS/Controllers/Core/SchoolController.cs

@@ -23,7 +23,7 @@ namespace TEAMModelOS.Controllers.Core
     [ApiController]
     public class SchoolController : BaseController
     {
-        private ISchoolService _schoolInfoService;
+        private readonly ISchoolService _schoolInfoService;
 
         public SchoolController(ISchoolService schoolInfoService)
         {

+ 1 - 0
TEAMModelOS/Controllers/Core/SubjectController.cs

@@ -32,6 +32,7 @@ namespace TEAMModelOS.Controllers.Core
         [HttpPost("SaveOrUpdateSchoolSubject")]
         public async Task<BaseJosnRPCResponse> SaveOrUpdateSchoolSubject(JosnRPCRequest<SchoolSubject> request)
         {
+            request.@params.RowKey = request.@params.SchoolCode + "-" + request.@params.Code;
             JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
             SchoolSubject data = await _subjectService.SaveOrUpdate<SchoolSubject>(request.@params);
             return builder.Data(data).build();

+ 53 - 0
TEAMModelOS/Controllers/Core/TermController.cs

@@ -0,0 +1,53 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Model.Core.Models;
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
+using TEAMModelOS.Service.Core.Interfaces;
+
+namespace TEAMModelOS.Controllers.Core
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    [Authorize]
+    public class TermController : BaseController
+    {
+        public ITermService  _termService;
+        public TermController(ITermService termService)
+        {
+            _termService = termService;
+        }
+
+       
+        [HttpPost("SaveOrUpdateSchoolTerm")]
+        public async Task<BaseJosnRPCResponse> SaveOrUpdateSchoolTerm(JosnRPCRequest<SchoolSubject> request)
+        {
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            SchoolTerm data = await _termService.SaveOrUpdate<SchoolTerm>(request.@params);
+            return builder.Data(data).build();
+        }
+        [HttpPost("DeleteInfo")]
+        public async Task<BaseJosnRPCResponse> Delete(JosnRPCRequest<Dictionary<string, object>> request)
+        {
+            request.@params.TryAdd("PartitionKey", request.lang);
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            int count = await _termService.DeleteAll<SchoolTerm>(request.@params);
+            return builder.Data(count).build();
+        }
+
+      
+
+        [HttpPost("FindSchoolTermsByDict")]
+        public async Task<BaseJosnRPCResponse> FindSchoolTermsByDict(JosnRPCRequest<Dictionary<string, object>> request)
+        {
+            request.@params.TryAdd("PartitionKey", request.lang);
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            List<SchoolTerm> Grades = await _termService.FindListByDict<SchoolTerm>(request.@params);
+            return builder.Data(Grades).build();
+        }
+    }
+}

+ 57 - 0
TEAMModelOS/Controllers/Syllabus/VolumeController.cs

@@ -0,0 +1,57 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Controllers.Core;
+using TEAMModelOS.Model.Core.Models;
+using TEAMModelOS.Model.Syllabus.Models;
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
+using TEAMModelOS.Service.Core.Interfaces;
+using TEAMModelOS.Service.Syllabus.Interfaces;
+
+namespace TEAMModelOS.Controllers.Syllabus
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    [Authorize]
+    public class VolumeController : BaseController
+    {
+        public IVolumeService _volumeService;
+        public VolumeController(IVolumeService volumeService)
+        {
+            _volumeService = volumeService;
+        }
+
+       
+        [HttpPost("SaveOrUpdateSchoolVolume")]
+        public async Task<BaseJosnRPCResponse> SaveOrUpdateSchoolTerm(JosnRPCRequest<SchoolVolume> request)
+        {
+            request.@params.RowKey = request.@params.SchoolCode + "-" + request.@params.PeriodCode +"-"+request.@params.SubjectCode+ "-G" + request.@params.GradeCode + "-T"+ request.@params.TermCode;
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            SchoolVolume data = await _volumeService.SaveOrUpdate<SchoolVolume>(request.@params);
+            return builder.Data(data).build();
+        }
+        [HttpPost("DeleteInfo")]
+        public async Task<BaseJosnRPCResponse> Delete(JosnRPCRequest<Dictionary<string, object>> request)
+        {
+            request.@params.TryAdd("PartitionKey", request.lang);
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            int count = await _volumeService.DeleteAll<SchoolTerm>(request.@params);
+            return builder.Data(count).build();
+        }
+
+      
+
+        [HttpPost("FindSchoolVolumesByDict")]
+        public async Task<BaseJosnRPCResponse> FindSchoolTermsByDict(JosnRPCRequest<Dictionary<string, object>> request)
+        {
+            request.@params.TryAdd("PartitionKey", request.lang);
+            JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
+            List<SchoolVolume> Grades = await _volumeService.FindListByDict<SchoolVolume>(request.@params);
+            return builder.Data(Grades).build();
+        }
+    }
+}

+ 3 - 27
TEAMModelOS/Controllers/ValuesController.cs

@@ -32,37 +32,13 @@ namespace TEAMModelOS.Controllers
             object[] attributes = type.GetCustomAttributes(true);
             foreach (object attribute in attributes) //2.通过映射,找到成员属性上关联的特性类实例,
             {
-                if (attribute is TableSpaceAttribute)
+                if (attribute is TableSpaceAttribute tableSpace)
                 {
-                    TableSpaceAttribute tableSpace =  (TableSpaceAttribute)attribute;
-                    Name = tableSpace.Name+ Name;
+                    Name = tableSpace.Name + Name;
                 }
             }
             return Name;
         }
-        // GET api/values/5
-        [HttpGet("{id}")]
-        public ActionResult<string> Get(int id)
-        {
-            return null;
-        }
-
-        // POST api/values
-        [HttpPost]
-        public void Post([FromBody] string value)
-        {
-        }
-
-        // PUT api/values/5
-        [HttpPut("{id}")]
-        public void Put(int id, [FromBody] string value)
-        {
-        }
-
-        // DELETE api/values/5
-        [HttpDelete("{id}")]
-        public void Delete(int id)
-        {
-        }
+       
     }
 }

+ 1 - 1
TEAMModelOS/SeedData/SeedDataService.cs

@@ -21,7 +21,7 @@ namespace TEAMModelOS.SeedData
 {
     public class SeedDataService : BaseService ,IBusinessService
     {
-        string Lang = "zh-CN";
+       private readonly string Lang = "zh-CN";
         //private readonly IAzureTableDBRepository _azureTableDBRepository;
         //public SeedDataService(IAzureTableDBRepository azureTableDBRepository) {
         //    _azureTableDBRepository = azureTableDBRepository;