소스 검색

Merge branch 'develop3.0' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0

zhouj1203@hotmail.com 5 년 전
부모
커밋
fb3976e725
100개의 변경된 파일1761개의 추가작업 그리고 2365개의 파일을 삭제
  1. 2 10
      TEAMModelGrpc/Models/SyllabusTreeDto.cs
  2. 7 7
      TEAMModelGrpc/Services/ClassroomService.cs
  3. 11 79
      TEAMModelGrpc/Services/ClassroomStudentService.cs
  4. 1 1
      TEAMModelGrpc/Services/CourseService.cs
  5. 12 11
      TEAMModelGrpc/Services/HomeWorkService.cs
  6. 2 2
      TEAMModelGrpc/Services/KnowledgeService.cs
  7. 15 8
      TEAMModelGrpc/Services/SyllabusService.cs
  8. 12 11
      TEAMModelGrpc/Services/VolumeService.cs
  9. 33 38
      TEAMModelGrpc/TEAMModelOS.GRPC.xml
  10. 1 0
      TEAMModelOS.SDK/Context/Attributes/Azure/PartitionKeyAttribute.cs
  11. 7 0
      TEAMModelOS.SDK/Extension/DataResult/JsonRpcResponse/JsonRPCResponseBuilder.cs
  12. 249 226
      TEAMModelOS.SDK/Module/AzureCosmosDBV3/AzureCosmosDBV3Repository.cs
  13. 18 0
      TEAMModelOS.SDK/Module/AzureCosmosDBV3/CosmosDict.cs
  14. 15 0
      TEAMModelOS.SDK/Module/AzureCosmosDBV3/CosmosModelInfo.cs
  15. 8 6
      TEAMModelOS.SDK/Module/AzureCosmosDBV3/IAzureCosmosDBV3Repository.cs
  16. 3 1
      TEAMModelOS.SDK/Module/AzureCosmosDBV3/ID.cs
  17. 21 5
      TEAMModelOS.SDK/Module/AzureCosmosDBV3/SQLHelperParametric.cs
  18. 4 14
      TEAMModelOS.SDK/Module/Cache/CSRedisCacheService.cs
  19. 1 1
      TEAMModelOS.SDK/Module/Grpc/AspNetCore/Internal/BindMethodFinder.cs
  20. 6 1
      TEAMModelOS.SDK/Module/Grpc/AspNetCore/Internal/ProviderServiceBinder.cs
  21. 1 1
      TEAMModelOS.Service/Models/Core/CodeValue.cs
  22. 1 1
      TEAMModelOS.Service/Models/Learn/ProcessRes.cs
  23. 1 1
      TEAMModelOS.Service/Models/Core/ResourceReference.cs
  24. 4 11
      TEAMModelOS.Service/Models/Syllabus/SyllabusNode.cs
  25. 1 1
      TEAMModelOS.Service/Models/Syllabus/SyllabusTree.cs
  26. 2 2
      TEAMModelOS.Service/Models/Learn/Target.cs
  27. 16 28
      TEAMModelOS.Service/Models/Exam/ExamItem.cs
  28. 14 26
      TEAMModelOS.Service/Models/Syllabus/Knowledge.cs
  29. 11 9
      TEAMModelOS.Service/Models/Syllabus/SyllabusResource.cs
  30. 12 5
      TEAMModelOS.Service/Models/Syllabus/Syllabuses.cs
  31. 2 5
      TEAMModelOS.Service/Models/Syllabus/KnowledgeBlock.cs
  32. 1 1
      TEAMModelOS.Service/Models/Syllabus/KnowledgeBlockPoint.cs
  33. 1 1
      TEAMModelOS.Service/Models/Syllabus/KnowledgePoint.cs
  34. 7 11
      TEAMModelOS.Service/Models/Syllabus/SyllabusVolume.cs
  35. 0 16
      TEAMModelOS.Service/Models/Core/ContentVerify.cs
  36. 0 40
      TEAMModelOS.Service/Models/Core/LoginInfo.cs
  37. 0 50
      TEAMModelOS.Service/Models/Core/Teacher.cs
  38. 0 173
      TEAMModelOS.Service/Models/Courses/Course.cs
  39. 0 39
      TEAMModelOS.Service/Models/Courses/CourseStudentsGroup.cs
  40. 0 39
      TEAMModelOS.Service/Models/Exam/SimpleExam.cs
  41. 0 168
      TEAMModelOS.Service/Models/Learn/HomeWork.cs
  42. 0 127
      TEAMModelOS.Service/Models/Learn/LeanProcess.cs
  43. 0 169
      TEAMModelOS.Service/Models/Learn/LearningAutonomous.cs
  44. 13 13
      TEAMModelOS.Service/Models/PowerPoint/Chart.cs
  45. 1 1
      TEAMModelOS.Service/Models/PowerPoint/Item.cs
  46. 1 3
      TEAMModelOS.Service/Models/PowerPoint/Slide.cs
  47. 6 13
      TEAMModelOS.Service/Models/Core/Classroom.cs
  48. 53 0
      TEAMModelOS.Service/Models/SchoolInfo/Course.cs
  49. 8 4
      TEAMModelOS.Service/Models/Exam/ExamAnswer.cs
  50. 7 4
      TEAMModelOS.Service/Models/Exam/ExamInfo.cs
  51. 7 3
      TEAMModelOS.Service/Models/Exam/ExamResult.cs
  52. 1 1
      TEAMModelOS.Service/Models/Core/Campus.cs
  53. 1 1
      TEAMModelOS.Service/Models/Core/Grade.cs
  54. 1 1
      TEAMModelOS.Service/Models/Core/Period.cs
  55. 1 1
      TEAMModelOS.Service/Models/Core/Semester.cs
  56. 1 1
      TEAMModelOS.Service/Models/Core/Subject.cs
  57. 15 13
      TEAMModelOS.Service/Models/Exam/ExamPaper.cs
  58. 19 5
      TEAMModelOS.Service/Models/Core/School.cs
  59. 40 0
      TEAMModelOS.Service/Models/SchoolInfo/Survey.cs
  60. 1 1
      TEAMModelOS.Service/Models/Core/SchoolSetting.cs
  61. 6 20
      TEAMModelOS.Service/Models/Learn/Vote.cs
  62. 12 13
      TEAMModelOS.Service/Models/Core/ClassRoomStudent.cs
  63. 13 61
      TEAMModelOS.Service/Models/Learn/HomeWorkStudent.cs
  64. 13 8
      TEAMModelOS.Service/Models/Learn/LeanRecord.cs
  65. 7 8
      TEAMModelOS.Service/Models/Core/Student.cs
  66. 19 0
      TEAMModelOS.Service/Models/StudentInfo/SurveyRecord.cs
  67. 13 26
      TEAMModelOS.Service/Models/Learn/VoteStudent.cs
  68. 8 5
      TEAMModelOS.Service/Models/Learn/TeacherComments.cs
  69. 73 0
      TEAMModelOS.Service/Models/TeacherInfo/CoursePlan.cs
  70. 102 0
      TEAMModelOS.Service/Models/TeacherInfo/Homework.cs
  71. 74 0
      TEAMModelOS.Service/Models/TeacherInfo/LeanProcess.cs
  72. 8 5
      TEAMModelOS.Service/Models/Learn/LearnUnit.cs
  73. 5 3
      TEAMModelOS.Service/Models/Core/SchoolUser.cs
  74. 1 3
      TEAMModelOS.Service/Services/Analysis/Implements/AchievementService.cs
  75. 1 3
      TEAMModelOS.Service/Services/Analysis/Interfaces/IAchievementService.cs
  76. 6 6
      TEAMModelOS.Service/Services/ChangeFeed/ChangeFeedInvoke.cs
  77. 1 1
      TEAMModelOS.Service/Services/ChangeFeed/IChangeFeedInvoke.cs
  78. 1 1
      TEAMModelOS.Service/Services/ChangeFeed/KnowledgeChangeFeed.cs
  79. 3 3
      TEAMModelOS.Service/Services/ChangeFeed/SyllabusVolumeChangeFeed.cs
  80. 35 36
      TEAMModelOS.Service/Services/Evaluation/Implements/HtmlAnalyzeService.cs
  81. 1 1
      TEAMModelOS.Service/Services/Evaluation/Implements/ImportExerciseService.cs
  82. 1 3
      TEAMModelOS.Service/Services/Evaluation/Interfaces/IHtmlAnalyzeService.cs
  83. 26 27
      TEAMModelOS.Service/Services/PowerPoint/Implement/HtexService.cs
  84. 3 3
      TEAMModelOS.Service/Services/PowerPoint/Implement/ShapeHelper.cs
  85. 4 4
      TEAMModelOS.Service/Services/PowerPoint/Implement/ShapeSvg.cs
  86. 6 6
      TEAMModelOS.Service/Services/Syllabus/Implement/KnowledgeService.cs
  87. 26 26
      TEAMModelOS.Service/Services/Syllabus/Implement/SyllabusService.cs
  88. 19 19
      TEAMModelOS.Service/Services/Syllabus/Implement/VolumeService.cs
  89. 2 2
      TEAMModelOS.Service/Services/Syllabus/Interface/IKnowledgeService.cs
  90. 4 4
      TEAMModelOS.Service/Services/Syllabus/Interface/ISyllabusService.cs
  91. 3 3
      TEAMModelOS.Service/Services/Syllabus/Interface/IVolumeService.cs
  92. 498 565
      TEAMModelOS.Service/TEAMModelOS.Model.xml
  93. 16 15
      TEAMModelOS/ClientApp/src/api/knowledge.js
  94. 27 25
      TEAMModelOS/ClientApp/src/api/learnActivity.js
  95. 11 11
      TEAMModelOS/ClientApp/src/api/newEvaluation.js
  96. 5 4
      TEAMModelOS/ClientApp/src/api/schoolSetting.js
  97. 8 7
      TEAMModelOS/ClientApp/src/api/stuAccount.js
  98. 18 24
      TEAMModelOS/ClientApp/src/api/syllabus.js
  99. 4 4
      TEAMModelOS/ClientApp/src/api/teachContent.js
  100. 0 0
      TEAMModelOS/ClientApp/src/common/BaseQuestionList.vue

+ 2 - 10
TEAMModelGrpc/Models/SyllabusTreeDto.cs

@@ -4,7 +4,6 @@ using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Linq;
 using System.Threading.Tasks;
-using TEAMModelOS.Service.Models.Syllabus;
 
 namespace TEAMModelGrpc.Models
 {
@@ -54,20 +53,13 @@ namespace TEAMModelGrpc.Models
         /// </summary>
         [ProtoMember(7)]
         public int type { get; set; }
-        /// <summary>
-        /// 备注
-        /// </summary>
-        //public string remark { get; set; }
+      
         /// <summary>
         /// 节点Key
         /// </summary>
         [ProtoMember(8)]
         public string nodeKey { get; set; }
-        ///// <summary>
-        /////主键
-        ///// </summary>
-        //[Required(ErrorMessage = "{0} 必须填写")]
-        //public string Id { get; set; }
+      
         /// <summary>
         /// 父级
         /// </summary>

+ 7 - 7
TEAMModelGrpc/Services/ClassroomService.cs

@@ -8,7 +8,7 @@ using System.Threading.Tasks;
 using TEAMModelGrpc.Models;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Core;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelGrpc.Services
 {
@@ -42,8 +42,8 @@ namespace TEAMModelGrpc.Services
                 else
                 {
                     classroom.id = Guid.NewGuid().ToString();
-                    ClassroomStudent students = new ClassroomStudent();
-                    students.scopeCode = classroom.scopeCode;
+                    ClassStudent students = new ClassStudent();
+                    students.code = classroom.code;
                     students.id = classroom.classroomCode;
                     await cosmosrepository.SaveOrUpdate(students);
                     classrooms.Add(await cosmosrepository.SaveOrUpdate(classroom));
@@ -87,15 +87,15 @@ namespace TEAMModelGrpc.Services
             await cosmosrepository.DeleteAll<Classroom>(listPid.idPks);
             if (listPid.idPks.IsNotEmpty())
             {
-                List<ClassroomStudent> students = new List<ClassroomStudent>();
+                List<ClassStudent> students = new List<ClassStudent>();
                 foreach (IdPk classroom in listPid.idPks)
                 {
-                    List<ClassroomStudent> classroomStudents = await cosmosrepository.FindByDict<ClassroomStudent>(new Dictionary<string, object> { { "id", classroom.id }, { "scopeCode", classroom.pk } });
-                    students.AddRange(classroomStudents);
+                    List<ClassStudent> ClassStudents = await cosmosrepository.FindByDict<ClassStudent>(new Dictionary<string, object> { { "id", classroom.id }, { "code", classroom.pk } });
+                    students.AddRange(ClassStudents);
                 }
                 if (students.Count > 0)
                 {
-                    await cosmosrepository.DeleteAll<ClassroomStudent>(students);
+                    await cosmosrepository.DeleteAll<ClassStudent>(students);
                 }
                 listPid.idPks = await cosmosrepository.DeleteAll<Classroom>(listPid.idPks);
             }

+ 11 - 79
TEAMModelGrpc/Services/ClassroomStudentService.cs

@@ -8,14 +8,14 @@ using System.Threading.Tasks;
 using TEAMModelGrpc.Models;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Core;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelGrpc.Services
 {
-    public class ClassroomStudentService : IGrpcService
+    public class ClassStudentService : IGrpcService
     {
         private IAzureCosmosDBV3Repository _cosmos;
-        public ClassroomStudentService(IAzureCosmosDBV3Repository cosmos)
+        public ClassStudentService(IAzureCosmosDBV3Repository cosmos)
         {
             _cosmos = cosmos;
         }
@@ -28,10 +28,10 @@ namespace TEAMModelGrpc.Services
         /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
-        public async Task SaveOrUpdateClassroomStudent(IAsyncStreamReader<ClassroomStudent> requestStream, IServerStreamWriter<ClassroomStudent> responseStream, ServerCallContext context)
+        public async Task SaveOrUpdateClassStudent(IAsyncStreamReader<ClassStudent> requestStream, IServerStreamWriter<ClassStudent> responseStream, ServerCallContext context)
         {
-            List<ClassroomStudent> classrooms = new List<ClassroomStudent>();
-            await foreach (ClassroomStudent students in requestStream.ReadAllAsync())
+            List<ClassStudent> classrooms = new List<ClassStudent>();
+            await foreach (ClassStudent students in requestStream.ReadAllAsync())
             {
                 classrooms.Add(await _cosmos.SaveOrUpdate(students));
             }
@@ -42,75 +42,7 @@ namespace TEAMModelGrpc.Services
 
 
 
-        /// <summary>
-        /// 学生加入教室 或者 修改座位号
-        /// </summary>
-        /// <param name="requestStream"></param>
-        /// <param name="responseStream"></param>
-        /// <param name="context"></param>
-        /// <returns></returns>
-        [Authorize]
-        public async Task AddClassroomAsync(IAsyncStreamReader<ClassroomStudent> requestStream, IServerStreamWriter<ClassroomStudent> responseStream, ServerCallContext context) {
-            List<ClassroomStudent> classroomStudents1 = new List<ClassroomStudent>();
-            List<ClassroomStudent> students = new List<ClassroomStudent>();
-            await foreach (ClassroomStudent classroom in requestStream.ReadAllAsync()) {
-                students.Add(classroom);
-
-            }
-            foreach (var classroomStudent in students.GroupBy(x => x.id).ToList())
-            {
-                List<ClassroomStudent> classroomStudents = await _cosmos.FindByDict<ClassroomStudent>(new Dictionary<string, object> { { "id", classroomStudent.Key } });
-                foreach (var classroomStudent1 in classroomStudent)
-                {
-                    classroomStudent1.studentId.ForEach(x => {
-                        if (!classroomStudents[0].studentId.Contains(x))
-                        {
-                            classroomStudents[0].studentId.Add(x);
-                        }
-                    });
-                    //   classroomStudents[0].studentId.UnionWith(classroomStudent1.studentId);
-                }
-                classroomStudents1.AddRange(classroomStudents);
-            }
-            List<ClassroomStudent> students1 = await _cosmos.SaveOrUpdateAll(classroomStudents1);
-            students1.ForEach(x => {
-                responseStream.WriteAsync(x);
-            });
-        }
-
-
-        /// <summary>
-        /// 学生退出教室
-        /// </summary>
-        /// <param name="requestStream"></param>
-        /// <param name="responseStream"></param>
-        /// <param name="context"></param>
-        /// <returns></returns>
-        [Authorize]
-        public async Task DelClassroom(IAsyncStreamReader<ClassroomStudent> requestStream, IServerStreamWriter<ClassroomStudent> responseStream, ServerCallContext context) 
-        {
-            List<ClassroomStudent> students = new List<ClassroomStudent>();
-
-            await foreach (ClassroomStudent classroomStudent in requestStream.ReadAllAsync()) {
-                students.Add(classroomStudent);
-            }
-            List<ClassroomStudent> classroomStudents1 = new List<ClassroomStudent>();
-            foreach (ClassroomStudent item1 in students)
-            {
-                List<ClassroomStudent> classroomStudents = await _cosmos.FindByDict<ClassroomStudent>(new Dictionary<string, object> { { "id", item1.id } });
-                foreach (ClassroomStudent item2 in classroomStudents)
-                {
-
-                    item1.studentId.ForEach(x => { item2.studentId.Remove(x); });
-                    //item2.studentId.ExceptWith(item1.studentId);
-                }
-                classroomStudents1.AddRange(classroomStudents);
-            }
-            List<ClassroomStudent> students1 = await _cosmos.SaveOrUpdateAll(classroomStudents1);
-            students1.ForEach(x => {
-                responseStream.WriteAsync(x);
-            });
-        }
+        
 
 
 
@@ -122,11 +54,11 @@ namespace TEAMModelGrpc.Services
         /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
-        public async Task FindStudents(StringDto request, IServerStreamWriter<ClassroomStudent> responseStream, ServerCallContext context) 
+        public async Task FindStudents(StringDto request, IServerStreamWriter<ClassStudent> responseStream, ServerCallContext context) 
         {
-            List<ClassroomStudent> classroomStudents = await _cosmos.FindSQL<ClassroomStudent>("select c.id,c.scopeCode from c join A0  in c.studentId where 1=1  and A0 =  \'" + request + "\'");
-            if (classroomStudents.IsNotEmpty()) {
-                classroomStudents.ForEach(  x => { 
+            List<ClassStudent> ClassStudents = await _cosmos.FindSQL<ClassStudent>("select c.id,c.code from c join A0  in c.studentId where 1=1 and c.pk='ClassStudent' and A0 =  \'" + request + "\'");
+            if (ClassStudents.IsNotEmpty()) {
+                ClassStudents.ForEach(  x => { 
                 responseStream.WriteAsync(x);
                 });
             }

+ 1 - 1
TEAMModelGrpc/Services/CourseService.cs

@@ -7,7 +7,7 @@ using System.Linq;
 using System.Threading.Tasks;
 using TEAMModelGrpc.Models;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Courses;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelGrpc.Services
 {

+ 12 - 11
TEAMModelGrpc/Services/HomeWorkService.cs

@@ -10,7 +10,7 @@ using TEAMModelOS.Models;
 using TEAMModelOS.SDK.Context.Exception;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Learn;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelGrpc.Services
 {
@@ -30,11 +30,11 @@ namespace TEAMModelGrpc.Services
         /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
-        public async Task<HomeWorkStudent> StudentScoring(HomeWorkCommentDto homeWorkCommentDto, ServerCallContext context) 
+        public async Task<HomeworkRecord> StudentScoring(HomeworkCommentDto homeWorkCommentDto, ServerCallContext context) 
         {
-            List<HomeWorkStudent> homeWorkStudents = await _cosmos.FindByDict<HomeWorkStudent>(new Dictionary<string, object> { { "id", homeWorkCommentDto.id }, { "homeWorkId", homeWorkCommentDto.homeWorkId } });
-            List<HomeWork> homeWorks = await _cosmos.FindByDict<HomeWork>(new Dictionary<string, object> { { "id", homeWorkCommentDto.homeWorkId } });
-            HomeWorkStudent data = new HomeWorkStudent();
+            List<HomeworkRecord> homeWorkStudents = await _cosmos.FindByDict<HomeworkRecord>(new Dictionary<string, object> { { "id", homeWorkCommentDto.id }, { "homeWorkId", homeWorkCommentDto.homeWorkId } });
+            List<Homework> homeWorks = await _cosmos.FindByDict<Homework>(new Dictionary<string, object> { { "id", homeWorkCommentDto.homeWorkId } });
+            HomeworkRecord data = new HomeworkRecord();
 
             if (homeWorks.IsNotEmpty() && homeWorks[0].other.Contains("comment"))
             {
@@ -85,11 +85,11 @@ namespace TEAMModelGrpc.Services
         /// <param name="homeWorkCommentDto"></param>
         /// <param name="context"></param>
         /// <returns></returns>
-        public async Task<HomeWorkStudent> TeacherScoring(HomeWorkScoringDto homeWorkCommentDto, ServerCallContext context)
+        public async Task<HomeworkRecord> TeacherScoring(HomeworkScoringDto homeWorkCommentDto, ServerCallContext context)
         {
 
-            List<HomeWorkStudent> homeWorkStudents = await _cosmos.FindByDict<HomeWorkStudent>(new Dictionary<string, object> { { "id", homeWorkCommentDto.id }, { "homeWorkId", homeWorkCommentDto.homeWorkId } });
-            HomeWorkStudent data = new HomeWorkStudent();
+            List<HomeworkRecord> homeWorkStudents = await _cosmos.FindByDict<HomeworkRecord>(new Dictionary<string, object> { { "id", homeWorkCommentDto.id }, { "homeWorkId", homeWorkCommentDto.homeWorkId } });
+            HomeworkRecord data = new HomeworkRecord();
             if (homeWorkStudents.IsNotEmpty())
             {
 
@@ -113,14 +113,15 @@ namespace TEAMModelGrpc.Services
         /// 查询教师评语罐头
         /// </summary>
         /// <param name="dict"></param>
+        /// <param name="responseStream"></param>
         /// <param name="context"></param>
         /// <returns></returns>
-        public async Task FindTeacherComments(Dict dict, IServerStreamWriter<TeacherComments> responseStream, ServerCallContext context) 
+        public async System.Threading.Tasks.Task FindTeacherComments(Dict dict, IServerStreamWriter<Comments> responseStream, ServerCallContext context) 
         {
             Dictionary<string, object> keyValuePairs = dict.ToDict();
-            List<TeacherComments> teacherComments = new List<TeacherComments>();
+            List<Comments> teacherComments = new List<Comments>();
             if (keyValuePairs.IsNotEmpty()) {
-                teacherComments = await _cosmos.FindByDict<TeacherComments>(keyValuePairs);
+                teacherComments = await _cosmos.FindByDict<Comments>(keyValuePairs);
                 if (teacherComments.IsNotEmpty()) {
                     teacherComments.ForEach(x=> { 
                         responseStream.WriteAsync(x);

+ 2 - 2
TEAMModelGrpc/Services/KnowledgeService.cs

@@ -10,8 +10,8 @@ using System.Threading.Tasks;
 using TEAMModelGrpc.Models;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
-using TEAMModelOS.Service.Services.Syllabus.Interface;
+using TEAMModelOS.Service.Models;
+using TEAMModelOS.Service.Services.Interface;
 
 namespace TEAMModelGrpc.Services
 {

+ 15 - 8
TEAMModelGrpc/Services/SyllabusService.cs

@@ -8,16 +8,23 @@ using System.Threading.Tasks;
 using TEAMModelGrpc.Models;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
-using TEAMModelOS.Service.Services.Syllabus.Interface;
+using TEAMModelOS.Service.Models;
+using TEAMModelOS.Service.Services.Interface;
 
 namespace TEAMModelGrpc.Services
 {
+    /// <summary>
+    /// 课纲业务
+    /// </summary>
     public class SyllabusService : IGrpcService
     {
         private ISyllabusService syllabusService;
         private IAzureCosmosDBV3Repository cosmosDBV3Repository;
-
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        /// <param name="syllabusService"></param>
+        /// <param name="cosmosDBV3Repository"></param>
         public SyllabusService(ISyllabusService syllabusService, IAzureCosmosDBV3Repository cosmosDBV3Repository)
         {
             this.syllabusService = syllabusService;
@@ -49,8 +56,7 @@ namespace TEAMModelGrpc.Services
         /// <summary>
         /// 按节点新增课纲
         /// </summary>
-        /// <param name="request"></param>
-        /// <param name="responseStream"></param>
+        /// <param name="requestStream"></param>
         /// <param name="context"></param>
         /// <returns></returns>
         public async Task<Response> SaveOrUpdateAsNodes(IAsyncStreamReader<SyllabusNode> requestStream,  ServerCallContext context) 
@@ -68,9 +74,9 @@ namespace TEAMModelGrpc.Services
         }
 
         /// <summary>
-        /// 按树形新增课纲结构
+        ///  按树形新增课纲结构
         /// </summary>
-        /// <param name="request"></param>
+        /// <param name="requestStream"></param>
         /// <param name="responseStream"></param>
         /// <param name="context"></param>
         /// <returns></returns>
@@ -97,6 +103,7 @@ namespace TEAMModelGrpc.Services
         /// 删除课纲
         /// </summary>
         /// <param name="request"></param>
+        /// <param name="responseStream"></param>
         /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
@@ -104,7 +111,7 @@ namespace TEAMModelGrpc.Services
         {
             Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
             keyValuePairs = request.ToDict();
-            List<Syllabuses> syllabuses = await syllabusService.DeleteSyllabus(keyValuePairs);//await cosmosDBV3Repository.DeleteAll<Knowledge>(listPid.idPks);
+            List<Syllabus> syllabuses = await syllabusService.DeleteSyllabus(keyValuePairs);//await cosmosDBV3Repository.DeleteAll<Knowledge>(listPid.idPks);
             List<SyllabusTreeDto> syllabusTreeDtos = syllabuses.ToJson().FromJson<List<SyllabusTreeDto>>();
 
             syllabusTreeDtos.ForEach(x => { 

+ 12 - 11
TEAMModelGrpc/Services/VolumeService.cs

@@ -7,8 +7,8 @@ using System.Linq;
 using System.Threading.Tasks;
 using TEAMModelGrpc.Models;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
-using TEAMModelOS.Service.Services.Syllabus.Interface;
+using TEAMModelOS.Service.Models;
+using TEAMModelOS.Service.Services.Interface;
 
 namespace TEAMModelGrpc.Services
 {
@@ -31,12 +31,12 @@ namespace TEAMModelGrpc.Services
         /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
-        public async Task SaveOrUpdateVolume(IAsyncStreamReader<SyllabusVolume> requestStream, IServerStreamWriter<SyllabusVolume> responseStream, ServerCallContext context) {
+        public async Task SaveOrUpdateVolume(IAsyncStreamReader<Volume> requestStream, IServerStreamWriter<Volume> responseStream, ServerCallContext context) {
 
-            List<SyllabusVolume> volumes = new List<SyllabusVolume>();
-            await foreach (SyllabusVolume syllabusNode in requestStream.ReadAllAsync())
+            List<Volume> volumes = new List<Volume>();
+            await foreach (Volume syllabusNode in requestStream.ReadAllAsync())
             {
-                List<SyllabusVolume> volume = await volumeService.SaveOrUpdateVolume(syllabusNode);
+                List<Volume> volume = await volumeService.SaveOrUpdateVolume(syllabusNode);
                 volumes.AddRange(volume);
             }
             volumes.ForEach(x => {
@@ -52,11 +52,11 @@ namespace TEAMModelGrpc.Services
         /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
-        public async Task FindVolume(Dict request, IServerStreamWriter<SyllabusVolume> responseStream, ServerCallContext context) {
+        public async Task FindVolume(Dict request, IServerStreamWriter<Volume> responseStream, ServerCallContext context) {
 
             Dictionary<string, object> dict = request.ToDict();
 
-            List<SyllabusVolume> syllabusVolumes = await azureCosmosDBRepository.FindByDict<SyllabusVolume>(dict);
+            List<Volume> syllabusVolumes = await azureCosmosDBRepository.FindByDict<Volume>(dict);
 
             syllabusVolumes.ForEach(x => { 
                 responseStream.WriteAsync(x);
@@ -65,14 +65,15 @@ namespace TEAMModelGrpc.Services
 
 
         /// <summary>
-        /// 删除册别
+        ///  删除册别
         /// </summary>
-        /// <param name="request"></param>
+        /// <param name="listPid"></param>
+        /// <param name="context"></param>
         /// <returns></returns>
         [Authorize]
         public async Task<ListPid> Delete(ListPid listPid, ServerCallContext context)
         {
-            List<IdPk> idPks = await azureCosmosDBRepository.DeleteAll<SyllabusVolume>(listPid.idPks);
+            List<IdPk> idPks = await azureCosmosDBRepository.DeleteAll<Volume>(listPid.idPks);
             listPid.idPks = idPks;
             return listPid;
         }

+ 33 - 38
TEAMModelGrpc/TEAMModelOS.GRPC.xml

@@ -222,7 +222,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.ClassroomService.SaveOrUpdateVolume(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Core.Classroom},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Core.Classroom},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.ClassroomService.SaveOrUpdateVolume(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Classroom},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Classroom},Grpc.Core.ServerCallContext)">
             <summary>
             保存教室
             </summary>
@@ -231,7 +231,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.ClassroomService.FindVolume(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Core.Classroom},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.ClassroomService.FindVolume(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Classroom},Grpc.Core.ServerCallContext)">
             <summary>
             查询教室
             </summary>
@@ -248,7 +248,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.ClassroomStudentService.SaveOrUpdateClassroomStudent(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.ClassStudentService.SaveOrUpdateClassStudent(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.ClassStudent},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.ClassStudent},Grpc.Core.ServerCallContext)">
             <summary>
             保存 或 修改 教室学生关联
             </summary>
@@ -257,25 +257,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.ClassroomStudentService.AddClassroomAsync(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.ServerCallContext)">
-            <summary>
-            学生加入教室 或者 修改座位号
-            </summary>
-            <param name="requestStream"></param>
-            <param name="responseStream"></param>
-            <param name="context"></param>
-            <returns></returns>
-        </member>
-        <member name="M:TEAMModelGrpc.Services.ClassroomStudentService.DelClassroom(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.ServerCallContext)">
-            <summary>
-            学生退出教室
-            </summary>
-            <param name="requestStream"></param>
-            <param name="responseStream"></param>
-            <param name="context"></param>
-            <returns></returns>
-        </member>
-        <member name="M:TEAMModelGrpc.Services.ClassroomStudentService.FindStudents(TEAMModelGrpc.Models.StringDto,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Core.ClassroomStudent},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.ClassStudentService.FindStudents(TEAMModelGrpc.Models.StringDto,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.ClassStudent},Grpc.Core.ServerCallContext)">
             <summary>
             查询学生在哪些教室
             </summary>
@@ -284,7 +266,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.CourseService.FindCourseByDict(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Courses.Course},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.CourseService.FindCourseByDict(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Course},Grpc.Core.ServerCallContext)">
             <summary>
             查询课程
             </summary>
@@ -293,7 +275,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.CourseService.SaveCourse(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Courses.Course},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Courses.Course},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.CourseService.SaveCourse(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Course},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Course},Grpc.Core.ServerCallContext)">
             <summary>
             保存课程
             </summary>
@@ -310,7 +292,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.HomeWorkService.StudentScoring(TEAMModelOS.Models.HomeWorkCommentDto,Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.HomeWorkService.StudentScoring(TEAMModelOS.Models.HomeworkCommentDto,Grpc.Core.ServerCallContext)">
             <summary>
             学生作业打分评论
             </summary>
@@ -318,7 +300,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.HomeWorkService.TeacherScoring(TEAMModelOS.Models.HomeWorkScoringDto,Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.HomeWorkService.TeacherScoring(TEAMModelOS.Models.HomeworkScoringDto,Grpc.Core.ServerCallContext)">
             <summary>
             教师作业打分评论
             </summary>
@@ -326,7 +308,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.HomeWorkService.FindTeacherComments(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Learn.TeacherComments},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.HomeWorkService.FindTeacherComments(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Comments},Grpc.Core.ServerCallContext)">
             <summary>
             查询教师评语罐头
             </summary>
@@ -334,7 +316,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.KnowledgeService.FinKnowledge(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Syllabus.Knowledge},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.KnowledgeService.FinKnowledge(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Knowledge},Grpc.Core.ServerCallContext)">
             <summary>
             查询知识点
             </summary>
@@ -343,7 +325,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.KnowledgeService.SaveKnowledge(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Syllabus.Knowledge},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Syllabus.Knowledge},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.KnowledgeService.SaveKnowledge(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Knowledge},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Knowledge},Grpc.Core.ServerCallContext)">
             <summary>
             保存知识点
             </summary>
@@ -360,6 +342,18 @@
             <param name="context"></param>
             <returns></returns>
         </member>
+        <member name="T:TEAMModelGrpc.Services.SyllabusService">
+            <summary>
+            课纲业务
+            </summary>
+        </member>
+        <member name="M:TEAMModelGrpc.Services.SyllabusService.#ctor(TEAMModelOS.Service.Services.Interface.ISyllabusService,TEAMModelOS.SDK.Module.AzureCosmosDBV3.IAzureCosmosDBV3Repository)">
+            <summary>
+            构造函数
+            </summary>
+            <param name="syllabusService"></param>
+            <param name="cosmosDBV3Repository"></param>
+        </member>
         <member name="M:TEAMModelGrpc.Services.SyllabusService.FindSyllabusTree(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelGrpc.Models.SyllabusTreeDto},Grpc.Core.ServerCallContext)">
             <summary>
             查找课纲 
@@ -369,20 +363,19 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.SyllabusService.SaveOrUpdateAsNodes(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Syllabus.SyllabusNode},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.SyllabusService.SaveOrUpdateAsNodes(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.SyllabusNode},Grpc.Core.ServerCallContext)">
             <summary>
             按节点新增课纲
             </summary>
-            <param name="request"></param>
-            <param name="responseStream"></param>
+            <param name="requestStream"></param>
             <param name="context"></param>
             <returns></returns>
         </member>
         <member name="M:TEAMModelGrpc.Services.SyllabusService.SaveOrUpdateAsTree(Grpc.Core.IAsyncStreamReader{TEAMModelGrpc.Models.SyllabusTreeDto},Grpc.Core.IServerStreamWriter{TEAMModelGrpc.Models.SyllabusTreeDto},Grpc.Core.ServerCallContext)">
             <summary>
-            按树形新增课纲结构
+             按树形新增课纲结构
             </summary>
-            <param name="request"></param>
+            <param name="requestStream"></param>
             <param name="responseStream"></param>
             <param name="context"></param>
             <returns></returns>
@@ -392,10 +385,11 @@
             删除课纲
             </summary>
             <param name="request"></param>
+            <param name="responseStream"></param>
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.VolumeService.SaveOrUpdateVolume(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Syllabus.SyllabusVolume},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Syllabus.SyllabusVolume},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.VolumeService.SaveOrUpdateVolume(Grpc.Core.IAsyncStreamReader{TEAMModelOS.Service.Models.Volume},Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Volume},Grpc.Core.ServerCallContext)">
             <summary>
             保存册别
             </summary>
@@ -404,7 +398,7 @@
             <param name="context"></param>
             <returns></returns>
         </member>
-        <member name="M:TEAMModelGrpc.Services.VolumeService.FindVolume(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Syllabus.SyllabusVolume},Grpc.Core.ServerCallContext)">
+        <member name="M:TEAMModelGrpc.Services.VolumeService.FindVolume(TEAMModelGrpc.Models.Dict,Grpc.Core.IServerStreamWriter{TEAMModelOS.Service.Models.Volume},Grpc.Core.ServerCallContext)">
             <summary>
             查询册别
             </summary>
@@ -415,9 +409,10 @@
         </member>
         <member name="M:TEAMModelGrpc.Services.VolumeService.Delete(TEAMModelGrpc.Models.ListPid,Grpc.Core.ServerCallContext)">
             <summary>
-            删除册别
+             删除册别
             </summary>
-            <param name="request"></param>
+            <param name="listPid"></param>
+            <param name="context"></param>
             <returns></returns>
         </member>
         <member name="T:TEAMModelGrpc.GreetReflection">

+ 1 - 0
TEAMModelOS.SDK/Context/Attributes/Azure/PartitionKeyAttribute.cs

@@ -7,5 +7,6 @@ namespace TEAMModelOS.SDK.Context.Attributes.Azure
     [AttributeUsage(AttributeTargets.Property)]
     public class PartitionKeyAttribute : Attribute
     {
+      // public string name { get; set; }
     }
 }

+ 7 - 0
TEAMModelOS.SDK/Extension/DataResult/JsonRpcResponse/JsonRPCResponseBuilder.cs

@@ -159,6 +159,13 @@ namespace TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse
                 datasResponse.result.message = message;
                 baseResponse = datasResponse;
             }
+            else if (this.data == null) {
+                DataJosnRPCResponse<object> datasResponse = new DataJosnRPCResponse<object>();
+                datasResponse.result.data = this.data;
+                datasResponse.result.extend = this.extend;
+                datasResponse.result.message = message;
+                baseResponse = datasResponse;
+            }
             else
             {
                 baseResponse = new BaseJosnRPCResponse();

+ 249 - 226
TEAMModelOS.SDK/Module/AzureCosmosDBV3/AzureCosmosDBV3Repository.cs

@@ -1,5 +1,6 @@
 using Microsoft.Azure.Cosmos;
 using Microsoft.Azure.Cosmos.Linq;
+using OpenXmlPowerTools;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
@@ -21,31 +22,48 @@ using TEAMModelOS.SDK.Module.AzureCosmosDB.Configuration;
 
 namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
 {
-    public class CosmosModelInfo
+   
+    public  class AzureCosmosDBV3Repository  : IAzureCosmosDBV3Repository
     {
-        public Container container { get; set; }
-        public bool cache { get; set; }
-        public bool monitor { get; set; } = false;
-        public Type type { get; set; }
-    }
 
-    public class AzureCosmosDBV3Repository : IAzureCosmosDBV3Repository
-    {
 
         private CosmosClient CosmosClient { get; set; }
+        public CosmosDict CosmosDict { get; set; } = new CosmosDict();
         /// <summary>
-        /// 线程安全的dict类型
+        /// 数据库名
         /// </summary>
-        private Dictionary<string, CosmosModelInfo> DocumentCollectionDict { get; set; } = new Dictionary<string, CosmosModelInfo>();
-
         private string DatabaseId { get; set; }
+        /// <summary>
+        /// RU
+        /// </summary>
         private int CollectionThroughput { get; set; }
+        /// <summary>
+        /// 数据库对象
+        /// </summary>
         private Database database { get; set; }
+        /// <summary>
+        /// 分页大小
+        /// </summary>
         int pageSize = 200;
+        /// <summary>
+        /// 缓存前缀
+        /// </summary>
         private const string CacheCosmosPrefix = "cosmos:";
+        /// <summary>
+        /// 扫描类
+        /// </summary>
         private string[] ScanModel { get; set; }
+        /// <summary>
+        /// 超时时间
+        /// </summary>
         private const int timeoutSeconds = 86400;
+        /// <summary>
+        /// ttl时长 1秒
+        /// </summary>
         private const int ttl = 1;
+        /// <summary>
+        /// 更新源通知容器
+        /// </summary>
         private string leaseId = "AleaseContainer";
         public AzureCosmosDBV3Repository(AzureCosmosDBOptions options, CosmosSerializer cosmosSerializer)
         {
@@ -62,11 +80,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 DatabaseId = options.Database;
                 CollectionThroughput = options.CollectionThroughput;
                 ScanModel = options.ScanModel;
-                // InitializeDatabase().GetAwaiter().GetResult();
             }
             catch (CosmosException e)
             {
-                // Dispose(true);
                 throw new BizException(e.Message, 500, e.StackTrace);
             }
         }
@@ -86,118 +102,105 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 DatabaseId = options.Database;
                 CollectionThroughput = options.CollectionThroughput;
                 ScanModel = options.ScanModel;
-                // InitializeDatabase().GetAwaiter().GetResult();
             }
             catch (CosmosException e)
             {
-                //   Dispose(true);
                 throw new BizException(e.Message, 500, e.StackTrace);
             }
         }
 
-
-        public async Task<Dictionary<string, CosmosModelInfo>> InitializeDatabase()
-        {
-            try
+        /// <summary>
+        /// 初始化CosmosDB数据库
+        /// </summary>
+        /// <returns></returns>
+        public async Task<CosmosDict> InitializeDatabase() {
+            database = await CosmosClient.CreateDatabaseIfNotExistsAsync(DatabaseId, CollectionThroughput);
+            FeedIterator<ContainerProperties> resultSetIterator = database.GetContainerQueryIterator<ContainerProperties>();
+            while (resultSetIterator.HasMoreResults)
             {
-                database = await CosmosClient.CreateDatabaseIfNotExistsAsync(DatabaseId, CollectionThroughput);
-                FeedIterator<ContainerProperties> resultSetIterator = database.GetContainerQueryIterator<ContainerProperties>();
-                while (resultSetIterator.HasMoreResults)
+                foreach (ContainerProperties container in await resultSetIterator.ReadNextAsync())
                 {
-                    foreach (ContainerProperties container in await resultSetIterator.ReadNextAsync())
-                    {
-                        DocumentCollectionDict.TryAdd(container.Id, new CosmosModelInfo { container = database.GetContainer(container.Id), cache = false, monitor = false });
-                    }
+                   CosmosDict.nameCosmos.TryAdd(container.Id, new CosmosModelInfo { container = database.GetContainer(container.Id), cache = false, monitor = false });
                 }
-                bool isMonitor = false;
-                //获取数据库所有的表
-                List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(ScanModel);
-                foreach (Type type in types)
+            }
+            bool isMonitor = false;
+            //获取数据库所有的表
+            List<Type> types = ReflectorExtensions.GetAllTypeAsAttribute<CosmosDBAttribute>(ScanModel);
+            foreach (Type type in types)
+            {
+                string PartitionKey = GetPartitionKey(type);
+                string CollectionName = "";
+                int RU = 0;
+                bool cache = false;
+                bool monitor = false;
+                IEnumerable<CosmosDBAttribute> attributes = type.GetCustomAttributes<CosmosDBAttribute>(true);
+                if (attributes != null && !string.IsNullOrEmpty(attributes.First<CosmosDBAttribute>().Name))
                 {
-                    string PartitionKey = GetPartitionKey(type);
-                    string CollectionName = "";
-                    int RU = 0;
-                    bool cache = false;
-                    bool monitor = false;
-                    IEnumerable<CosmosDBAttribute> attributes = type.GetCustomAttributes<CosmosDBAttribute>(true);
-                    if (!string.IsNullOrEmpty(attributes.First<CosmosDBAttribute>().Name))
-                    {
-                        CollectionName = attributes.First<CosmosDBAttribute>().Name;
-                    }
-                    else
-                    {
-                        CollectionName = type.Name;
-                    }
-                    if (attributes.First<CosmosDBAttribute>().Cache)
-                    {
-                        cache = attributes.First<CosmosDBAttribute>().Cache;
-                    }
-                    if (attributes.First<CosmosDBAttribute>().Monitor)
+                    CollectionName = attributes.First<CosmosDBAttribute>().Name;
+                }
+                else {
+                    throw new BizException("必须指定容器名",ResponseCode.PARAMS_ERROR);
+                }
+                if (attributes.First<CosmosDBAttribute>().Cache)
+                {
+                    cache = attributes.First<CosmosDBAttribute>().Cache;
+                }
+                if (attributes.First<CosmosDBAttribute>().Monitor)
+                {
+                    monitor = attributes.First<CosmosDBAttribute>().Monitor;
+                    if (monitor)
                     {
-                        monitor = attributes.First<CosmosDBAttribute>().Monitor;
-                        if (monitor)
-                        {
-                            isMonitor = true;
-                        }
+                        isMonitor = true;
                     }
-                    //else
-                    //{
-                    //    cache = false;
-                    //}
-                    if (attributes.First<CosmosDBAttribute>().RU > 400)
+                }
+                if (attributes.First<CosmosDBAttribute>().RU > 400)
+                {
+                    RU = attributes.First<CosmosDBAttribute>().RU;
+                }
+                else
+                {
+                    RU = CollectionThroughput;
+                }
+                //如果表存在于数据则检查RU是否变动,如果不存在则执行创建DocumentCollection
+                if (CosmosDict.nameCosmos.TryGetValue(CollectionName, out CosmosModelInfo cosmosModelInfo))
+                { //更新RU
+
+                    cosmosModelInfo.cache = cache;
+                    Container container = CosmosClient.GetDatabase(DatabaseId).GetContainer(cosmosModelInfo.container.Id);
+                    int? throughputResponse = await container.ReadThroughputAsync();
+                    if (throughputResponse < RU)
                     {
-                        RU = attributes.First<CosmosDBAttribute>().RU;
+                        await CosmosClient.GetDatabase(DatabaseId).GetContainer(cosmosModelInfo.container.Id).ReplaceThroughputAsync(RU);
                     }
-                    else
+                    CosmosModelInfo cosmos = new CosmosModelInfo { container = container, cache = cache, monitor = monitor, type = type };
+                    CosmosDict.nameCosmos[CollectionName] = cosmos;
+                    CosmosDict.typeCosmos.Add(type.Name, cosmos);
+                }
+                else {
+                    ContainerProperties containerProperties = new ContainerProperties { Id = CollectionName, DefaultTimeToLive = -1 };
+                    if (!string.IsNullOrEmpty(PartitionKey))
                     {
-                        RU = CollectionThroughput;
-                    }
-                    //如果表存在于数据则检查RU是否变动,如果不存在则执行创建DocumentCollection
-                    if (DocumentCollectionDict.TryGetValue(CollectionName, out CosmosModelInfo cosmosModelInfo))
-                    { //更新RU
-
-                        cosmosModelInfo.cache = cache;
-                        Container container = CosmosClient.GetDatabase(DatabaseId).GetContainer(cosmosModelInfo.container.Id);
-                        int? throughputResponse = await container.ReadThroughputAsync();
-                        if (throughputResponse < RU)
-                        {
-                            await CosmosClient.GetDatabase(DatabaseId).GetContainer(cosmosModelInfo.container.Id).ReplaceThroughputAsync(RU);
-                        }
-                        DocumentCollectionDict[CollectionName] = new CosmosModelInfo { container = container, cache = cache, monitor = monitor, type = type };
+                        containerProperties.PartitionKeyPath = "/" + PartitionKey;
                     }
-                    else
+                    if (RU > CollectionThroughput)
                     {
-                        ContainerProperties containerProperties = new ContainerProperties { Id = CollectionName ,DefaultTimeToLive=-1 };
-
-                        if (!string.IsNullOrEmpty(PartitionKey))
-                        {
-                            containerProperties.PartitionKeyPath = "/" + PartitionKey;
-                        }
-                        if (RU > CollectionThroughput)
-                        {
-                            CollectionThroughput = RU;
-                        }
-                        Container containerWithConsistentIndexing = await database.CreateContainerIfNotExistsAsync(containerProperties, throughput: CollectionThroughput);
-                        DocumentCollectionDict.TryAdd(CollectionName, new CosmosModelInfo { container = containerWithConsistentIndexing, cache = cache, monitor = monitor, type = type });
+                        CollectionThroughput = RU;
                     }
+                    Container containerWithConsistentIndexing = await database.CreateContainerIfNotExistsAsync(containerProperties, throughput: CollectionThroughput);
+                    CosmosModelInfo cosmos = new CosmosModelInfo { container = containerWithConsistentIndexing, cache = cache, monitor = monitor, type = type };
+                    CosmosDict.nameCosmos[CollectionName] = cosmos;
+                    CosmosDict.typeCosmos.Add(type.Name, cosmos);
                 }
-                if (isMonitor)
-                {
-                    ContainerProperties leaseProperties = new ContainerProperties { Id = leaseId, PartitionKeyPath = "/id", DefaultTimeToLive = -1 };
-                    Container leaseContainer = await database.CreateContainerIfNotExistsAsync(leaseProperties, throughput: CollectionThroughput);
-                    DocumentCollectionDict.TryAdd(leaseId, new CosmosModelInfo { container = leaseContainer, cache = false, monitor = false });
-                }
-                return DocumentCollectionDict;
             }
-            catch (CosmosException e)
+            if (isMonitor)
             {
-                throw new BizException(e.Message, 500, e.StackTrace);
+                ContainerProperties leaseProperties = new ContainerProperties { Id = leaseId, PartitionKeyPath = "/id", DefaultTimeToLive = -1 };
+                Container leaseContainer = await database.CreateContainerIfNotExistsAsync(leaseProperties, throughput: CollectionThroughput);
+                CosmosDict.nameCosmos.TryAdd(leaseId, new CosmosModelInfo { container = leaseContainer, cache = false, monitor = false });
             }
+            return CosmosDict;
         }
 
-      
-
-
         private string GetPartitionKey<T>()
         {
             Type type = typeof(T);
@@ -225,7 +228,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             }
             if (attrProperties.Count <= 0)
             {
-                throw new BizException(type.Name + "has no PartitionKey !");
+                throw new BizException(type.Name + " has no PartitionKey !");
             }
             else
             {
@@ -237,41 +240,41 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             }
         }
 
-
         private async Task<CosmosModelInfo> InitializeCollection<T>()
         {
             Type type = typeof(T);
             string partitionKey = GetPartitionKey<T>();
-            string CollectionName;
+            CosmosDBAttribute cosmosDBAttribute = null;
             IEnumerable<CosmosDBAttribute> attributes = type.GetCustomAttributes<CosmosDBAttribute>(true);
-            if (!string.IsNullOrEmpty(attributes.First<CosmosDBAttribute>().Name))
+            if (attributes != null && !string.IsNullOrEmpty(attributes.First<CosmosDBAttribute>().Name))
             {
-                CollectionName = attributes.First<CosmosDBAttribute>().Name;
+                cosmosDBAttribute = attributes.First<CosmosDBAttribute>();
             }
-            else
-            {
-                CollectionName = type.Name;
+            else {
+                throw new BizException(type.Name+"未指定CosmosDB表名",ResponseCode.PARAMS_ERROR);
             }
-            return await InitializeCollection(CollectionName, partitionKey);
+            
+            return await InitializeCollection(cosmosDBAttribute, type.Name, partitionKey);
         }
-
-        private async Task<CosmosModelInfo> InitializeCollection(string CollectionName, string PartitionKey)
+        private async Task<CosmosModelInfo> InitializeCollection(CosmosDBAttribute cosmosDBAttribute, string typeName, string PartitionKey)
         {
             /////内存中已经存在这个表则直接返回
-            if (DocumentCollectionDict.TryGetValue(CollectionName, out CosmosModelInfo cosmosModelInfo))
+            if (CosmosDict.typeCosmos.TryGetValue(typeName, out CosmosModelInfo cosmosModelInfo))
             {
                 return cosmosModelInfo;
             }///如果没有则尝试默认创建
             else
             {
-                ContainerProperties containerProperties = new ContainerProperties { Id = CollectionName };
+                ContainerProperties containerProperties = new ContainerProperties { Id = cosmosDBAttribute.Name };
                 if (!string.IsNullOrEmpty(PartitionKey))
                 {
-                    containerProperties.PartitionKeyPath = "/" + PartitionKey;
+                    containerProperties.PartitionKeyPath = "/"+ PartitionKey;
                 }
-                Container containerWithConsistentIndexing = await database.CreateContainerIfNotExistsAsync(containerProperties, throughput: CollectionThroughput);
-                CosmosModelInfo cosmosModel = new CosmosModelInfo { container = containerWithConsistentIndexing, cache = false };
-                DocumentCollectionDict.TryAdd(CollectionName, cosmosModel);
+
+                Container containerWithConsistentIndexing = await database.CreateContainerIfNotExistsAsync(containerProperties, throughput: cosmosDBAttribute.RU);
+                CosmosModelInfo cosmosModel = new CosmosModelInfo { container = containerWithConsistentIndexing, cache = cosmosDBAttribute.Cache,monitor= cosmosDBAttribute.Monitor };
+                CosmosDict. nameCosmos.TryAdd(cosmosDBAttribute.Name, cosmosModel);
+                CosmosDict.typeCosmos.TryAdd(typeName, cosmosModel);
                 return cosmosModel;
             }
         }
@@ -281,10 +284,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         /// <typeparam name="T"></typeparam>
         /// <param name="list"></param>
         /// <returns></returns>
-        private async Task<List<T>> DeleteTTL<T>(List<T> list)where T:ID {
+        private async Task<List<T>> DeleteTTL<T>(List<T> list) where T : ID
+        {
             CosmosModelInfo container = await InitializeCollection<T>();
-            list.ForEach(x=> { x.ttl = ttl; });
-            list= await SaveOrUpdateAll(list);
+            list.ForEach(x => { x.ttl = ttl; });
+            list = await SaveOrUpdateAll(list);
             if (container.cache && RedisHelper.Instance != null)
             {
                 list.ForEach(async x => {
@@ -293,17 +297,22 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             }
             return list;
         }
+
+
         public async Task<List<IdPk>> DeleteAll<T>(List<IdPk> ids) where T : ID
         {
+
+         //   string pk = GetPartitionKey<T>();
             CosmosModelInfo container = await InitializeCollection<T>();
             List<IdPk> idPks = new List<IdPk>();
             if (container.monitor)
             {
-                List<T> list= await FindByDict<T>(new Dictionary<string, object>() { { "id", ids.Select(x => x.id).ToArray() } });
-                list= await DeleteTTL(list);
+                List<T> list = await FindByDict<T>(new Dictionary<string, object>() { { "id", ids.Select(x => x.id).ToArray() } });
+                list = await DeleteTTL(list);
                 return ids;
             }
-            else {
+            else
+            {
                 int pages = (int)Math.Ceiling((double)ids.Count / pageSize);
                 Stopwatch stopwatch = Stopwatch.StartNew();
                 for (int i = 0; i < pages; i++)
@@ -317,11 +326,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                             {
                                 using (ResponseMessage response = task.Result)
                                 {
-                                    idPks.Add(new IdPk { id = item.id, pk = item.pk.ToString(), StatusCode = response.StatusCode });
-                                //    if (!response.IsSuccessStatusCode)
-                                //    {
-                                //    }
-                            }
+                                    idPks.Add(new IdPk { id = item.id, pk = item.pk, StatusCode = response.StatusCode });
+                                    //    if (!response.IsSuccessStatusCode)
+                                    //    {
+                                    //    }
+                                }
                             }
                             ));
                     });
@@ -336,10 +345,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 stopwatch.Stop();
                 return idPks;
             }
-
-           
         }
-
         public async Task<List<IdPk>> DeleteAll<T>(Dictionary<string, object> dict) where T : ID
         {
             if (dict.Keys.Count > 0)
@@ -347,10 +353,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 List<T> list = await FindByDict<T>(dict);
                 return await DeleteAll(list);
             }
-            else {
-                throw new  BizException("参数为空", 500);
+            else
+            {
+                throw new BizException("参数为空", 500);
             }
-           
+
         }
         public async Task<List<IdPk>> DeleteAll<T>(List<T> enyites) where T : ID
         {
@@ -362,13 +369,15 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             if (container.monitor)
             {
                 enyites = await DeleteTTL(enyites);
-                foreach (T t in enyites) {
+                foreach (T t in enyites)
+                {
                     object o = type.GetProperty(pk).GetValue(t, null);
-                    idPks.Add(new IdPk { id = t.id, pk =o.ToString(), StatusCode = HttpStatusCode .NoContent});
+                    idPks.Add(new IdPk { id = t.id, pk = o.ToString(), StatusCode = HttpStatusCode.NoContent });
                 }
                 return idPks;
             }
-            else {
+            else
+            {
                 int pages = (int)Math.Ceiling((double)enyites.Count / pageSize);
                 Stopwatch stopwatch = Stopwatch.StartNew();
                 for (int i = 0; i < pages; i++)
@@ -408,27 +417,30 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 return idPks;
             }
         }
-
         public async Task<IdPk> DeleteAsync<T>(IdPk idPk) where T : ID
         {
             return await DeleteAsync<T>(idPk.id, idPk.pk);
         }
         public async Task<IdPk> DeleteAsync<T>(string id, string pk) where T : ID
         {
+
+          //  pk = GetPartitionKey<T>();
             CosmosModelInfo container = await InitializeCollection<T>();
             if (container.monitor)
             {
-                List<T> list=  await FindByDict<T>(new Dictionary<string, object>() { { "id", id } });
+                List<T> list = await FindByDict<T>(new Dictionary<string, object>() { { "id", id } });
                 if (list.Count > 0)
                 {
                     await DeleteTTL<T>(list);
                     return new IdPk { id = id, pk = pk, StatusCode = HttpStatusCode.NoContent };
                 }
-                else {
+                else
+                {
                     throw new BizException("未找到ID匹配的数据,删除失败");
                 }
             }
-            else {
+            else
+            {
                 ResponseMessage response = await container.container.DeleteItemStreamAsync(id: id, partitionKey: new PartitionKey(pk));
                 if (container.cache && RedisHelper.Instance != null)
                 {
@@ -436,7 +448,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 }
                 return new IdPk { id = id, pk = pk, StatusCode = response.StatusCode };
             }
-            
+
         }
 
         public async Task<IdPk> DeleteAsync<T>(T entity) where T : ID
@@ -444,33 +456,29 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             CosmosModelInfo container = await InitializeCollection<T>();
             string partitionKey = GetPartitionKey<T>();
             Type type = typeof(T);
-            object o = type.GetProperty(partitionKey).GetValue(entity, null);
+             object o = type.GetProperty(partitionKey).GetValue(entity, null);
             if (container.monitor)
             {
-                await DeleteTTL<T>(new List<T>() { entity});
+                await DeleteTTL<T>(new List<T>() { entity });
                 return new IdPk { id = entity.id, pk = o.ToString(), StatusCode = HttpStatusCode.NoContent };
             }
-            else {
+            else
+            {
                 ResponseMessage response = await container.container.DeleteItemStreamAsync(id: entity.id, partitionKey: new PartitionKey(o.ToString()));
                 if (container.cache && RedisHelper.Instance != null)
                 {
                     await RedisHelper.HDelAsync(CacheCosmosPrefix + container.container.Id, entity.id);
                 }
-                return new IdPk { id = entity.id, pk = o.ToString(), StatusCode = response.StatusCode };
+                return new IdPk { id = entity.id, pk = partitionKey, StatusCode = response.StatusCode };
             }
         }
-        //public async Task<T> DeleteAsync<T>(string id) where T : ID
-        //{
-        //    Container container = await InitializeCollection<T>();
-        //    ItemResponse<T> response = await container.DeleteItemAsync<T>(id: id, partitionKey: new PartitionKey(GetPartitionKey<T>()));
-        //    return response.Resource;
-        //}
-
         public async Task<List<T>> FindAll<T>(List<string> propertys = null) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
+            string pk = typeof(T).Name;
             StringBuilder sql;
             sql = SQLHelperParametric.GetSQLSelect(propertys);
+            sql.Append(" where c.pk ='"+ pk + "'");
             CosmosDbQuery cosmosDbQuery = new CosmosDbQuery { QueryText = sql.ToString() };
             FeedIterator<T> query = container.container.GetItemQueryIterator<T>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition);
             return await ResultsFromFeedIterator(query);
@@ -514,9 +522,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
 
             return results;
         }
-        public async Task<List<dynamic>> FindByDict(string CollectionName, Dictionary<string, object> dict, string partitionKey = null, List<string> propertys = null)
+        public async Task<List<dynamic>> FindByDict(string CollectionName, Dictionary<string, object> dict, List<string> propertys = null)
         {
-            if (DocumentCollectionDict.TryGetValue(CollectionName, out CosmosModelInfo container))
+            if (CosmosDict.typeCosmos.TryGetValue(CollectionName, out CosmosModelInfo container))
             {
                 //StringBuilder sql = new StringBuilder("select value(c) from c");
                 //SQLHelper.GetSQL(dict, ref sql);
@@ -525,9 +533,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 //    QueryText = sql.ToString()
 
                 //};
+
+                string pk = container.type.Name;
                 StringBuilder sql;
                 sql = SQLHelperParametric.GetSQLSelect(propertys);
-                CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql);
+                CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql, pk);
                 QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(-1, null));
                 FeedIterator<dynamic> query = container.container.GetItemQueryIterator<dynamic>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: queryRequestOptions);
                 return await ResultsFromFeedIterator(query);
@@ -539,16 +549,27 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
 
         }
 
-        public async Task<List<dynamic>> FindCountByDict(string CollectionName, Dictionary<string, object> dict, string partitionKey = null)
+        public async Task<List<int>> FindCountByDict<T>(Dictionary<string, object> dict) {
+            CosmosModelInfo container = await InitializeCollection<T>();
+            string pk = typeof(T).Name;
+            StringBuilder sql = new StringBuilder("select  value count(c)  from c");
+            CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql, pk);
+            QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(-1, null));
+            FeedIterator<int> query = container.container.GetItemQueryIterator<int>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: queryRequestOptions);
+            return await ResultsFromFeedIterator(query);
+        }
+
+        public async Task<List<dynamic>> FindCountByDict(string CollectionName, Dictionary<string, object> dict)
         {
-            if (DocumentCollectionDict.TryGetValue(CollectionName, out CosmosModelInfo container))
+            if (CosmosDict.typeCosmos.TryGetValue(CollectionName, out CosmosModelInfo container))
             {
+                string pk = container.type.Name;
                 dict.Remove("@CURRPAGE");
                 dict.Remove("@PAGESIZE");
                 dict.Remove("@ASC");
                 dict.Remove("@DESC");
                 StringBuilder sql = new StringBuilder("select  value count(c)  from c");
-                CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql);
+                CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql, pk);
                 QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(-1, null));
                 FeedIterator<dynamic> query = container.container.GetItemQueryIterator<dynamic>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: queryRequestOptions);
                 return await ResultsFromFeedIterator(query);
@@ -559,16 +580,16 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             }
         }
 
-        public async Task<List<T>> FindByParams<T>(Dictionary<string, object> dict, string partitionKey = null, List<string> propertys = null) where T : ID
+        public async Task<List<T>> FindByParams<T>(Dictionary<string, object> dict, List<string> propertys = null) where T : ID
         {
-            return await FindByDict<T>(dict, partitionKey, propertys);
+            return await FindByDict<T>(dict, propertys);
         }
-        public async Task<List<T>> FindByDict<T>(Dictionary<string, object> dict, string partitionKey = null, List<string> propertys = null) where T : ID
+        public async Task<List<T>> FindByDict<T>(Dictionary<string, object> dict, List<string> propertys = null) where T : ID
         {
             StringBuilder sql;
             sql = SQLHelperParametric.GetSQLSelect(propertys);
-
-            CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql);
+            string pk = typeof(T).Name;
+            CosmosDbQuery cosmosDbQuery = SQLHelperParametric.GetSQL(dict, sql, pk);
             QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(-1, null));
             return await ResultsFromQueryAndOptions<T>(cosmosDbQuery, queryRequestOptions);
         }
@@ -576,6 +597,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
 
         private async Task<List<T>> ResultsFromQueryAndOptions<T>(CosmosDbQuery cosmosDbQuery, QueryRequestOptions queryOptions)
         {
+            if (cosmosDbQuery == null) {
+                return null;
+            }
             CosmosModelInfo container = await InitializeCollection<T>();
             FeedIterator<T> query = container.container.GetItemQueryIterator<T>(
                 queryDefinition: cosmosDbQuery.CosmosQueryDefinition,
@@ -623,6 +647,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         }
         public async Task<List<T>> FindLinq<T>(Expression<Func<T, bool>> query = null, Expression<Func<T, object>> order = null, bool isDesc = false) where T : ID
         {
+
+            string pk = typeof(T).Name;
+            query = query.And(x => x.pk == pk);
             //QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(itemsPerPage);
             QueryRequestOptions queryRequestOptions = GetDefaultQueryRequestOptions(itemsPerPage: GetEffectivePageSize(-1, null));
             FeedIterator<T> feedIterator;
@@ -684,33 +711,38 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
 
         public async Task<List<T>> FindSQL<T>(string sql, Dictionary<string, object> Parameters = null) where T : ID
         {
-            CosmosModelInfo container = await InitializeCollection<T>();
-            QueryRequestOptions queryOptions = GetQueryRequestOptions(GetEffectivePageSize(-1, null));
-            if (Parameters != null)
+            if (sql.Contains(".pk"))
             {
-                CosmosDbQuery cosmosDbQuery = new CosmosDbQuery
+                CosmosModelInfo container = await InitializeCollection<T>();
+                QueryRequestOptions queryOptions = GetQueryRequestOptions(GetEffectivePageSize(-1, null));
+                if (Parameters != null)
+                {
+                    CosmosDbQuery cosmosDbQuery = new CosmosDbQuery
+                    {
+                        QueryText = sql,
+                        Parameters = Parameters
+                    };
+                    FeedIterator<T> feedIterator = container.container
+                    .GetItemQueryIterator<T>(cosmosDbQuery.CosmosQueryDefinition, requestOptions: queryOptions);
+                    return await ResultsFromFeedIterator(feedIterator);
+                }
+                else
                 {
-                    QueryText = sql,
-                    Parameters = Parameters
-                };
-                FeedIterator<T> feedIterator = container.container
-                .GetItemQueryIterator<T>(cosmosDbQuery.CosmosQueryDefinition, requestOptions: queryOptions);
-                return await ResultsFromFeedIterator(feedIterator);
+                    QueryDefinition queryDefinition = new QueryDefinition(sql);
+                    return await ResultsFromFeedIterator<T>(container.container.GetItemQueryIterator<T>(queryDefinition));
+                }
             }
             else
             {
-                QueryDefinition queryDefinition = new QueryDefinition(sql);
-                return await ResultsFromFeedIterator<T>(container.container.GetItemQueryIterator<T>(queryDefinition));
+                throw new BizException("查询参数必须设置 .pk ", ResponseCode.PARAMS_ERROR);
             }
         }
-
-
-
         public async Task<T> Save<T>(T entity) where T : ID
         {
             try
             {
                 CosmosModelInfo container = await InitializeCollection<T>();
+                entity.pk = container.type.Name;
                 ItemResponse<T> response = await container.container.CreateItemAsync<T>(entity);
                 if (container.cache && RedisHelper.Instance != null)
                 {
@@ -742,7 +774,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             {
                 flag = true;
             }
-            string pk = GetPartitionKey<T>();
+            string partitionKey = GetPartitionKey<T>();
             Type type = typeof(T);
             Stopwatch stopwatch = Stopwatch.StartNew();
             for (int i = 0; i < pages; i++)
@@ -751,9 +783,10 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 List<KeyValuePair<PartitionKey, Stream>> itemsToInsert = new List<KeyValuePair<PartitionKey, Stream>>();
                 lists.ForEach(async x =>
                 {
+                    x.pk = type.Name;
                     MemoryStream stream = new MemoryStream();
                     await JsonSerializer.SerializeAsync(stream, x, new JsonSerializerOptions { IgnoreNullValues = true });
-                    object o = type.GetProperty(pk).GetValue(x, null);
+                    object o = type.GetProperty(partitionKey).GetValue(x, null);
                     KeyValuePair<PartitionKey, Stream> keyValue = new KeyValuePair<PartitionKey, Stream>(new PartitionKey(o.ToString()), stream);
                     itemsToInsert.Add(keyValue);
                 });
@@ -790,6 +823,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         public async Task<T> SaveOrUpdate<T>(T entity) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
+            entity.pk = container.type.Name;
             ItemResponse<T> response = await container.container.UpsertItemAsync(item: entity);
             if (container.cache && RedisHelper.Instance != null)
             {
@@ -819,7 +853,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             {
                 flag = true;
             }
-            string pk = GetPartitionKey<T>();
+            string partitionKey = GetPartitionKey<T>();
             Type type = typeof(T);
             Stopwatch stopwatch = Stopwatch.StartNew();
             for (int i = 0; i < pages; i++)
@@ -828,9 +862,10 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 List<KeyValuePair<PartitionKey, Stream>> itemsToInsert = new List<KeyValuePair<PartitionKey, Stream>>();
                 lists.ForEach(async x =>
                 {
+                    x.pk = type.Name;
                     MemoryStream stream = new MemoryStream();
                     await JsonSerializer.SerializeAsync(stream, x, new JsonSerializerOptions { IgnoreNullValues = true });
-                    object o = type.GetProperty(pk).GetValue(x, null);
+                     object o = type.GetProperty(partitionKey).GetValue(x, null);
                     KeyValuePair<PartitionKey, Stream> keyValue = new KeyValuePair<PartitionKey, Stream>(new PartitionKey(o.ToString()), stream);
                     itemsToInsert.Add(keyValue);
                 });
@@ -864,12 +899,13 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             stopwatch.Stop();
             return enyites;
         }
-
         public async Task<T> Update<T>(T entity) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
-            string pk = GetPartitionKey<T>();
-            object o = typeof(T).GetProperty(pk).GetValue(entity, null);
+            string partitionKey = GetPartitionKey<T>();
+            Type type = typeof(T);
+            entity.pk = type.Name;
+            object o = type.GetProperty(partitionKey).GetValue(entity, null);
             ItemResponse<T> response = await container.container.ReplaceItemAsync(entity, entity.id, new PartitionKey(o.ToString()));
             if (container.cache && RedisHelper.Instance != null)
             {
@@ -885,15 +921,12 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             }
             return response.Resource;
         }
-
-
         internal class Item
         {
             public string id { get; set; }
             public string pk { get; set; }
             public MemoryStream stream { get; set; }
         }
-
         public async Task<List<T>> UpdateAll<T>(List<T> enyites) where T : ID
         {
             //await Task.Run(() => Parallel.ForEach(entities, new ParallelOptions { MaxDegreeOfParallelism = 2 }, (item) =>
@@ -908,7 +941,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             {
                 flag = true;
             }
-            string pk = GetPartitionKey<T>();
+            string partitionKey = GetPartitionKey<T>();
             Type type = typeof(T);
             Stopwatch stopwatch = Stopwatch.StartNew();
             for (int i = 0; i < pages; i++)
@@ -917,9 +950,10 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 List<Item> itemsToInsert = new List<Item>();
                 lists.ForEach(async x =>
                 {
+                    x.pk = type.Name;
                     MemoryStream stream = new MemoryStream();
                     await JsonSerializer.SerializeAsync(stream, x, new JsonSerializerOptions { IgnoreNullValues = true });
-                    object o = type.GetProperty(pk).GetValue(x, null);
+                    object o = type.GetProperty(partitionKey).GetValue(x, null);
                     Item keyValue = new Item { id = x.id, pk = o.ToString(), stream = stream };
                     itemsToInsert.Add(keyValue);
                 });
@@ -953,26 +987,15 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             stopwatch.Stop();
             return enyites;
         }
-
-        //public void Dispose()
-        //{
-        //    Dispose(true);
-        //}
-        //protected virtual void Dispose(bool disposing)
-        //{
-        //    if (disposing)
-        //    {
-        //        CosmosClient?.Dispose();
-        //    }
-        //}
-        private async Task<T> FindByIdAsSql<T>(string id) where T : ID
+        private async Task<List<T>> FindByIdAsSql<T>(string id) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
+            string pk = container.type.Name;
             CosmosDbQuery cosmosDbQuery = new CosmosDbQuery
             {
                 QueryText = @"SELECT *
                             FROM    c 
-                            WHERE   c.id = @id",
+                            WHERE c.pk='" + pk + "' and   c.id = @id",
                 Parameters = new Dictionary<string, object>
                  {
 
@@ -981,21 +1004,24 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             };
             FeedIterator<T> feedIterator = container.container
                .GetItemQueryIterator<T>(cosmosDbQuery.CosmosQueryDefinition);
-            return (await ResultsFromFeedIterator(feedIterator)).SingleOrDefault();
+            return (await ResultsFromFeedIterator(feedIterator)).ToList();
         }
-
-
         public async Task<T> FindByIdPk<T>(string id, string pk) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
-            ItemResponse<T> response = await container.container.ReadItemAsync<T>(id: id, partitionKey: new PartitionKey(pk));
-            return response.Resource;
+            try {
+                ItemResponse<T> response = await container.container.ReadItemAsync<T>(id: id, partitionKey: new PartitionKey(pk));
+                return response.Resource;
+            }
+            catch (Exception ex) {
+                return default;
+            }
+           
         }
-
-        public async Task<T> FindById<T>(string id, bool cache = true) where T : ID
+        public async Task<List<T>> FindById<T>(string id, bool cache = true) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
-            if (container.cache && RedisHelper.Instance != null  && cache==true)
+            if (container.cache && RedisHelper.Instance != null && cache == true)
             {
 
                 return await RedisHelper.CacheShellAsync(CacheCosmosPrefix + container.container.Id, id, timeoutSeconds, () => { return FindByIdAsSql<T>(id); });
@@ -1007,7 +1033,6 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             }
 
         }
-
         public async Task<List<T>> FindByIds<T>(List<string> ids) where T : ID
         {
             CosmosModelInfo container = await InitializeCollection<T>();
@@ -1040,46 +1065,44 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                 return await FindByDict<T>(new Dictionary<string, object> { { "id", ids.ToArray() } });
             }
         }
-
-        public async Task<dynamic> FindById(string CollectionName, string id)
+        public async Task<dynamic> FindById(string typeName, string id)
         {
-            if (DocumentCollectionDict.TryGetValue(CollectionName, out CosmosModelInfo container))
+            if (CosmosDict.typeCosmos.TryGetValue(typeName, out CosmosModelInfo container))
             {
                 if (container.cache && RedisHelper.Instance != null)
                 {
 
-                    return await RedisHelper.CacheShellAsync(CacheCosmosPrefix + container.container.Id, id, timeoutSeconds, () => { return FindByDict(CollectionName, new Dictionary<string, object> { { "id", id } }); });
+                    return await RedisHelper.CacheShellAsync(CacheCosmosPrefix + container.container.Id, id, timeoutSeconds, () => { return FindByDict(typeName, new Dictionary<string, object> { { "id", id } }); });
 
                 }
                 else
                 {
-                    return await FindByDict(CollectionName, new Dictionary<string, object> { { "id", id } });
+                    return await FindByDict(typeName, new Dictionary<string, object> { { "id", id } });
                 }
             }
             else
             {
-                throw new BizException("CollectionName named:" + CollectionName + " dose not exsit in Database!");
+                throw new BizException("CollectionName named:" + typeName + " dose not exsit in Database!");
             }
         }
-
-        public async Task<List<dynamic>> FindByIds(string CollectionName, List<string> ids)
+        public async Task<List<dynamic>> FindByIds(string typeName, List<string> ids)
         {
-            if (DocumentCollectionDict.TryGetValue(CollectionName, out CosmosModelInfo container))
+            if (CosmosDict. typeCosmos.TryGetValue(typeName, out CosmosModelInfo container))
             {
                 if (container.cache && RedisHelper.Instance != null)
                 {
 
-                    return await RedisHelper.CacheShellAsync(CacheCosmosPrefix + container.container.Id, timeoutSeconds, () => { return FindByDict(CollectionName, new Dictionary<string, object> { { "id", ids.ToArray() } }); });
+                    return await RedisHelper.CacheShellAsync(CacheCosmosPrefix + container.container.Id, timeoutSeconds, () => { return FindByDict(typeName, new Dictionary<string, object> { { "id", ids.ToArray() } }); });
 
                 }
                 else
                 {
-                    return await FindByDict(CollectionName, new Dictionary<string, object> { { "id", ids.ToArray() } });
+                    return await FindByDict(typeName, new Dictionary<string, object> { { "id", ids.ToArray() } });
                 }
             }
             else
             {
-                throw new BizException("CollectionName named:" + CollectionName + " dose not exsit in Database!");
+                throw new BizException("CollectionName named:" + typeName + " dose not exsit in Database!");
             }
         }
     }

+ 18 - 0
TEAMModelOS.SDK/Module/AzureCosmosDBV3/CosmosDict.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
+{
+    public class CosmosDict
+    {
+        /// <summary>
+        /// 表名方式的连接
+        /// </summary>
+        public Dictionary<string, CosmosModelInfo> nameCosmos { get; set; } = new Dictionary<string, CosmosModelInfo>();
+        /// <summary>
+        /// 类类型的连接
+        /// </summary>
+        public Dictionary<string, CosmosModelInfo> typeCosmos { get; set; } = new Dictionary<string, CosmosModelInfo>();
+    }
+}

+ 15 - 0
TEAMModelOS.SDK/Module/AzureCosmosDBV3/CosmosModelInfo.cs

@@ -0,0 +1,15 @@
+using Microsoft.Azure.Cosmos;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
+{
+    public class CosmosModelInfo
+    {
+        public Container container { get; set; }
+        public bool cache { get; set; }
+        public bool monitor { get; set; } = false;
+        public Type type { get; set; }
+    }
+}

+ 8 - 6
TEAMModelOS.SDK/Module/AzureCosmosDBV3/IAzureCosmosDBV3Repository.cs

@@ -74,11 +74,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         /// <param name="query"></param>
         /// <returns></returns>
         Task<List<T>> FindLinq<T>(Expression<Func<T, bool>> query = null, Expression<Func<T, object>> order = null, bool isDesc = false) where T : ID;
-        Task<List<T>> FindByParams<T>(Dictionary<string, object> dict, string partitionKey = null, List<string> propertys = null) where T : ID;
-        Task<List<T>> FindByDict<T>(Dictionary<string, object> dict, string partitionKey = null, List<string> propertys = null) where T : ID;
-        Task<List<dynamic>> FindByDict(string CollectionName, Dictionary<string, object> dict, string partitionKey = null, List<string> propertys = null);
-        Task<List<dynamic>> FindCountByDict(string CollectionName, Dictionary<string, object> dict, string partitionKey = null);
-        Task<Dictionary<string,CosmosModelInfo>> InitializeDatabase();
+        Task<List<T>> FindByParams<T>(Dictionary<string, object> dict,  List<string> propertys = null) where T : ID;
+        Task<List<T>> FindByDict<T>(Dictionary<string, object> dict,List<string> propertys = null) where T : ID;
+        Task<List<dynamic>> FindByDict(string CollectionName, Dictionary<string, object> dict, List<string> propertys = null);
+        Task<List<dynamic>> FindCountByDict(string CollectionName, Dictionary<string, object> dict);
+        Task<CosmosDict> InitializeDatabase();
         /// <summary>
         /// 根据ID获取  是否从cache获取  默认是
         /// </summary>
@@ -86,9 +86,11 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
         /// <param name="id"></param>
         /// <param name="cache"></param>
         /// <returns></returns>
-        Task<T>FindById<T>(string id,bool cache=true) where T : ID;
+        Task<List<T>>FindById<T>(string id,bool cache=true) where T : ID;
         Task<List<T>> FindByIds<T>(List<string> ids) where T : ID;
         Task<dynamic> FindById(string CollectionName, string id);
         Task<List<dynamic>> FindByIds (string CollectionName, List<string> ids);
+        Task<List<int>> FindCountByDict<T>(Dictionary<string, object> dict);
+     
     }
 }

+ 3 - 1
TEAMModelOS.SDK/Module/AzureCosmosDBV3/ID.cs

@@ -9,6 +9,8 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
     {
         string id { get; set; }
        
-         int? ttl { get; set; }
+        int? ttl { get; set; }
+        string pk { get; set; }
+        string code { get; set; }
     }
 }

+ 21 - 5
TEAMModelOS.SDK/Module/AzureCosmosDBV3/SQLHelperParametric.cs

@@ -71,8 +71,9 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
             return sql;
         }
 
-        public static void DictIsNotNULL(Dictionary<string, object> dict)
+        public static bool DictIsNotNULL(Dictionary<string, object> dict)
         {
+             
             Dictionary<string, object> keyValuePairs = new Dictionary<string, object>();
             foreach (KeyValuePair<string, object> keyValuePair in dict)
             {
@@ -105,13 +106,22 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                     dict.Remove(keyValuePair.Key);
                 }
             }
+            if (dict.Keys.Count > 0)
+            {
+                return true;
+            }
+            else {
+                return false;
+            }
         }
 
-        public static CosmosDbQuery GetSQL(Dictionary<string, object> dict, StringBuilder sql)
+        public static CosmosDbQuery GetSQL(Dictionary<string, object> dict, StringBuilder sql,string pk=null)
         {
             if (dict != null)
             {
-                DictIsNotNULL(dict);
+                if (!DictIsNotNULL(dict)) {
+                    return null;
+                } 
                 Dictionary<string, object> parmeters = new Dictionary<string, object>();
 
                 int offsetNum = -1;
@@ -265,8 +275,14 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDBV3
                     }
                     logicOperNum += 1;
                 }
-
-                sql.Append(" where 1=1 ").Append(WhereString);
+                if (pk == null)
+                {
+                    sql.Append(" where 1=1 ").Append(WhereString);
+                }
+                else {
+                    sql.Append(" where c.pk='"+pk+"'").Append(WhereString);
+                }
+                
 
                 if (ASC != null)
                 {

+ 4 - 14
TEAMModelOS.SDK/Module/Cache/CSRedisCacheService.cs

@@ -15,23 +15,13 @@ namespace TEAMModelOS.SDK.Module.Cache
     {
         protected IDistributedCache _cache;
 
-   // private ConnectionMultiplexer _connection;
-
-    private readonly string _instance;
-    public CSRedisCacheService(IDistributedCache cache //RedisCacheOptions options, int database = 0
-        )
-    {
+        public CSRedisCacheService(IDistributedCache cache  )
+        {
             _cache = cache;
-       // _connection = ConnectionMultiplexer.Connect(options.Configuration);
-       //   _cache = _connection.GetDatabase(database);
-       //  _instance = options.InstanceName;
         }
 
-    //public string GetKeyForRedis(string key)
-    //{
-    //    return _instance + key;
-    //}
-        /// <summary>
+    
+     /// <summary>
      /// 验证缓存项是否存在
      /// </summary>
      /// <param name="key">缓存Key</param>

+ 1 - 1
TEAMModelOS.SDK/Module/Grpc/AspNetCore/Internal/BindMethodFinder.cs

@@ -10,7 +10,7 @@ namespace Grpc.Extension.AspNetCore.Internal
     internal static class BindMethodFinder
     {
         private const BindingFlags BindMethodBindingFlags = BindingFlags.Public | BindingFlags.Static;
-
+  
         internal static MethodInfo? GetBindMethod(Type serviceType)
         {
             if (typeof(IGrpcService).IsAssignableFrom(serviceType))

+ 6 - 1
TEAMModelOS.SDK/Module/Grpc/AspNetCore/Internal/ProviderServiceBinder.cs

@@ -140,7 +140,12 @@ namespace Grpc.Extension.AspNetCore.Internal
 
             return (invoker, metadata);
         }
-
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="methodName"></param>
+        /// <param name="methodParameters"></param>
+        /// <returns></returns>
         private MethodInfo? GetMethod(string methodName, Type[] methodParameters)
         {
             Type? currentType = typeof(TService);

+ 1 - 1
TEAMModelOS.Service/Models/Core/CodeValue.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     public class CodeValue
     {

+ 1 - 1
TEAMModelOS.Service/Models/Learn/ProcessRes.cs

@@ -4,7 +4,7 @@ using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 作业附件

+ 1 - 1
TEAMModelOS.Service/Models/Core/ResourceReference.cs

@@ -4,7 +4,7 @@ using System.Collections.Generic;
 using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     [TableName(Name = "CoreResourceReference")]
     public class ResourceReference : TableEntity

+ 4 - 11
TEAMModelOS.Service/Models/Syllabus/SyllabusNode.cs

@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
     [ProtoContract]
     public class SyllabusNode
@@ -53,21 +53,14 @@ namespace TEAMModelOS.Service.Models.Syllabus
         [Required(ErrorMessage = "{0} 必须填写")]
         [ProtoMember(7)]
         public int type { get; set; }
-        /// <summary>
-        /// 备注
-        /// </summary>
-        //public string remark { get; set; }
+        
         /// <summary>
         /// 节点Key
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [ProtoMember(8)]
         public string nodeKey { get; set; }
-        ///// <summary>
-        /////主键
-        ///// </summary>
-        //[Required(ErrorMessage = "{0} 必须填写")]
-        //public string Id { get; set; }
+       
         /// <summary>
         /// 父级
         /// </summary>
@@ -80,7 +73,7 @@ namespace TEAMModelOS.Service.Models.Syllabus
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [ProtoMember(10)]
-        public string volumeCode { get; set; }
+        public string code { get; set; }
         /// <summary>
         /// 数据状态
         /// </summary>

+ 1 - 1
TEAMModelOS.Service/Models/Syllabus/SyllabusTree.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
     public class SyllabusTree :SyllabusNode
     {

+ 2 - 2
TEAMModelOS.Service/Models/Learn/Target.cs

@@ -4,7 +4,7 @@ using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 发布对象
@@ -17,7 +17,7 @@ namespace TEAMModelOS.Service.Models.Learn
         public string classroomCode { get; set; }
         [Required(ErrorMessage = "{0} 必须填写")]
         [ProtoMember(2)]
-        public string scopeCode { get; set; }
+        public string code { get; set; }
         [ProtoMember(3)]
         public string classroomName { get; set; }
 

+ 16 - 28
TEAMModelOS.Service/Models/Exam/ExamItem.cs

@@ -4,25 +4,28 @@ using System.ComponentModel.DataAnnotations;
 using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Core;
-using TEAMModelOS.Service.Models.Learn;
 
-namespace TEAMModelOS.Service.Models.Exam.Models
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
-    /// 题目信息
+    ///  Teaching materials 教学材料  题目信息
     /// </summary>
-    [CosmosDB(RU = 400, Name = "ExamItem",Cache =true)]
-    public class ExamItem :ID
+    [CosmosDB(RU = 400, Name = "Common", Cache =true)]
+    public class ItemInfo :ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        //[PartitionKey(name = "ExamItem")]
+        public string pk { get; set; }
         public int? ttl { get; set; }
-        public ExamItem()
+        public ItemInfo()
         {
-            children = new List<ExamItem>();
+            children = new List<ItemInfo>();
             option = new List<CodeValue>();
             answer = new List<string>();
             points = new List<string>();
             gradeCode = new List<string>();
+            repairResource = new List<ProcessRes>();
         }
         public string shaCode { get; set; }
         //题干
@@ -45,47 +48,32 @@ namespace TEAMModelOS.Service.Models.Exam.Models
         public List<string> points { get; set; }
         //认知层次 应用 综合 理解 评鉴 知识
         public string field { get; set; }
-        public List<ExamItem> children { get; set; }
+        public List<ItemInfo> children { get; set; }
         // 配分  
         public double score { get; set; }
         /// <summary>
         /// 题号
         /// </summary>
         public int order { get; set; }
-        //补救内容
+        //补救
         public string repair { get; set; }
+
         /// <summary>
         /// 补救资源
         /// </summary>
         public List<ProcessRes> repairResource { get; set; }
-        /// <summary>
-        /// 来源编码  个人 学校
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        public string scopeCode { get; set; }
+        
 
 
         public string subjectCode { get; set; }
         public string periodCode { get; set; }
         public List<string> gradeCode { get; set; }
-        /// <summary>
-        /// 学段
-        /// </summary>
-       // public string period { get; set; }
-        /// <summary>
-        /// 年级
-        /// </summary>
-      //  public List<string> grade { get; set; }
+        
         /// <summary>
         /// 难度
         /// </summary>
         public int level { get; set; }
         public string id { get ; set ; }
-        /// <summary>
-        /// 科目
-        /// </summary>
-      //  public string subject { get; set; }
         /// <summary>
         /// 是否综合题的小题
         /// </summary>

+ 14 - 26
TEAMModelOS.Service/Models/Syllabus/Knowledge.cs

@@ -8,19 +8,26 @@ using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
-    /// 知识点
+    ///Teaching materials 教学材料 --- 知识点,知识块
     /// </summary>
-    [CosmosDB(RU = 400, Name = "Knowledge", Cache = true, Monitor = true)]
+    [CosmosDB(RU = 400, Name = "Common", Cache = true )]
     [ProtoContract]
-    public class Knowledge : ID
+    public class Knowledge: ID
     {
-
-        public Knowledge() {
+        public Knowledge()
+        {
             points = new List<string>();
         }
+        /// <summary>
+        /// 学校编码 如果是教师私人知识点为醍摩豆id 否则为学校编码 
+        /// </summary>
+        [PartitionKey]
+        public string code { get; set; }
+        // [PartitionKey(name = "Knowledge")]
+        public string pk { get; set; }
         public int? ttl { get; set; }
         [ProtoMember(1)]
         public string id { get; set; }
@@ -50,14 +57,7 @@ namespace TEAMModelOS.Service.Models.Syllabus
         [ProtoMember(5)]
         public string subjectCode { get; set; }
 
-        /// <summary>
-        /// 学校编码 如果是教师私人知识点为醍摩豆id 否则为学校编码 
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [ProtoMember(6)]
-        [PartitionKey]
-        public string scopeCode { get; set; }
-
+       
 
 
         [ProtoMember(7)]
@@ -101,17 +101,5 @@ namespace TEAMModelOS.Service.Models.Syllabus
         public string period { get; set; }
         public int ownCount { get; set; }
         public int openCount { get; set; }
-
-        ///// <summary>
-        /////  school personal 学校或者个人
-        ///// </summary>
-        //[Required(ErrorMessage = "{0} 必须填写")]
-        //public string scope { get; set; }
-
-        /// <summary>
-        ///  醍摩豆id
-        /// </summary>
-        //[Required(ErrorMessage = "{0} 必须填写")]
-        //public string TEAMModelId { get; set; }
     }
 }

+ 11 - 9
TEAMModelOS.Service/Models/Syllabus/SyllabusResource.cs

@@ -7,20 +7,22 @@ using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "SyllabusResource",Cache = true)]
-    public class SyllabusResource : ID
+    /// <summary>
+    /// Teaching materials 教学材料 ---内容资源
+    /// </summary>
+    [CosmosDB(RU = 400, Name = "Common", Cache = true)]
+    public class Resource : ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        // [PartitionKey(name = "SyllabusResource")]
+        public string pk { get; set; }
         public int? ttl { get; set; }
         public string id { get; set; }
 
-        /// <summary>
-        /// 学校编码 如果是教师私人知识点为醍摩豆id 否则为学校编码 
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        public string scopeCode { get; set; }
+   
 
         /// <summary>
         /// 文件名字

+ 12 - 5
TEAMModelOS.Service/Models/Syllabus/Syllabuses.cs

@@ -5,11 +5,18 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "Syllabus")]
-    public class Syllabuses : ID
+    /// <summary>
+    /// Teaching materials 教学材料 ---课纲
+    /// </summary>
+    [CosmosDB(RU = 400, Name = "Common")]
+    public class Syllabus : ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        //[PartitionKey(name = "Syllabuses")]
+        public string pk { get; set; }
         public int? ttl { get; set; }
         /// <summary>
         /// 
@@ -21,8 +28,8 @@ namespace TEAMModelOS.Service.Models.Syllabus
         /// 册别编码
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        public string volumeCode { get; set; }
+      //  [PartitionKey]
+      //  public string volumeCode { get; set; }
 
         public List<SyllabusNode> children { get; set; }
     }

+ 2 - 5
TEAMModelOS.Service/Models/Syllabus/KnowledgeBlock.cs

@@ -2,7 +2,7 @@
 using System.ComponentModel.DataAnnotations;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
     [TableName(Name = "SyllabusKnowledgeBlock")]
     //
@@ -13,10 +13,7 @@ namespace TEAMModelOS.Service.Models.Syllabus
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         public string Name { get; set; }
-        /// <summary>
-        /// 描述
-        /// </summary>
-        // public string Description { get; set; }
+        
         /// <summary>
         /// 上级ID
         /// </summary>

+ 1 - 1
TEAMModelOS.Service/Models/Syllabus/KnowledgeBlockPoint.cs

@@ -2,7 +2,7 @@
 using System.ComponentModel.DataAnnotations;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
     [TableName(Name = "SyllabusKnowledgeBlockPoint")]
     //

+ 1 - 1
TEAMModelOS.Service/Models/Syllabus/KnowledgePoint.cs

@@ -2,7 +2,7 @@
 using System.ComponentModel.DataAnnotations;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 知识点

+ 7 - 11
TEAMModelOS.Service/Models/Syllabus/SyllabusVolume.cs

@@ -8,13 +8,16 @@ using Newtonsoft.Json;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 using ProtoBuf;
 
-namespace TEAMModelOS.Service.Models.Syllabus
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "SyllabusVolume",Monitor =true)]
+    [CosmosDB(RU = 400, Name = "Common", Monitor =true)]
     [ProtoContract]
-    public class SyllabusVolume :ID
+    public class Volume :ID
     {
-
+        [PartitionKey]
+        public string code { get; set; }
+        // [PartitionKey(name = "SyllabusVolume")]
+        public string pk { get; set; }
         public int? ttl { get; set; } 
         /// <summary>
         /// id生成规则
@@ -26,13 +29,6 @@ namespace TEAMModelOS.Service.Models.Syllabus
         /// </summary>
         [ProtoMember(2)]
         public int type { get; set; }
-        /// <summary>
-        /// Type 如果为0 则是学校编码  如果为1 则是seminar 专题/研讨/培训
-        /// </summary>
-        [PartitionKey]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [ProtoMember(3)]
-        public string scopeCode { get; set; }
         
 
         /// <summary>

+ 0 - 16
TEAMModelOS.Service/Models/Core/ContentVerify.cs

@@ -1,16 +0,0 @@
-using Microsoft.Azure.Cosmos.Table;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-
-namespace TEAMModelOS.Service.Models.Core
-{
-    [TableName(Name = "CoreContentVerify")]
-    public class ContentVerify : TableEntity
-    {
-        public string Content { get; set; }
-        public string AlgorithmType { get; set; }
-        public string DigestCode { get; set; }
-    }
-}

+ 0 - 40
TEAMModelOS.Service/Models/Core/LoginInfo.cs

@@ -1,40 +0,0 @@
-using Microsoft.Azure.Cosmos.Table;
-using Newtonsoft.Json;
-using System.Text.Json.Serialization;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-
-namespace TEAMModelOS.Service.Models.Core
-{
-    /// <summary>
-    /// 登录信息
-    /// </summary>
-    [TableName(Name = "CoreLoginInfo")]
-    public class LoginInfo : TableEntity
-    {
-        [JsonPropertyName("TEAMModelId")]
-        [JsonProperty("TEAMModelId")]
-        public string TeamModelId { get; set; }
-        public string Phone { get; set; }
-        public string Ticket { get; set; }
-        public string Name { get; set; }
-        public string Token { get; set; }
-        public string CountryCode { get; set; }
-        /// <summary>
-        /// 登录时间
-        /// </summary>
-        public long LoginTime { get; set; }
-        /// <summary>
-        /// 超时时间
-        /// </summary>
-        public long Timeout { get; set; }
-        /// <summary>
-        /// 到期时间
-        /// </summary>
-        public long Expires { get; set; }
-        /// <summary>
-        /// 作用域
-        /// </summary>
-        public string Scope { get; set; }
-
-    }
-}

+ 0 - 50
TEAMModelOS.Service/Models/Core/Teacher.cs

@@ -1,50 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using System.Text.Json.Serialization;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-
-namespace TEAMModelOS.Service.Models.Core
-{
-    [CosmosDB(RU = 400, Name = "CoreTeacher")]
-    public class Teacher:ID
-    {
-        public int? ttl { get; set; } 
-        public string id { get; set; }
-        /// <summary>
-        /// 0 动态id  透過第三方申請,未認證手機號,TEAMModelId暫時為virtualId但是不顯示在介面上,當使用者驗證手機號後TEAMModelId會變為手機號。
-        /// 1 动态id  透過手機號申請,TEAMModelId為手機號
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public int type { get; set; }
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string name { get; set; }
-        public string email { get; set; }
-        public string cellphone { get; set; }
-        [PartitionKey]
-        public string areaCode { get; set; }
-        public int verifyFlg { get; set; }
-        public int status { get; set; } = 0;
-        public long createDate { get; set; }
-        public Password password { get; set; }
-        public string exValue { get; set; }
-        public string product { get; set; }
-        public List<ProductToken> productToken { get; set; }
-        public string shortCode { get; set; }
-        public string profilePicture { get; set; }
-        public string profilePictureUrl { get; set; }
-        [JsonPropertyName("TEAMModelId")]
-        [JsonProperty("TEAMModelId")]
-        public string TEAMModelId { get; set; }
-        public string loginTime { get; set; }
-        public string virtualId { get; set; }
-        public List<Oauth> oauth { get; set; } // 0 1
-        public string haveDevice { get; set; }//2
-        public Classroom classroom { get; set; }
-        public string studentId { get; set; }
-        public int seatNo { get; set; }
-    }
-}

+ 0 - 173
TEAMModelOS.Service/Models/Courses/Course.cs

@@ -1,173 +0,0 @@
-using ProtoBuf;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Core;
-using TEAMModelOS.Service.Models.Syllabus;
-
-namespace TEAMModelOS.Service.Models.Courses
-{
-    /// <summary>
-    /// 课程
-    /// </summary>
-    [CosmosDB(RU = 400, Name = "Course")]
-    [ProtoContract]
-    public class Course : ID
-    {
-        public int? ttl { get; set; } 
-
-        /// <summary>
-        /// 学校编码 如果是教师私人知识点 则为 personal(写死) 否则为学校编码 
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        [ProtoMember(1)]
-        public string scopeCode { get; set; }
-
-
-        //[Required(ErrorMessage = "{0} 必须填写")]
-        //public string TEAMModelId { get; set; }
-        //public string schoolCode { get; set; }
-
-
-        /// <summary>
-        /// 基础信息
-        /// </summary>
-        [ProtoMember(2)]
-        public BaseInfo baseInfo { get; set; }
-
-        ///// <summary>
-        ///// personal:私有 school:校本
-        ///// </summary>
-        //[Required(ErrorMessage = "{0} 必须填写")]
-        //public string scope { get; set; }
-
-        /// <summary>
-        /// 协同教师
-        /// </summary>
-        [ProtoMember(3)]
-        public List<string> assistTeacher { get; set; }
-
-        /// <summary>
-        /// 上课时间表
-        /// </summary>
-        [ProtoMember(4)]
-        public List<CourseTime> courseTime { get; set; }
-
-        /// <summary>
-        /// 课程“教室” Classroom
-        /// </summary>
-        [ProtoMember(5)]
-        public List<string> classroom { get; set; }
-
-        /// <summary>
-        /// 关联课纲 SyllabusNode
-        /// </summary>
-        [ProtoMember(6)]
-        public List<string> syllabus { get; set; }
-
-        /// <summary>
-        /// id
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [ProtoMember(7)]
-        public string id { get; set; }
-
-    }
-
-    /// <summary>
-    /// 基础信息
-    /// </summary>
-    [ProtoContract]
-    public class BaseInfo
-    {
-        /// <summary>
-        /// 课程编码
-        /// </summary>
-        [ProtoMember(1)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string courseCode { get; set; }//'T968475'
-        
-        /// <summary>
-        /// 课程名称
-        /// </summary>
-        [ProtoMember(2)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string courseName { get; set; }// '一次函数极其图像'
-        
-        /// <summary>
-        /// 学段编码
-        /// </summary>
-        [ProtoMember(3)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string periodCode { get; set; }
-        
-        /// <summary>
-        /// 年级编码
-        /// </summary>
-        [ProtoMember(4)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string gradeCode { get; set; }
-        
-        /// <summary>
-        /// 学科编码
-        /// </summary>
-        [ProtoMember(5)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string subjectCode { get; set; }
-        
-        /// <summary>
-        /// 课程公告
-        /// </summary>
-        [ProtoMember(6)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string notice { get; set; }//
-    }
-
-
-    /// <summary>
-    /// 上课时间表
-    /// </summary>
-    [ProtoContract]
-    public class CourseTime
-    {
-
-        /// <summary>
-        /// 上课频率 每日、每周、每月、临时课程
-        /// </summary>
-        [ProtoMember(1)]
-        public string frequencyCode { get; set; }
-        /// <summary>
-        /// 课程开始时间
-        /// </summary>
-        [ProtoMember(2)]
-        public string beginTime { get; set; }
-        /// <summary>
-        /// 课程结束时间
-        /// </summary>
-        [ProtoMember(3)]
-        public string endTime { get; set; }
-        /// <summary>
-        /// 上课班级/教室
-        /// </summary>
-        [ProtoMember(4)]
-        public string classroomCode { get; set; } // Classroom
-        /// <summary>
-        /// 临时课程
-        /// </summary>
-        [ProtoMember(5)]
-        public List<string> frequencyName { get; set; }
-        /// <summary>
-        /// 每月课程
-        /// </summary>
-        //public string month { get; set; }
-        /// <summary>
-        /// 每周课程
-        /// </summary>
-        //public string weekly { get; set; }
-
-    }
-}

+ 0 - 39
TEAMModelOS.Service/Models/Courses/CourseStudentsGroup.cs

@@ -1,39 +0,0 @@
-using ProtoBuf;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-
-namespace TEAMModelOS.Service.Models.Courses
-{ 
-    /// <summary>
-    /// 课程 学生分组
-    /// </summary>
-    [CosmosDB(RU = 400, Name = "CourseStudentsGroup")]
-    public class CourseStudentsGroup :ID
-    {
-        public int? ttl { get; set; }
-        public string id { get; set; }
-        /// <summary>
-        /// 学校编码 如果是教师私人知识点 则为 personal(写死) 否则为学校编码 
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        [ProtoMember(1)]
-        public string scopeCode { get; set; }
-        //public List<ClassGroup> classGroups { get; set; }
-        public string classroomCode { get; set; }
-        public List<GroupStudent> groups { get; set; }
-    }
-
-  
-    public class GroupStudent
-    { 
-        public int seatNo { get; set; }
-        public string groupCode { get; set; }
-        public string groupName { get; set; }
-        public string studentId { get; set; }
-    }
-}

+ 0 - 39
TEAMModelOS.Service/Models/Exam/SimpleExam.cs

@@ -1,39 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-
-namespace TEAMModelOS.Service.Model.Exam.Models
-{
-    /// <summary>
-    /// 考试成绩信息
-    /// </summary>
-    [CosmosDB(RU = 400, Name = "SimpleExam")]
-    public class SimpleExam :ID
-    {
-        public int? ttl { get; set; }
-        public SimpleExam()
-        {
-            Classes = new List<Dictionary<string, int[]>>();
-            Result = new List<List<int>>();
-            Ids = new List<string>();
-            Point = new List<int>();
-        }
-        [JsonProperty(PropertyName = "id")]
-        public string id { get; set; }
-        public string Name { get; set; }
-        public string Time { get; set; }
-        [PartitionKey]
-        public string SubjectCode { get; set; }
-        public string Subject { get; set; }
-
-        public List<Dictionary<string, int[]>> Classes { get; set; }
-        public List<List<int>> Result { get; set; }
-        public List<string> Ids { get; set; }
-        public List<int> Point { get; set; }
-
-       
-    }
-}

+ 0 - 168
TEAMModelOS.Service/Models/Learn/HomeWork.cs

@@ -1,168 +0,0 @@
-using ProtoBuf;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Exam.Models;
-
-namespace TEAMModelOS.Service.Models.Learn
-{
-    /// <summary>
-    /// 作业
-    /// </summary>
-    [ProtoContract]
-    [CosmosDB(RU = 400, Name = "HomeWork")]
-    public class HomeWork:ID
-    {
-        public int? ttl { get; set; } 
-        public HomeWork()
-        {
-            target = new List<Target>();
-            resource = new List<ProcessRes>();
-        }
-
-        [ProtoMember(1)]
-        public string id { get; set; }
-
-        [PartitionKey]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [ProtoMember(2)]
-        public string scopeCode { get; set; }
-
-
-        /// <summary>
-        /// 作业名称
-        /// </summary>
-        [ProtoMember(3)]
-        public string name { get; set; }
-
-        /// <summary>
-        /// 作业发布对象
-        /// </summary>
-        [ProtoMember(4)]
-        public List<Target> target { get; set; }
-
-        /// <summary>
-        /// 发布模式 0 立即发布 1 定时
-        /// </summary>
-        [ProtoMember(5)]
-        public string publishModel { get; set; }
-
-        /// <summary>
-        /// 开始时间
-        /// </summary>
-        [ProtoMember(6)]
-        public long startTime { get; set; }
-
-        /// <summary>
-        /// 结束时间
-        /// </summary>
-        [ProtoMember(7)]
-        public long endTime { get; set; }
-
-        /// <summary>
-        /// 作业反馈类型
-        /// </summary>
-        //public string feedbackType { get; set; }
-
-        /// <summary>
-        /// 题目
-        /// </summary>
-        //public List<ExamItem> ExamItem { get; set; }
-
-
-
-        /// <summary>
-        /// 作业描述
-        /// </summary>
-        [ProtoMember(8)]
-        public string description { get; set; }
-
-  
-        /// <summary>
-        /// 作业附件
-        /// </summary>
-        [ProtoMember(9)]
-        public List<ProcessRes> resource { get; set; }
-
-
-        /// <summary>
-        /// 状态 
-        /// </summary>
-        [ProtoMember(10)]
-        public int state { get; set; }
-
-        //public Subdto subdto { get; set; }
-
-        /// <summary>
-        /// 学生 是否互评 是否可见 
-        /// </summary>
-        [ProtoMember(11)]
-        public List<string> other { get; set; }
-        //创建时间 
-        [ProtoMember(12)]
-        public long createTime { get; set; }
-        //public class Subdto {
-        //    /// <summary>
-        //    /// 提交人数
-        //    /// </summary>
-        //    public int submitted { get; set; }
-
-        //    /// <summary>
-        //    /// 总人数
-        //    /// </summary>
-        //    public int sum { get; set; }
-
-        //}
-
-
-        /// <summary>
-        /// 发布对象
-        ///// </summary>
-        //public class Target {
-        //    [Required(ErrorMessage = "{0} 必须填写")]
-        //    public string classroomCode { get; set; }
-        //    [Required(ErrorMessage = "{0} 必须填写")]
-        //    public string scopeCode { get; set; }
-        //    public string classroomName { get; set; }
-        //}
-
-        /// <summary>
-        /// 作业附件
-        /// </summary>
-        //public class ProcessRes
-        //{
-        //    /// <summary>
-        //    /// 文件名字
-        //    /// </summary>
-        //    public string fileName { get; set; }
-
-        //    /// <summary>
-        //    /// 
-        //    /// </summary>
-        //    public string blobUrl { get; set; }
-
-        //    /// <summary>
-        //    /// 文件大小
-        //    /// </summary>
-        //    public long size { get; set; }
-
-        //    /// <summary>
-        //    /// 缩略图链接  图片视频有 文件没有
-        //    /// </summary>
-        //    public string compressUrl { get; set; }
-
-        //    /// <summary>
-        //    /// 文件类型
-        //    /// </summary>
-        //    public string type { get; set; }
-
-        //    public int order { get; set; }
-
-        //}
-
-
-    }
-}

+ 0 - 127
TEAMModelOS.Service/Models/Learn/LeanProcess.cs

@@ -1,127 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Exam.Models;
-
-namespace TEAMModelOS.Service.Models.Learn
-{
-
-    /// <summary>
-    /// 编序学习
-    /// </summary>
-    [CosmosDB(RU = 400, Name = "LeanProcess")]
-    public class LeanProcess : ID
-    {
-        public int? ttl { get; set; } 
-        public LeanProcess() {
-            steps = new List<LearnUnit>();
-        }
-        
-        public string id { get; set; }
-
-        public string name { get; set; }
-
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string subjectCode { get; set; }
-
-        /// <summary>
-        /// 学段code
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string periodCode { get; set; }
-
-
-        /// <summary>
-        /// 活动介绍
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string Introduce { get; set; }
-
-
-        /// <summary>
-        /// 学习对象
-        /// </summary>
-        //public List<Target> target { get; set; }
-
-
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        public string scopeCode { get; set; }
-
-
-        /// <summary>
-        /// 最小单元
-        /// </summary>
-        public List<LearnUnit> steps { get; set; }
-       
-
-        //创建时间 
-        //public long createTime { get; set; }
-
-
-        //创建者
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string creator { get; set; }
-        
-        public class Target
-        {
-            public string classroomCode { get; set; }
-
-            public string scopeCode { get; set; }
-        }
-
-
-    }
-
-
-    //public class ProcessStep
-    //{
-    //    public ProcessStep() {
-    //        resource = new List<ProcessRes>();
-    //        item = new List<ExamItem>();
-    //    }
-    //    /// <summary>
-    //    /// 资源内容
-    //    /// [{"name":"","url":"","order":""}]
-    //    /// </summary>
-    //    public List<ProcessRes> resource { get; set; }
-    //    /// <summary>
-    //    /// 题目
-    //    /// </summary>
-    //    public List<ExamItem> item { get; set; }
-    //    [Required(ErrorMessage = "{0} 必须填写")]
-    //    public string name { get; set; }
-    //    public int order { get; set; }
-    //}
-
-    //public class ProcessRes{
-
-    //    [Required(ErrorMessage = "{0} 必须填写")]
-    //    public string fileName { get; set; }
-    //    [Required(ErrorMessage = "{0} 必须填写")]
-    //    public string blobUrl { get; set; }
-    //    public int order { get; set; }
-
-    //    /// <summary>
-    //    /// 文件大小
-    //    /// </summary>
-    //    public long size { get; set; }
-
-    //    /// <summary>
-    //    /// 缩略图链接  图片视频有 文件没有
-    //    /// </summary>
-    //    public string compressUrl { get; set; }
-
-    //    /// <summary>
-    //    /// 文件类型
-    //    /// </summary>
-    //    public string type { get; set; }
-
-
-
-    //}
-
-}

+ 0 - 169
TEAMModelOS.Service/Models/Learn/LearningAutonomous.cs

@@ -1,169 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Exam.Models;
-
-namespace TEAMModelOS.Service.Models.Learn
-{
-    /// <summary>
-    /// 自主学习
-    /// </summary>
-    [CosmosDB(RU = 400, Name = "LearningAutonomous")]
-    public class LearningAutonomous:ID
-    {
-        public int? ttl { get; set; } 
-        public LearningAutonomous()
-        {
-            target = new List<Target>();
-            steps = new List<ProcessStep>();
-        }
-
-        public string id { get; set; }
-
-        /// <summary>
-        /// 活动名称
-        /// </summary>
-        public string name { get; set; }
-
-     
-
-        /// <summary>
-        /// 学科code
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string subjectCode { get; set; }
-
-        /// <summary>
-        /// 学段code
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string periodCode { get; set; }
-        /// <summary>
-        /// 活动介绍
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string Introduce { get; set; }
-        /// <summary>
-        /// 学习对象
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public List<Target> target { get; set; }
-
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        public string scopeCode { get; set; }
-
-        /// <summary>
-        /// 步骤
-        /// </summary>
-        public List<ProcessStep> steps { get; set; }
-
-        /// <summary>
-        /// 是否闯关模式 0 或 1 vue组件不支持true false
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string isOrder { get; set; }
-
-        /// <summary>
-        /// 状态 
-        /// </summary>
-        public int state { get; set; }
-
-
-        /// <summary>
-        /// 发布模式 0 立即发布 1 定时
-        /// </summary>
-        public string publishModel { get; set; }
-
-        /// <summary>
-        /// 创建时间
-        /// </summary>
-        public long createTime { get; set; }
-        
-        /// <summary>
-        /// 创建者
-        /// </summary>
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string creator { get; set; }
-
-        /// <summary>
-        /// 开始时间
-        /// </summary>
-        public long startTime { get; set; }
-
-
-        /// <summary>
-        /// 截至时间 时间戳
-        /// </summary>
-        public int endTime { get; set; }
-
-        //public class Target
-        //{
-        //    public string classroomCode { get; set; }
-
-        //    public string scopeCode { get; set; }
-
-        //    public string classroomName { get; set; }
-        //}
-
-        public class ProcessStep
-        {
-            public ProcessStep()
-            {
-                resource = new List<ProcessRes>();
-                item = new List<ExamItem>();
-            }
-            /// <summary>
-            /// 资源内容
-            /// [{"name":"","url":"","order":""}]
-            /// </summary>
-            public List<ProcessRes> resource { get; set; }
-            /// <summary>
-            /// 题目
-            /// </summary>
-            public List<ExamItem> item { get; set; }
-
-            [Required(ErrorMessage = "{0} 必须填写")]
-            public string name { get; set; }
-        }
-
-        //public class ProcessRes
-        //{
-        //    /// <summary>
-        //    /// 文件名字
-        //    /// </summary>
-        //    [Required(ErrorMessage = "{0} 必须填写")]
-        //    public string fileName { get; set; }
-            
-        //    /// <summary>
-        //    /// 
-        //    /// </summary>
-        //    [Required(ErrorMessage = "{0} 必须填写")]
-        //    public string blobUrl { get; set; }
-            
-            
-        //    public int order { get; set; }
-
-        //    /// <summary>
-        //    /// 文件大小
-        //    /// </summary>
-        //    public long size { get; set; }
-
-        //    /// <summary>
-        //    /// 缩略图链接  图片视频有 文件没有
-        //    /// </summary>
-        //    public string compressUrl { get; set; }
-
-        //    /// <summary>
-        //    /// 文件类型
-        //    /// </summary>
-        //    public string type { get; set; }
-
-
-
-        //}
-    }
-}

+ 13 - 13
TEAMModelOS.Service/Models/PowerPoint/Chart.cs

@@ -59,8 +59,8 @@ namespace TEAMModelOS.Service.Model.PowerPoint
     ///  type radar
     ///  radarChart  
     ///     雷达图 
-    ///     带数据标记的雷达图<c:radarStyle val="marker"/>
-    ///     填充雷达图 <c:radarStyle val="filled"/>
+    ///     带数据标记的雷达图c:radarStyle val="marker"/>
+    ///     填充雷达图 c:radarStyle val="filled"/>
     /// </summary>
     public class RadarChart : CommonChart
     {
@@ -69,12 +69,12 @@ namespace TEAMModelOS.Service.Model.PowerPoint
     /// <summary>
     /// type scatter
     ///  scatterChart
-    ///     散点图 <c:scatterStyle val="lineMarker"/>
-    ///     带直线的散点图 <c:scatterStyle val="lineMarker"/>
-    ///     带直线和数据标记的散点图 <c:scatterStyle val="lineMarker"/>
+    ///     散点图 c:scatterStyle val="lineMarker"/>
+    ///     带直线的散点图 c:scatterStyle val="lineMarker"/>
+    ///     带直线和数据标记的散点图c:scatterStyle val="lineMarker"/>
     ///     
-    ///     带平滑线和数据标记的散点图 <c:scatterStyle val="smoothMarker"/>
-    ///     带平滑线的散点图<c:scatterStyle val="smoothMarker"/>
+    ///     带平滑线和数据标记的散点图c:scatterStyle val="smoothMarker"/>
+    ///     带平滑线的散点图c:scatterStyle val="smoothMarker"/>
     ///  bubbleChart 气泡图   三维气泡图
     /// </summary>
     public class ScatterChart : CommonChart
@@ -99,7 +99,7 @@ namespace TEAMModelOS.Service.Model.PowerPoint
         public bool is3D { get; set; }
     }
     /// <summary>
-    /// type bar  条形图<c:barDir val="bar"/>   
+    /// type bar  条形图c:barDir val="bar"/>   
     ///  barChart
     ///     簇状条形图 clustered
     ///     堆积条形图 stacked
@@ -115,7 +115,7 @@ namespace TEAMModelOS.Service.Model.PowerPoint
         public bool is3D { get; set; }
     }
     /// <summary>
-    ///  type bar  柱状图<c:barDir val="col"/>
+    ///  type bar  柱状图c:barDir val="col"/>
     ///  barChart
     ///     簇状柱形图 clustered
     ///     堆积柱形图 stacked
@@ -132,14 +132,14 @@ namespace TEAMModelOS.Service.Model.PowerPoint
         public bool is3D { get; set; }
     }
     /// <summary>
-    /// type line   
+    ///  type line   
     ///  lineChart
     ///  合并
     ///     折线图 standard
     ///     带数据标记的折线图 standard 
     ///  合并
     ///     堆积折线图 stacked
-    ///     带标记的堆积折线图 stacked  <c:layout>不为空
+    ///     带标记的堆积折线图 stacked  c:layout>不为空
     ///  合并 
     ///     百分比堆积折线图 percentStacked
     ///     带数据标记的百分比堆积折线图 percentStacked
@@ -157,8 +157,8 @@ namespace TEAMModelOS.Service.Model.PowerPoint
     ///  pieChart
     ///     饼图  不包含   
     ///  ofPieChart
-    ///     子母饼图   包含<c:ofPieType val="pie"/> 且val为 pie
-    ///     复合条饼图 包含<c:ofPieType val="bar"/> 且val为 bar
+    ///     子母饼图   包含 c:ofPieType val="pie"/> 且val为 pie
+    ///     复合条饼图 包含 c:ofPieType val="bar"/> 且val为 bar
     ///  pie3DChart
     ///     三维饼图
     ///  doughnutChart

+ 1 - 1
TEAMModelOS.Service/Models/PowerPoint/Item.cs

@@ -6,7 +6,7 @@ namespace TEAMModelOS.Service.Model.PowerPoint
 {
     public abstract class Item
     {
-        // Sp  CxnSp Media Group  Table Chart
+        // Sp  CxnSp Media Group  Table Chart Diagram
         public string type { get; set; }
         public Position position { get; set; }
       //  public string Xml { get; set; }

+ 1 - 3
TEAMModelOS.Service/Models/PowerPoint/Slide.cs

@@ -1,8 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using TEAMModelOS.Service.Models.Core;
-using TEAMModelOS.Service.Models.Exam.Models;
 
 namespace TEAMModelOS.Service.Model.PowerPoint
 {
@@ -15,7 +13,7 @@ namespace TEAMModelOS.Service.Model.PowerPoint
         public double width { get; set; }
         //高度
         public double height { get; set; }
-        public ExamItem exercise { get; set; }
+        public Models.ItemInfo exercise { get; set; }
         //1 PPTX  2 HTML  来源
         public int source { get; set; }
         /// <summary>

+ 6 - 13
TEAMModelOS.Service/Models/Core/Classroom.cs

@@ -7,13 +7,13 @@ using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     [ProtoContract]
-    [CosmosDB(RU = 400, Name = "CoreClassroom")]
+    [CosmosDB(RU = 400, Name = "School")]
     public class Classroom:ID
-    {   
-       
+    {
+        public string pk { get; set; }
         public   int? ttl { get; set; }
         public Classroom()
         {
@@ -21,14 +21,8 @@ namespace TEAMModelOS.Service.Models.Core
         }
 
         [ProtoMember(1)]
-      //  [Required(ErrorMessage = "{0} 必须填写")]
         [JsonPropertyName("id")]
         public string id { get; set; }
-
-        [ProtoMember(2)]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [PartitionKey]
-        public string scopeCode { get; set; }
         [ProtoMember(3)]
         [Required(ErrorMessage = "{0} 必须填写")]
         public string classroomCode { get; set; }
@@ -59,9 +53,8 @@ namespace TEAMModelOS.Service.Models.Core
         [ProtoMember(13)]
         [Required(ErrorMessage = "{0} 必须填写,请设置个人教室还是学校教室")]
         public int type { get; set; } = 1;
-
-        //public string scope { get; set; }
-        //public string TEAMModelId { get; set; }
+        [PartitionKey]
+        public string code { get; set; }
     }
 }
 

+ 53 - 0
TEAMModelOS.Service/Models/SchoolInfo/Course.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
+using TEAMModelOS.Service.Models;
+
+namespace TEAMModelOS.Service.Models
+{
+    /// <summary>
+    /// 课程
+    /// </summary>
+    [CosmosDB(RU = 400, Name = "School")]
+    public class Course : ID
+    {
+        /// <summary>
+        /// 课程id
+        /// </summary>
+        public string id { get; set; }
+        public int? ttl { get; set; }
+        public string pk { get; set; }
+        /// <summary>
+        /// 学校编码  或醍摩豆ID
+        /// </summary>
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
+        /// <summary>
+        /// 课程名称
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string courseName { get; set; }
+        /// <summary>
+        /// 课程编码
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string courseCode { get; set; }
+        /// <summary>
+        /// 学期编码
+        /// </summary>
+        public string semesterCode { get; set; }
+        /// <summary>
+        /// 科目编码
+        /// </summary>
+        public string subjectCode { get; set; }
+        /// <summary>
+        /// 学段编码
+        /// </summary>
+        public string periodCode { get; set; }
+
+    }
+}

+ 8 - 4
TEAMModelOS.Service/Models/Exam/ExamAnswer.cs

@@ -5,14 +5,16 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Exam.Models
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 考生作答信息
     /// </summary>
-    [CosmosDB(RU = 400, Name = "ExamAnswer")]
+    [CosmosDB(RU = 400, Name = "School")]
     public class ExamAnswer :ID
     {
+       // [PartitionKey(name = "ExamAnswer")]
+        public string pk { get; set; }
         public int? ttl { get; set; } 
         public ExamAnswer()
         {
@@ -20,12 +22,14 @@ namespace TEAMModelOS.Service.Models.Exam.Models
         }
         [JsonProperty(PropertyName = "id")]
         public string id { get; set; }
-        [PartitionKey]
-        public string Code { get; set; }
+     //   [PartitionKey]
+      //  public string Code { get; set; }
         /// <summary>
         /// 考试活动code
         /// </summary>
         public string examCode { get; set; }
         public List<List<string>> Answer { get; set; }
+        [PartitionKey]
+        public string code { get; set; }
     }
 }

+ 7 - 4
TEAMModelOS.Service/Models/Exam/ExamInfo.cs

@@ -6,21 +6,24 @@ using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Exam.Models
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 考试基础信息
     /// </summary>
-    [CosmosDB(RU = 400, Name = "ExamInfo")]
+    [CosmosDB(RU = 400, Name = "School")]
     public class ExamInfo :ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        //  [PartitionKey(name = "ExamInfo")]
+        public string pk { get; set; }
         public int? ttl { get; set; } 
         public ExamInfo() {
         }
         [JsonProperty(PropertyName = "id")]
         public string id { get; set; }
-        [PartitionKey]
-        public string scopeCode { get; set; }
+
         public string name { get; set; }
         public int stuCount { get; set; }
         public long createTime { get; set; }

+ 7 - 3
TEAMModelOS.Service/Models/Exam/ExamResult.cs

@@ -4,14 +4,18 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Exam.Models
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 考试成绩信息
     /// </summary>
-    [CosmosDB(RU = 400, Name = "ExamResult")]
+    [CosmosDB(RU = 400, Name = "School")]
     public  class ExamResult:ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        // [PartitionKey(name = "ExamResult")]
+        public string pk { get; set; }
         public int? ttl { get; set; } 
         public ExamResult()
         {
@@ -28,7 +32,7 @@ namespace TEAMModelOS.Service.Models.Exam.Models
         public List<List<int>> result { get; set; }
         public List<string> ids { get; set; }
         public List<int> point { get; set; }
-        [PartitionKey]
+      //  [PartitionKey]
         public string examCode { get; set; }
         public string schoolCode { get; set; }
         public string paperCode { get; set; }

+ 1 - 1
TEAMModelOS.Service/Models/Core/Campus.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     public class Campus
     {

+ 1 - 1
TEAMModelOS.Service/Models/Core/Grade.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     public class Grade
     {

+ 1 - 1
TEAMModelOS.Service/Models/Core/Period.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     public class Period
     {

+ 1 - 1
TEAMModelOS.Service/Models/Core/Semester.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     public class Semester
     {

+ 1 - 1
TEAMModelOS.Service/Models/Core/Subject.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Text;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     public class Subject
     {

+ 15 - 13
TEAMModelOS.Service/Models/Exam/ExamPaper.cs

@@ -5,27 +5,29 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Exam.Models
-{
+namespace TEAMModelOS.Service.Models
+{ 
     /// <summary>
     /// 试卷信息
     /// </summary>
-    [CosmosDB(RU = 400, Name = "ExamPaper")]
-    public class ExamPaper : ID
+    [CosmosDB(RU = 400, Name = "School")]
+    public class Paper : ID
     {
+        /// <summary>
+        ///  学校编码,个人编码,考试编码
+        /// </summary>
+        [PartitionKey]
+        public string code { get; set; }
+        public string pk { get; set; }
         public int? ttl { get; set; }
-        public ExamPaper() {
-            item = new List<ExamItem>();
+        public Paper() {
+            item = new List<ItemInfo>();
         }
         [JsonProperty(PropertyName = "id")]
         public string id { get; set; }
-        [PartitionKey]
-        public string scopeCode { get; set; }
-        /// <summary>
-        /// 考试活动code
-        /// </summary>
-       // public string examCode { get; set; }
-        public List<ExamItem> item { get; set; }
+     
+    
+        public List<ItemInfo> item { get; set; }
         public string subjectCode { get; set; }
         public string periodCode { get; set; }
         public List<string> gradeCode { get; set; }

+ 19 - 5
TEAMModelOS.Service/Models/Core/School.cs

@@ -1,16 +1,18 @@
  
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using System.Text;
 using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "CoreSchool")]
+    [CosmosDB(RU = 400, Name = "School")]
     public class School:ID
     {
-       
+      //  [PartitionKey(name = "School")]
+        public string pk { get; set; }
         public int? ttl { get; set; } = null;
         public School()
         {
@@ -18,12 +20,24 @@ namespace TEAMModelOS.Service.Models.Core
         }
         
         public string id { get; set; }
+        [Required(ErrorMessage = "{0} 必须填写")]
         public string schoolCode { get; set; }
-        [PartitionKey]
-        public string areaCode { get; set; }
+       // [PartitionKey]
+        //public string areaCode { get; set; }
         public string schoolName { get; set; }
         public List<Period> period { get; set; }
         public List<Campus> campuses { get; set; }
+        [PartitionKey]
+        public string code { get; set; }
+        /// <summary>
+        /// 课程计划表
+        /// </summary>
+        public List<TimeTable> timetable { get; set; }
+
+    }
 
+    public class TimeTable { 
+        public string label { get; set; }
+        public string time { get; set; }
     }
 }

+ 40 - 0
TEAMModelOS.Service/Models/SchoolInfo/Survey.cs

@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
+
+namespace TEAMModelOS.Service.Models
+{
+    /// <summary>
+    /// 问卷调查
+    /// </summary>
+    [CosmosDB(Name = "School", RU = 400)]
+    public class Survey : ID
+    {
+        public string id { get; set; }
+        public int? ttl { get; set; }
+        public string pk { get; set; }
+        /// <summary>
+        /// 学校编码 或者醍摩豆ID
+        /// </summary>
+        [PartitionKey]
+        public string code { get; set; }
+        public string name { get; set; }   //测试问卷名称', // 问卷名称
+        public string description { get; set; }   //测试问卷描述', // 问卷描述
+        public string type { get; set; }   //normal', // 问卷类型
+        public int status { get; set; } // 问卷状态(0:待发布 1:已发布 2:已结束)
+        public long startTime { get; set; }  //开始时间
+        public long endTime { get; set; } //截止时间
+        public long createTime { get; set; } // 问卷发布时间
+        public List<Item> items{ get; set; }
+        public List<string> target { get; set; }
+    }
+    public class Item {
+        public string stem { get; set; }
+        public string type { get; set; }
+        public bool isRequired { get; set; }
+        public int order { get; set; }
+        public List<CodeValue> options { get; set; }
+    }
+}

+ 1 - 1
TEAMModelOS.Service/Models/Core/SchoolSetting.cs

@@ -3,7 +3,7 @@ using Newtonsoft.Json;
 using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 學校設定

+ 6 - 20
TEAMModelOS.Service/Models/Learn/Vote.cs

@@ -5,17 +5,19 @@ using System.ComponentModel.DataAnnotations;
 using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using static TEAMModelOS.Service.Models.Learn.VoteStudent;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
     /// 投票
     /// </summary>
     [ProtoContract]
-    [CosmosDB(RU = 400, Name = "Vote")]
+    [CosmosDB(RU = 400, Name = "School")]
     public class Vote : ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        public string pk { get; set; }
 
         public Vote()
         {
@@ -28,11 +30,6 @@ namespace TEAMModelOS.Service.Models.Learn
         [ProtoMember(1)]
         public string id { get; set; }
 
-        [PartitionKey]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        [ProtoMember(2)]
-        public string scopeCode { get; set; }
-
 
         /// <summary>
         /// 投票名称
@@ -41,7 +38,7 @@ namespace TEAMModelOS.Service.Models.Learn
         public string name { get; set; }
 
         /// <summary>
-        /// 作业发布对象
+        /// 发布对象
         /// </summary>
         [ProtoMember(4)]
         public List<Target> target { get; set; }
@@ -64,17 +61,6 @@ namespace TEAMModelOS.Service.Models.Learn
         [ProtoMember(7)]
         public long endTime { get; set; }
 
-        /// <summary>
-        /// 作业反馈类型
-        /// </summary>
-        //public string feedbackType { get; set; }
-
-        /// <summary>
-        /// 题目
-        /// </summary>
-        //public List<ExamItem> ExamItem { get; set; }
-
-
 
         /// <summary>
         /// 投票描述

+ 12 - 13
TEAMModelOS.Service/Models/Core/ClassRoomStudent.cs

@@ -6,31 +6,30 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
     [ProtoContract]
-    [CosmosDB(RU = 400, Name = "CoreClassroomStudent", Cache = false)]
-    public class ClassroomStudent : ID
+    [CosmosDB(RU = 400, Name = "Student", Cache = false)]
+    public class ClassStudent : ID
     {
-
-        public ClassroomStudent() {
-            studentId = new List<string>();
+        public string pk { get; set; }
+        public ClassStudent() {
+          //  studentId = new List<string>();
         }
         public int? ttl { get; set; } 
         /// <summary>
-        /// classroomCode
+        ///班级id classroomCode
         /// </summary>
         [ProtoMember(1)]
         [Required(ErrorMessage = "{0} 必须填写")]
         public string id { get; set; } //classroomCode
 
-        [ProtoMember(2)]
-        [Required(ErrorMessage = "{0} 必须填写")]
+        /// <summary>
+        /// 学生id
+        /// </summary>
         [PartitionKey]
-        public string scopeCode { get; set; }
-
-        [ProtoMember(3)]
-        public List<string> studentId { get; set; }
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
 
     }
 }

+ 13 - 61
TEAMModelOS.Service/Models/Learn/HomeWorkStudent.cs

@@ -4,32 +4,37 @@ using System.Collections.Generic;
 using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Exam.Models;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
 
     /// <summary>
     /// 作业数据
     /// </summary>
     [ProtoContract]
-    [CosmosDB(RU = 400, Name = "HomeWorkStudent")]
-    public class HomeWorkStudent : ID
+    [CosmosDB(RU = 400, Name = "Student")]
+    public class HomeworkRecord : ID
     {
+        /// <summary>
+        /// 学生id
+        /// </summary>
+        [PartitionKey]
+        public string code { get; set; }
+        public string pk { get; set; }
         public int? ttl { get; set; }
-        public HomeWorkStudent() {
+        public HomeworkRecord() {
             content = new List<HomeWorkContent>();
             studentComments = new List<StudentComment>();
             classroom = new ClassroomItem();
             nativeroom = new ClassroomItem();
             teacherComments = new HomeWorkComment();
         }
+        /// <summary>
+        /// 作业活动id
+        /// </summary>
         [ProtoMember(1)]
         public string id { get; set; }
 
-        [ProtoMember(2)]
-        [PartitionKey]
-        public string homeWorkId { get; set; }
 
 
         /// <summary>
@@ -39,11 +44,6 @@ namespace TEAMModelOS.Service.Models.Learn
         public string name { get; set; }
 
 
-        /// <summary>
-        /// 醍摩豆id
-        /// </summary>
-        [ProtoMember(4)]
-        public string TEAMModelId { get; set; }
 
         /// <summary>
         /// 上课班级
@@ -57,13 +57,6 @@ namespace TEAMModelOS.Service.Models.Learn
         [ProtoMember(6)]
         public ClassroomItem nativeroom{ get; set; }
 
-
-        /// <summary>
-        /// 学号
-        /// </summary>
-        [ProtoMember(7)]
-        public string studentId { get; set; }
-
         /// <summary>
         /// 是否提交
         /// </summary>
@@ -117,16 +110,6 @@ namespace TEAMModelOS.Service.Models.Learn
     [ProtoContract]
     public class HomeWorkContent {
 
-        /// <summary>
-        /// 作业反馈类型
-        /// </summary>
-        //public string feedbackType { get; set; }
-
-        /// <summary>
-        /// 在线编辑模式 作答记录
-        /// </summary>
-        //public List<ExamAnswer> examAnswers { get; set; }
-
         /// <summary>
         /// 作答记录
         /// </summary>
@@ -142,36 +125,6 @@ namespace TEAMModelOS.Service.Models.Learn
     }
 
 
-    //public class ProcessRes
-    //{
-    //    /// <summary>
-    //    /// 文件名字
-    //    /// </summary>
-    //    public string fileName { get; set; }
-
-    //    /// <summary>
-    //    /// 
-    //    /// </summary>
-    //    public string blobUrl { get; set; }
-
-    //    /// <summary>
-    //    /// 文件大小
-    //    /// </summary>
-    //    public long size { get; set; }
-
-    //    /// <summary>
-    //    /// 缩略图链接  图片视频有 文件没有
-    //    /// </summary>
-    //    public string compressUrl { get; set; }
-
-    //    /// <summary>
-    //    /// 文件类型
-    //    /// </summary>
-    //    public string type { get; set; }
-
-    //    public int order { get; set; }
-
-    //}
     [ProtoContract]
     public class StudentComment
     {
@@ -305,5 +258,4 @@ namespace TEAMModelOS.Service.Models.Learn
         public long createTime { get; set; }
 
     }
-
 }

+ 13 - 8
TEAMModelOS.Service/Models/Learn/LeanRecord.cs

@@ -4,23 +4,28 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {    /// <summary>
-     /// 作答记录
+     ///  编序式和学习单元 作答记录
      /// </summary>
-    [CosmosDB(RU = 400, Name = "LeanRecord")]
+    [CosmosDB(RU = 400, Name = "Student")]
     public class LeanRecord : ID
     {
+        /// <summary>
+        /// 学生id
+        /// </summary>
+        [PartitionKey]
+        public string code { get; set; }
+        public string pk { get; set; }
         public int? ttl { get; set; } 
         public LeanRecord() {
             steps = new List<RecordStep>();
         }
-
+        /// <summary>
+        /// learn学习任务id
+        /// </summary>
         public string id { get; set; }
-        [PartitionKey]
-        public string processCode { get; set; }
-        
-        public string studentId { get; set; }
+      
 
         public List<RecordStep> steps { get; set; }
     }

+ 7 - 8
TEAMModelOS.Service/Models/Core/Student.cs

@@ -7,11 +7,13 @@ using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "CoreStudent")]
+    [CosmosDB(RU = 400, Name = "Student")]
     public class Student :ID
     {
+       // [PartitionKey(name = "Student")]
+        public string pk { get; set; }
         public int? ttl { get; set; } 
         public Student()
         {
@@ -40,12 +42,6 @@ namespace TEAMModelOS.Service.Models.Core
         public string exValue { get; set; }
         public string product { get; set; }
         public List<ProductToken> productToken { get; set; }
-        /// <summary>
-        ///   0 1 dynamic   1学校id
-        /// </summary>
-        [PartitionKey]
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string schoolCode { get; set; }  ///
         public string shortCode { get; set; }
         public string profilePicture { get; set; }
         public string profilePictureUrl { get; set; }
@@ -60,6 +56,9 @@ namespace TEAMModelOS.Service.Models.Core
         public string classroomCode { get; set; }
         public string studentId { get; set; }
         public int seatNo { get; set; }
+        [PartitionKey]
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string code { get; set; }
     }
 }
 public class Password {

+ 19 - 0
TEAMModelOS.Service/Models/StudentInfo/SurveyRecord.cs

@@ -0,0 +1,19 @@
+using ProtoBuf;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
+
+namespace TEAMModelOS.Service.Models
+{
+    [CosmosDB(RU = 400, Name = "Student")]
+    public class SurveyRecord : ID
+    {
+        public string id { get; set; }
+        public int? ttl { get; set; }
+        public string pk { get; set; }
+        [PartitionKey]
+        public string code { get; set; }
+    }
+}

+ 13 - 26
TEAMModelOS.Service/Models/Learn/VoteStudent.cs

@@ -4,41 +4,35 @@ using System.Collections.Generic;
 using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using static TEAMModelOS.Service.Models.Learn.Vote;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "VoteStudent")]
-    public class VoteStudent : ID
+    [CosmosDB(RU = 400, Name = "Student")]
+    public class VoteRecord : ID
     {
-
-        public VoteStudent() {
+        /// <summary>
+        /// 学生id
+        /// </summary>
+        [PartitionKey]
+        public string code { get; set; }
+        public string pk { get; set; }
+        public VoteRecord() {
             classroom = new ClassroomItem();
             nativeroom = new ClassroomItem();
            
         }
-
+        /// <summary>
+        /// 投票活动id
+        /// </summary>
         [ProtoMember(1)]
         public string id { get; set; }
 
-        [ProtoMember(2)]
-        [PartitionKey]
-        public string voteWorkId { get; set; }
-
-
         /// <summary>
         /// 姓名
         /// </summary>
         [ProtoMember(3)]
         public string name { get; set; }
 
-
-        /// <summary>
-        /// 醍摩豆id
-        /// </summary>
-        [ProtoMember(4)]
-        public string TEAMModelId { get; set; }
-
         /// <summary>
         /// 上课班级
         /// </summary>
@@ -51,12 +45,6 @@ namespace TEAMModelOS.Service.Models.Learn
         [ProtoMember(6)]
         public ClassroomItem nativeroom { get; set; }
 
-        /// <summary>
-        /// 学号
-        /// </summary>
-        [ProtoMember(7)]
-        public string studentId { get; set; }
-
         /// <summary>
         /// 是否提交
         /// </summary>
@@ -69,7 +57,6 @@ namespace TEAMModelOS.Service.Models.Learn
         [ProtoMember(9)]
         public long submissionTime { get; set; }
 
-
         /// <summary>
         /// 选项
         /// </summary>

+ 8 - 5
TEAMModelOS.Service/Models/Learn/TeacherComments.cs

@@ -5,13 +5,16 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
     [ProtoContract]
-    [CosmosDB(RU = 400, Name = "HomeWorkTeacherComments")]
-    public class TeacherComments : ID
+    [CosmosDB(RU = 400, Name = "Teacher")]
+    public class Comments : ID
     {
-        public TeacherComments(){
+        [PartitionKey]
+        public string code { get; set; }
+        public string pk { get; set; }
+        public Comments(){
             comment = new List<Comment>();
         }
 
@@ -27,7 +30,7 @@ namespace TEAMModelOS.Service.Models.Learn
         /// <summary>
         /// 醍摩豆id 或者学生id
         /// </summary>
-        [PartitionKey]
+      //  [PartitionKey]
         [ProtoMember(3)]
         public string TEAMModelId { get; set; }
         public int? ttl { get; set; }

+ 73 - 0
TEAMModelOS.Service/Models/TeacherInfo/CoursePlan.cs

@@ -0,0 +1,73 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using System.Text.Json.Serialization;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
+
+namespace TEAMModelOS.Service.Models
+{
+    [CosmosDB(RU = 400, Name = "Teacher")]
+    public class CoursePlan :ID
+    {
+        [Required(ErrorMessage = "课程ID必须设置")]
+        public string courseId { get; set; }
+        [Required(ErrorMessage = "班级编码必须设置")]
+        public string classroomCode { get; set; }
+        public string notice { get; set; }
+        public string id { get; set; }
+        public int? ttl { get; set; }
+        public string pk { get; set; }
+        /// <summary>
+        /// 教师  TEAMModelId
+        /// </summary>
+        [PartitionKey]
+        [Required(ErrorMessage = "任课教师必须设置")]
+        public string code { get; set; }
+        /// <summary>
+        /// 学生分组
+        /// </summary>
+        public List<GroupStudent> groups { get; set; }
+        /// <summary>
+        /// 课程时间安排
+        /// </summary>
+        public List<CourseTime> courseTimes { get; set; }
+        /// <summary>
+        /// 助教
+        /// </summary>
+        public List<string> assistant { get; set; }
+    }
+
+    public class Assistant { 
+        /// <summary>
+        /// 助教 醍摩豆id
+        /// </summary>
+        public string TEAMModelId { get; set; }
+        /// <summary>
+        /// 助教姓名
+        /// </summary>
+        public string name { get; set; }
+    }
+    public class CourseTime {
+
+        public CourseTime() {
+            times = new List<List<string>>();
+        }
+        /// <summary>
+        /// 上课频率类型  按天,周,月等。。。
+        /// </summary>
+        public string type { get; set; }
+        public string title { get; set; }
+        public List<List<string>> times { get; set; }
+    }
+   
+    public class GroupStudent
+    {
+        public int seatNo { get; set; }
+        public string groupCode { get; set; }
+        public string groupName { get; set; }
+        public string studentId { get; set; }
+    }
+}

+ 102 - 0
TEAMModelOS.Service/Models/TeacherInfo/Homework.cs

@@ -0,0 +1,102 @@
+using ProtoBuf;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
+
+namespace TEAMModelOS.Service.Models
+{
+    /// <summary>
+    /// 作业
+    /// </summary>
+    [ProtoContract]
+    [CosmosDB(RU = 400, Name = "Teacher")]
+    public class Homework:ID
+    {
+        [PartitionKey]
+        public string code { get; set; }
+        //[PartitionKey(name = "HomeWork")]
+        public string pk { get; set; }
+        public int? ttl { get; set; } 
+        public Homework()
+        {
+            target = new List<Target>();
+            resource = new List<ProcessRes>();
+        }
+
+        [ProtoMember(1)]
+        public string id { get; set; }
+
+     
+
+        /// <summary>
+        /// 作业名称
+        /// </summary>
+        [ProtoMember(3)]
+        public string name { get; set; }
+
+        /// <summary>
+        /// 作业发布对象
+        /// </summary>
+        [ProtoMember(4)]
+        public List<Target> target { get; set; }
+
+        /// <summary>
+        /// 发布模式 0 立即发布 1 定时
+        /// </summary>
+        [ProtoMember(5)]
+        public string publishModel { get; set; }
+
+        /// <summary>
+        /// 开始时间
+        /// </summary>
+        [ProtoMember(6)]
+        public long startTime { get; set; }
+
+        /// <summary>
+        /// 结束时间
+        /// </summary>
+        [ProtoMember(7)]
+        public long endTime { get; set; }
+
+        
+
+
+
+        /// <summary>
+        /// 作业描述
+        /// </summary>
+        [ProtoMember(8)]
+        public string description { get; set; }
+
+  
+        /// <summary>
+        /// 作业附件
+        /// </summary>
+        [ProtoMember(9)]
+        public List<ProcessRes> resource { get; set; }
+
+
+        /// <summary>
+        /// 状态 
+        /// </summary>
+        [ProtoMember(10)]
+        public int state { get; set; }
+
+        //public Subdto subdto { get; set; }
+
+        /// <summary>
+        /// 学生 是否互评 是否可见 
+        /// </summary>
+        [ProtoMember(11)]
+        public List<string> other { get; set; }
+        //创建时间 
+        [ProtoMember(12)]
+        public long createTime { get; set; }
+        
+
+
+    }
+}

+ 74 - 0
TEAMModelOS.Service/Models/TeacherInfo/LeanProcess.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+using TEAMModelOS.SDK.Context.Attributes.Azure;
+using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
+
+namespace TEAMModelOS.Service.Models
+{
+
+    /// <summary>
+    /// 编序学习
+    /// </summary>
+    [CosmosDB(RU = 400, Name = "Teacher")]
+    public class LeanProcess : ID
+    {
+        [PartitionKey]
+        public string code { get; set; }
+        //   [PartitionKey(name = "LeanProcess")]
+        public string pk { get; set; }
+        public int? ttl { get; set; } 
+        public LeanProcess() {
+            steps = new List<LearnUnit>();
+        }
+        
+        public string id { get; set; }
+
+        public string name { get; set; }
+
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string subjectCode { get; set; }
+
+        /// <summary>
+        /// 学段code
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string periodCode { get; set; }
+
+
+        /// <summary>
+        /// 活动介绍
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string Introduce { get; set; }
+
+
+        
+    
+
+
+        /// <summary>
+        /// 最小单元
+        /// </summary>
+        public List<LearnUnit> steps { get; set; }
+
+
+
+
+        /// <summary>
+        /// 创建者
+        /// </summary>
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string creator { get; set; }
+        
+        public class Target
+        {
+            public string classroomCode { get; set; }
+
+            public string code { get; set; }
+        }
+    }
+
+
+}

+ 8 - 5
TEAMModelOS.Service/Models/Learn/LearnUnit.cs

@@ -4,14 +4,18 @@ using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Learn
+namespace TEAMModelOS.Service.Models
 {
     /// <summary>
-    /// 考试基础信息
+    /// 学习单元
     /// </summary>
-    [CosmosDB(RU = 400, Name = "LearnUnit")]
+    [CosmosDB(RU = 400, Name = "Teacher")]
     public class LearnUnit:ID
     {
+        [PartitionKey]
+        public string code { get; set; }
+        //[PartitionKey(name = "LearnUnit")]
+        public string pk { get; set; }
         public int? ttl { get; set; }
         public LearnUnit() {
             //syllabus = new List<string>();
@@ -36,8 +40,7 @@ namespace TEAMModelOS.Service.Models.Learn
         /// 名称
         /// </summary>
         public string name { get; set; }
-        [PartitionKey]
-        public string scopeCode { get; set; }
+     
         public string subjectCode { get; set; }
     }
 }

+ 5 - 3
TEAMModelOS.Service/Models/Core/SchoolUser.cs

@@ -7,14 +7,15 @@ using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
 
-namespace TEAMModelOS.Service.Models.Core
+namespace TEAMModelOS.Service.Models
 {
-    [CosmosDB(RU = 400, Name = "School")]
+    [CosmosDB(RU = 400, Name = "Teacher")]
     public class SchoolUser:ID
     {
         public string id { get; set; }
         public string schoolCode { get; set; }
         public string schoolName { get; set; }
+        public string userid { get; set; }
         public string name { get; set; }
         public string email { get; set; }
         public string mobile { get; set; }
@@ -31,6 +32,7 @@ namespace TEAMModelOS.Service.Models.Core
         public long joinDate { get; set; } = 0;
         [PartitionKey]
         public string code { get; set; }
-        public int? ttl { get; set ; }
+        public int? ttl { get; set; }
+        public string pk { get; set ; }
     }
 }

+ 1 - 3
TEAMModelOS.Service/Services/Analysis/Implements/AchievementService.cs

@@ -1,13 +1,11 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using TEAMModelOS.Service.Model.Exam.Models;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDB.Interfaces;
 using TEAMModelOS.Service.Analysis.Interfaces;
-using TEAMModelOS.Service.Models.Core;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Exam.Models;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelOS.Service.Analysis.Implements
 {

+ 1 - 3
TEAMModelOS.Service/Services/Analysis/Interfaces/IAchievementService.cs

@@ -1,8 +1,6 @@
 using System.Collections.Generic;
-using TEAMModelOS.Service.Model.Exam.Models;
 using TEAMModelOS.SDK.Context.Configuration;
-using TEAMModelOS.Service.Models.Core;
-using TEAMModelOS.Service.Models.Exam.Models;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelOS.Service.Analysis.Interfaces
 {

+ 6 - 6
TEAMModelOS.Service/Services/ChangeFeed/ChangeFeedInvoke.cs

@@ -22,7 +22,7 @@ namespace TEAMModelOS.Service.Services.ChangeFeed
             azureCosmosDBV3Repository = _IAzureCosmosDBV3Repository;
         }
 
-        public void     MonitorChangeFeed(Dictionary<string , CosmosModelInfo> dict, IServiceCollection _services) {
+        public void     MonitorChangeFeed(CosmosDict dict, IServiceCollection _services) {
             var serviceCollection = new Microsoft.Extensions.DependencyInjection.ServiceCollection();
             ServiceProvider serviceProvider = _services.BuildServiceProvider();  
             List<ServiceDescriptor> services = new List<ServiceDescriptor>();
@@ -32,19 +32,19 @@ namespace TEAMModelOS.Service.Services.ChangeFeed
                     services.Add(service);
                 }
             }
-            foreach (string CollectionName in dict.Keys)
+            foreach (string CollectionName in dict.nameCosmos.Keys)
             {
                 if (CollectionName.Equals("AleaseContainer")) 
                 { 
                     continue; 
                 }
-                if (dict[CollectionName].monitor) {
-                    ChangeFeedProcessor changeFeedProcessor = dict[CollectionName]
+                if (dict.nameCosmos[CollectionName].monitor) {
+                    ChangeFeedProcessor changeFeedProcessor = dict.nameCosmos[CollectionName]
                         .container
                         .GetChangeFeedProcessorBuilder<object>(CollectionName, async (changes, token) => 
-                        await ProcessChanges(changes,  dict[CollectionName].type , services, serviceProvider))
+                        await ProcessChanges(changes,  dict.nameCosmos[CollectionName].type , services, serviceProvider))
                         .WithInstanceName("TEAMModelOS")
-                        .WithLeaseContainer(dict["AleaseContainer"].container)
+                        .WithLeaseContainer(dict.nameCosmos["AleaseContainer"].container)
                         .Build();
                        changeFeedProcessor.StartAsync();
                 }

+ 1 - 1
TEAMModelOS.Service/Services/ChangeFeed/IChangeFeedInvoke.cs

@@ -10,6 +10,6 @@ namespace TEAMModelOS.Service.Services.ChangeFeed
 {
    public interface IChangeFeedInvoke :IBusinessService
     {
-          void MonitorChangeFeed(Dictionary<string, CosmosModelInfo> dict , IServiceCollection _services);
+          void MonitorChangeFeed(CosmosDict dict , IServiceCollection _services);
     }
 }

+ 1 - 1
TEAMModelOS.Service/Services/ChangeFeed/KnowledgeChangeFeed.cs

@@ -5,7 +5,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelOS.Service.Services.ChangeFeed
 {

+ 3 - 3
TEAMModelOS.Service/Services/ChangeFeed/SyllabusVolumeChangeFeed.cs

@@ -4,18 +4,18 @@ using System.Text;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
+using TEAMModelOS.Service.Models;
 
 namespace TEAMModelOS.Service.Services.ChangeFeed
 {
-    class SyllabusVolumeChangeFeed : IChangeFeedService<SyllabusVolume>, IChangeService
+    class SyllabusVolumeChangeFeed : IChangeFeedService<Volume>, IChangeService
     {
         private IAzureCosmosDBV3Repository cosmosDBV3Repository;
         public SyllabusVolumeChangeFeed(IAzureCosmosDBV3Repository azureCosmos)
         {
             cosmosDBV3Repository = azureCosmos;
         }
-        public void Processor(IReadOnlyCollection<SyllabusVolume> changes)
+        public void Processor(IReadOnlyCollection<Volume> changes)
         {
             Console.WriteLine(DateTimeOffset.Now.UtcTicks + "    "+changes.ToApiJson());
         }

+ 35 - 36
TEAMModelOS.Service/Services/Evaluation/Implements/HtmlAnalyzeService.cs

@@ -15,8 +15,7 @@ using TEAMModelOS.SDK.Helper.Common.FileHelper;
 using TEAMModelOS.SDK.Helper.Common.StringHelper;
 using TEAMModelOS.SDK.Helper.Security.ShaHash;
 using TEAMModelOS.Service.Model.PowerPoint;
-using TEAMModelOS.Service.Models.Core;
-using TEAMModelOS.Service.Models.Exam.Models;
+using TEAMModelOS.Service.Models;
 using TEAMModelOS.Service.Services.Exam.Interfaces;
 namespace TEAMModelOS.Service.Services.Exam.Implements
 {
@@ -36,7 +35,7 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
             { "Single", "【单选题】|【结束】" }, { "Multiple", "【多选题】|【结束】" },
             { "Judge", "【判断题】|【结束】" }, { "Complete", "【填空题】|【结束】" },
             { "Subjective", "【问答题】|【结束】" } , { "Compose", "【综合题】|【完结】" }};
-        public List<ExamItem> AnalyzeWordAsync(string html, string Lang)
+        public List<Models.ItemInfo> AnalyzeWordAsync(string html, string Lang)
         { 
             //去除class 以及span标签"
             string classpattern = "class=\"([^\"]*)\"";
@@ -45,33 +44,33 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
             html = Regex.Replace(html, pattern, "");
             html = html.Replace("\t", " ").Replace("<span>", "").Replace("</span>", "").Replace("dir=\"ltr\"", "");
             Dictionary<string, List<string>> TestInType = ConvertTest(html);
-            List<ExamItem> tests = new List<ExamItem>();
+            List<Models.ItemInfo> tests = new List<Models.ItemInfo>();
             foreach (string key in TestInType.Keys)
             {
                 switch (key)
                 {
                     case "Single":
-                        List<ExamItem> exercisesSingle = SingleConvert(key, TestInType[key]);
+                        List<Models.ItemInfo> exercisesSingle = SingleConvert(key, TestInType[key]);
                         exercisesSingle.ForEach(x => { x.pShaCode = x.shaCode; });
                         tests.AddRange(exercisesSingle); break;
                     case "Multiple":
-                        List<ExamItem> exercisesMultiple = MultipleConvert(key, TestInType[key]);
+                        List<Models.ItemInfo> exercisesMultiple = MultipleConvert(key, TestInType[key]);
                         exercisesMultiple.ForEach(x => { x.pShaCode = x.shaCode; });
                         tests.AddRange(exercisesMultiple); break;
                     case "Judge":
-                        List<ExamItem> exercisesJudge = JudgeConvert(key, TestInType[key]);
+                        List<Models.ItemInfo> exercisesJudge = JudgeConvert(key, TestInType[key]);
                         exercisesJudge.ForEach(x => { x.pShaCode = x.shaCode; });
                         tests.AddRange(exercisesJudge); break;
                     case "Complete":
-                        List<ExamItem> exercisesComplete = CompleteConvert(key, TestInType[key]);
+                        List<Models.ItemInfo> exercisesComplete = CompleteConvert(key, TestInType[key]);
                         exercisesComplete.ForEach(x => { x.pShaCode = x.shaCode; });
                         tests.AddRange(exercisesComplete); break;
                     case "Subjective":
-                        List<ExamItem> exercisesSubjective = SubjectiveConvert(key, TestInType[key]);
+                        List<Models.ItemInfo> exercisesSubjective = SubjectiveConvert(key, TestInType[key]);
                         exercisesSubjective.ForEach(x => { x.pShaCode = x.shaCode; });
                         tests.AddRange(exercisesSubjective); break;
                     case "Compose":
-                        List<ExamItem> exercisesCompose = ComposeConvert(key, TestInType[key], Lang);
+                        List<Models.ItemInfo> exercisesCompose = ComposeConvert(key, TestInType[key], Lang);
                         exercisesCompose.ForEach(x => { x.pShaCode = x.shaCode; });
                         tests.AddRange(exercisesCompose);
                         break;
@@ -81,36 +80,36 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
             return tests;
         }
 
-        private List<ExamItem> SingleConvert(string TypeKey, List<string> list)
+        private List<Models.ItemInfo> SingleConvert(string TypeKey, List<string> list)
         {
-            List<ExamItem> testInfos = OptionProcess(TypeKey, list);
+            List<Models.ItemInfo> testInfos = OptionProcess(TypeKey, list);
             return testInfos;
         }
 
-        private List<ExamItem> MultipleConvert(string TypeKey, List<string> list)
+        private List<Models.ItemInfo> MultipleConvert(string TypeKey, List<string> list)
         {
-            List<ExamItem> testInfos = OptionProcess(TypeKey, list);
+            List<Models.ItemInfo> testInfos = OptionProcess(TypeKey, list);
             return testInfos;
         }
 
-        private List<ExamItem> JudgeConvert(string TypeKey, List<string> list)
+        private List<Models.ItemInfo> JudgeConvert(string TypeKey, List<string> list)
         {
-            List<ExamItem> testInfos = OptionProcess(TypeKey, list);
+            List<Models.ItemInfo> testInfos = OptionProcess(TypeKey, list);
             return testInfos;
         }
 
 
-        private List<ExamItem> CompleteConvert(string TypeKey, List<string> list)
+        private List<Models.ItemInfo> CompleteConvert(string TypeKey, List<string> list)
         {
-            List<ExamItem> testInfos = CompleteProcess(TypeKey, list);
+            List<Models.ItemInfo> testInfos = CompleteProcess(TypeKey, list);
             return testInfos;
         }
-        private List<ExamItem> CompleteProcess(string TypeKey, List<string> tests)
+        private List<Models.ItemInfo> CompleteProcess(string TypeKey, List<string> tests)
         {
             //List<string> tests = ConvertTest(testHtml);
-            List<ExamItem> testInfos = ConvertTestInfo(tests, TypeKey);
+            List<Models.ItemInfo> testInfos = ConvertTestInfo(tests, TypeKey);
             HtmlDocument doc = new HtmlDocument();
-            foreach (ExamItem testInfo in testInfos)
+            foreach (Models.ItemInfo testInfo in testInfos)
             {
                 List<string> ans = new List<string>();
                 testInfo.question = testInfo.question.Replace(AnalysisTag, "").Replace(SummaryTag, "").Replace(AnswerTag, "");
@@ -156,11 +155,11 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
             return testInfos;
         }
 
-        private List<ExamItem> OptionProcess(string typeKey, List<string> list)
+        private List<Models.ItemInfo> OptionProcess(string typeKey, List<string> list)
         {
             string[] optionsKeys = Options.Select(s => s.ToString()).ToArray();
-            List<ExamItem> testInfos = ConvertTestInfo(list, typeKey);
-            foreach (ExamItem testInfo in testInfos)
+            List<Models.ItemInfo> testInfos = ConvertTestInfo(list, typeKey);
+            foreach (Models.ItemInfo testInfo in testInfos)
             {
                 string optsRgex = optionsKeys[0] + "(\\.|\\.|\\、|\\:|\\:)([\\s\\S]*?)" + AnswerTag;
                 string optsHtml = Regex.Match(testInfo.question, optsRgex).Value;
@@ -191,7 +190,7 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
                             optHtml = optHtml.Substring(2, optHtml.Length - 6);
                             optHtml = HtmlHelper.DoUselessTag(optHtml);
                             textImg.Append(HtmlHelper.DoTextImg(optHtml));
-                            testInfo.option.Add(new CodeValue {code = optionsKeys[i], value = optHtml });
+                            testInfo.option.Add(new CodeValue { code = optionsKeys[i], value = optHtml });
                             //testInfo.option.Add(new Dictionary<string, string> { { "code", optionsKeys[i] }, { "value", optHtml } });
                             //testInfo.option.TryAdd(optionsKeys[i], optHtml);
                         }
@@ -222,12 +221,12 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
         }
 
 
-        private List<ExamItem> SubjectiveConvert(string TypeKey, List<string> tests)
+        private List<Models.ItemInfo> SubjectiveConvert(string TypeKey, List<string> tests)
         {
             // List<string> tests = ConvertTest(testHtml);
-            List<ExamItem> testInfos = ConvertTestInfo(tests, TypeKey);
+            List<Models.ItemInfo> testInfos = ConvertTestInfo(tests, TypeKey);
 
-            foreach (ExamItem testInfo in testInfos)
+            foreach (Models.ItemInfo testInfo in testInfos)
             {
                 testInfo.question = testInfo.question.Replace(AnalysisTag, "").Replace(SummaryTag, "").Replace(AnswerTag, "");
                 testInfo.question = HtmlHelper.DoUselessTag(testInfo.question);
@@ -244,19 +243,19 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
             return testInfos;
         }
 
-        private List<ExamItem> ComposeConvert(string TypeKey, List<string> list, string Lang)
+        private List<Models.ItemInfo> ComposeConvert(string TypeKey, List<string> list, string Lang)
         {
-            List<ExamItem> exerciseDtos = new List<ExamItem>();
+            List<Models.ItemInfo> exerciseDtos = new List<Models.ItemInfo>();
             foreach (string html in list)
             {
-                ExamItem exercise = new ExamItem() { type = TypeKey };
+                Models.ItemInfo exercise = new Models.ItemInfo() { type = TypeKey };
                 string RegexStr = ComposeStart + "([\\s\\S]*?)" + ComposeEnd;
                 Match mt = Regex.Match(html, RegexStr);
                 exercise.question = HtmlHelper.DoUselessTag(mt.Value.Replace(ComposeStart, "").Replace(ComposeEnd, ""));
                 string testinfo = Regex.Replace(html, RegexStr, "").Replace(ComposeTag, CompleteStart);
                 //获取综合题的材料加每个小题的sha1Code
                 string testQs = HtmlHelper.DoTextImg(exercise.question);
-                List<ExamItem> dtos = AnalyzeWordAsync(testinfo, Lang);
+                List<Models.ItemInfo> dtos = AnalyzeWordAsync(testinfo, Lang);
                 if (dtos.IsNotEmpty())
                 {
                     dtos.ForEach(x => { testQs = testQs + x.shaCode; });
@@ -268,15 +267,15 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
             }
             return exerciseDtos;
         }
-        public static List<ExamItem> ConvertTestInfo(List<string> tests, string TypeKey)
+        public static List<Models.ItemInfo> ConvertTestInfo(List<string> tests, string TypeKey)
         {
-            List<ExamItem> testInfos = new List<ExamItem>();
+            List<Models.ItemInfo> testInfos = new List<Models.ItemInfo>();
             foreach (string html in tests)
             {
                 Dictionary<string, string> regex = new Dictionary<string, string>();
                 Dictionary<string, string> question = new Dictionary<string, string> { { "Summary", TestType[TypeKey].Split("|")[0] + "|" + AnswerTag }, { "Answer", AnswerTag + "|" + AnalysisTag }, { "Analysis", AnalysisTag + "|" + EndedTag } };
                 Dictionary<string, string> compquestion = new Dictionary<string, string> { { "Summary", TestType[TypeKey].Split("|")[0] + "|" + AnalysisTag }, { "Analysis", AnalysisTag + "|" + EndedTag } };
-                ExamItem test = new ExamItem();
+                Models.ItemInfo test = new Models.ItemInfo();
                 test.type = TypeKey;
                 List<string> keys = new List<string>();
                 if (TypeKey.Equals("Complete"))
@@ -300,7 +299,7 @@ namespace TEAMModelOS.Service.Services.Exam.Implements
                             test.question = mt.Value.Replace(TestType[TypeKey].Split("|")[0], ""); break;
                         case "Answer":
                             string Answer = mt.Value;
-                            ///单选或多选,判断答案 脱html标签
+                            //单选或多选,判断答案 脱html标签
                             if (TypeKey.Equals("Single") || TypeKey.Equals("Multiple") || TypeKey.Equals("Judge"))
                             {
                                 HtmlDocument doc = new HtmlDocument();

+ 1 - 1
TEAMModelOS.Service/Services/Evaluation/Implements/ImportExerciseService.cs

@@ -21,7 +21,7 @@ using TEAMModelOS.SDK.Helper.Security.ShaHash;
 using TEAMModelOS.SDK.Module.AzureBlob.Container;
 using TEAMModelOS.SDK.Module.AzureBlob.Interfaces;
 using TEAMModelOS.SDK.Module.AzureTable.Interfaces;
-using TEAMModelOS.Service.Models.Core;
+using TEAMModelOS.Service.Models;
 using TEAMModelOS.Service.Services.Exam.Interfaces;
 
 namespace TEAMModelOS.Service.Services.Exam.Implements

+ 1 - 3
TEAMModelOS.Service/Services/Evaluation/Interfaces/IHtmlAnalyzeService.cs

@@ -2,14 +2,12 @@
 using System.Collections.Generic;
 using System.Text;
 using TEAMModelOS.SDK.Context.Configuration;
-using TEAMModelOS.Service.Model.PowerPoint;
-using TEAMModelOS.Service.Models.Exam.Models;
 
 namespace TEAMModelOS.Service.Services.Exam.Interfaces
 {
     public interface IHtmlAnalyzeService: IBusinessService
     {
-        List<ExamItem> AnalyzeWordAsync(string htmlString, string Lang);
+        List<Models.ItemInfo> AnalyzeWordAsync(string htmlString, string Lang);
   
     }
 }

+ 26 - 27
TEAMModelOS.Service/Services/PowerPoint/Implement/HtexService.cs

@@ -20,7 +20,7 @@ using Fill = TEAMModelOS.Service.Model.PowerPoint.Fill;
 using Media = TEAMModelOS.Service.Model.PowerPoint.Media;
 using Position = TEAMModelOS.Service.Model.PowerPoint.Position;
 using TEAMModelOS.Service.Services.PowerPoint.Interface;
-using TEAMModelOS.Service.Models.Exam.Models;
+using TEAMModelOS.Service.Models;
 using TEAMModelOS.Service.Services.Exam.Interfaces;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 
@@ -44,14 +44,14 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
         public async Task<Htex> AnalyzeHtmlToHtex(string htmlString, string Lang)
         {
             Htex htex = new Htex();
-            List<ExamItem> items = htmlAnalyzeService.AnalyzeWordAsync(htmlString, Lang);
+            List<Models.ItemInfo> items = htmlAnalyzeService.AnalyzeWordAsync(htmlString, Lang);
             string sha=  ShaHashHelper.GetSHA1(htmlString);
             int index = 0;
-            foreach (ExamItem item in items)
+            foreach (Models.ItemInfo item in items)
             {
                 Slide slide = new Slide { exercise = item, index = index, source = 2, flag = 2 };
                 index++;
-                AzureBlobModel model=  await azureBlobDBRepository.UploadTextByFolder(slide.ToJson(), sha, index+".json","htex",false);
+                AzureBlobModel model =  await azureBlobDBRepository.UploadTextByFolder(slide.ToJson(), sha, index+".json","htex",false);
                 htex.slides.Add(model.BlobUrl);
             }
             htex.page = items.Count;
@@ -118,7 +118,8 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
         /// <summary>
         /// 加载PPTX文件
         /// </summary>
-        /// <param name="presentationFile"></param>
+        /// <param name="xdoc"></param>
+        /// <param name="shaCode"></param>
         /// <returns></returns>
         public async Task<Htex> ProcessPPTX(XmlDocument xdoc, string shaCode)
         {
@@ -217,8 +218,8 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             // Open slideLayoutXX.xml
             var slideLayoutContent = xdoc.GetTextByPath("//pkg:part[@pkg:name='" + layoutFilename + "']");
             NodesTable slideLayoutTables = ShapeHelper.IndexNodes(slideLayoutContent.GetTextByPath("pkg:xmlData/p:sldLayout"));
-            ///ppt/slides/slide5.xml  也包含a:overrideClrMapping
-            ////ppt/slideLayouts/slideLayout13.xml  也包含a:overrideClrMapping
+            //ppt/slides/slide5.xml  也包含a:overrideClrMapping
+            //ppt/slideLayouts/slideLayout13.xml  也包含a:overrideClrMapping
             var sldLayoutClrOvr = slideLayoutContent.GetTextByPath("pkg:xmlData/p:sldLayout/p:clrMapOvr/a:overrideClrMapping");
             if (sldLayoutClrOvr != null)
             {
@@ -244,7 +245,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             // @masterName: ppt/slideLayouts/_rels/slideLayout1.xml.rels
             var slideLayoutResFilename = layoutFilename.Replace("slideLayouts/slideLayout", "slideLayouts/_rels/slideLayout") + ".rels";
             var slideLayoutResContent = xdoc.GetTextByPath("//pkg:part[@pkg:name='" + slideLayoutResFilename + "']");
-            ///查看js  是替换之前 还是添加
+            //查看js  是替换之前 还是添加
             RelationshipArray = slideLayoutResContent.GetTextByPathList("pkg:xmlData/rel:Relationships/rel:Relationship");
             var masterFilename = "";
             Dictionary<string, Dictionary<string, string>> layoutResObj = new Dictionary<string, Dictionary<string, string>>();
@@ -330,7 +331,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             {
                 var nodes = spTreeNode.ChildNodes;
                 int order = 1;
-                List<Item> items = new List<Item>();
+                List<Model.PowerPoint.Item> items = new List<Model.PowerPoint.Item>();
                 foreach (XmlNode node in nodes)
                 {
                     await ProcessNodesInSlide(items, node.Name, node, order, warpObj);
@@ -341,27 +342,27 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             return slide;
         }
 
-        public async Task ProcessNodesInSlide(List<Item> items, string nodeKey, XmlNode node, int order, WarpObj warpObj)
+        public async Task ProcessNodesInSlide(List<Model.PowerPoint.Item> items, string nodeKey, XmlNode node, int order, WarpObj warpObj)
         {
             //  string result = "";
 
             switch (nodeKey)
             {
                 case "p:sp":    // Shape, Text
-                    Item  spitem= await ProcessSpNode(node, order, warpObj);
+                    Model.PowerPoint.Item  spitem= await ProcessSpNode(node, order, warpObj);
                     if (spitem != null) {
                         items.Add(spitem);
                     }
                     break;
                 case "p:cxnSp":    // Shape, Text (with connection)
-                    Item cxnitem =  await ProcessCxnSpNode(node, order, warpObj);
+                    Model.PowerPoint.Item cxnitem =  await ProcessCxnSpNode(node, order, warpObj);
                     if (cxnitem != null)
                     {
                         items.Add(cxnitem);
                     }
                     break;
                 case "p:pic":    // Picture
-                    Item picitem = await ProcessPicNode(node, order, warpObj);
+                    Model.PowerPoint.Item picitem = await ProcessPicNode(node, order, warpObj);
                     if (picitem != null) {
                         items.Add(picitem);
                     }
@@ -376,7 +377,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
                     var mcFallbackNode = node.GetTextByPath("mc:Fallback/p:sp");
                     if (mcFallbackNode != null)
                     {
-                        Item mcitem = await ProcessSpNode(mcFallbackNode, order, warpObj);
+                        Model.PowerPoint.Item mcitem = await ProcessSpNode(mcFallbackNode, order, warpObj);
                         if (mcitem != null)
                         {
                             items.Add(mcitem);
@@ -385,7 +386,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
                     else {
                         mcFallbackNode = node.GetTextByPath("mc:Fallback/p:pic");
                         if (mcFallbackNode != null) {
-                            Item mcPicitem = await ProcessPicNode(mcFallbackNode, order, warpObj);
+                            Model.PowerPoint.Item mcPicitem = await ProcessPicNode(mcFallbackNode, order, warpObj);
                             if (mcPicitem != null)
                             {
                                 items.Add(mcPicitem);
@@ -398,7 +399,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             }
         }
 
-        public async Task ProcessGroupSpNode(List<Item> items, XmlNode node, int order, WarpObj warpObj)
+        public async Task ProcessGroupSpNode(List<Model.PowerPoint.Item> items, XmlNode node, int order, WarpObj warpObj)
         {
             var factor = 1.00 * px96 / px914400;
             var xfrmNode = node.GetTextByPath("p:grpSpPr/a:xfrm");
@@ -421,7 +422,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             };
             // Procsee all child nodes
             var nodes = node.ChildNodes;
-            List<Item> gpIterm = new List<Item>();
+            List<Model.PowerPoint.Item> gpIterm = new List<Model.PowerPoint.Item>();
             foreach (XmlNode nd in nodes)
             {
                 await ProcessNodesInSlide(gpIterm, nd.Name, nd, order, warpObj);
@@ -434,7 +435,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             //return result;
         }
 
-        public async Task ProcessGraphicFrameNode(List<Item> items, XmlNode node, int order, WarpObj warpObj)
+        public async Task ProcessGraphicFrameNode(List<Model.PowerPoint.Item> items, XmlNode node, int order, WarpObj warpObj)
         {
         //    var result = "";
             var graphicTypeUri = node.GetTextByPath("a:graphic/a:graphicData/@uri");
@@ -459,7 +460,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             //return result;
         }
 
-        public async Task  GenDiagram(List<Item> items,  XmlNode node, int order, WarpObj warpObj)
+        public async Task  GenDiagram(List<Model.PowerPoint.Item> items,  XmlNode node, int order, WarpObj warpObj)
         {
             var xfrmNode = node.GetTextByPath("p:xfrm");
             var dgmRelIds = node.GetTextByPath("a:graphic/a:graphicData/dgm:relIds");
@@ -494,7 +495,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
                 diagram.type = "Diagram";
                 diagram.index = order++;
                 // Procsee all child nodes
-                List<Item> gpIterm = new List<Item>();
+                List<Model.PowerPoint.Item> gpIterm = new List<Model.PowerPoint.Item>();
                 XmlDocument nodeDoc = new XmlDocument();
                 var dgmDrwSpArrayLen = dgmDrwSpArray.Count;
                 for (var i = 0; i < dgmDrwSpArrayLen; i++)
@@ -1172,14 +1173,14 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             return borders;
         }
 
-        public async Task<Item> ProcessCxnSpNode(XmlNode node, int order, WarpObj warpObj)
+        public async Task<Model.PowerPoint.Item> ProcessCxnSpNode(XmlNode node, int order, WarpObj warpObj)
         {
             var id = node.GetTextByPath("p:nvCxnSpPr/p:cNvPr/@id");
             var name = node.GetTextByPath("p:nvCxnSpPr/p:cNvPr/@name");
             return await GenShape("CxnSp", node, null, null, id, name, null, null, order, warpObj);
         }
 
-        public async Task<Item> ProcessSpNode(XmlNode node, int order, WarpObj warpObj)
+        public async Task<Model.PowerPoint.Item> ProcessSpNode(XmlNode node, int order, WarpObj warpObj)
         {
 
             /*
@@ -1217,11 +1218,11 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
                     // type = getTextByPathList(slideMasterSpNode, ["p:nvSpPr", "p:nvPr", "p:ph", "attrs", "type"]);
                 }
             }
-            Item item = await GenShape("Sp", node, slideLayoutSpNode, slideMasterSpNode, id, name, idx, type, order, warpObj);
+            Model.PowerPoint.Item item = await GenShape("Sp", node, slideLayoutSpNode, slideMasterSpNode, id, name, idx, type, order, warpObj);
             return item;
         }
 
-        public async Task<Item> GenShape(string ShapeType, XmlNode node, XmlNode slideLayoutSpNode, XmlNode slideMasterSpNode, XmlNode id, XmlNode name, XmlNode idx, XmlNode type, int order, WarpObj warpObj)
+        public async Task<Model.PowerPoint.Item> GenShape(string ShapeType, XmlNode node, XmlNode slideLayoutSpNode, XmlNode slideMasterSpNode, XmlNode id, XmlNode name, XmlNode idx, XmlNode type, int order, WarpObj warpObj)
         {
             var xfrmList = "p:spPr/a:xfrm";
             var slideXfrmNode = node.GetTextByPath(xfrmList);
@@ -2448,8 +2449,6 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
         /// 幻灯片 背景色填充
         /// </summary>
         /// <param name="slideContent"></param>
-        /// <param name="slideLayoutContent"></param>
-        /// <param name="slideMasterContent"></param>
         /// <param name="index"></param>
         /// <param name="warpObj"></param>
         /// <returns></returns>
@@ -3095,7 +3094,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
                     media.mediaType = "video";
                     media.index = order;
                 }
-                ///  处理为AzureBlob 上传
+                //  处理为AzureBlob 上传
                 // vdoMimeType = getMimeType(vdoFileExt);
                 // blob = new Blob([uInt8Array], {
                 // type: vdoMimeType

+ 3 - 3
TEAMModelOS.Service/Services/PowerPoint/Implement/ShapeHelper.cs

@@ -74,8 +74,8 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
         /// <summary>
         /// 调色补充 Shade Tint  LumMod LumOff 等
         /// </summary>
-        /// <param name="xml"></param>
-        /// <param name="color"></param>
+        /// <param name="nodeXml"></param>
+        /// <param name="colorHex"></param>
         /// <returns></returns>
         public static string ColorToning(string nodeXml, string colorHex)
         {
@@ -729,7 +729,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
                 }
                 if (type != null)
                 {
-                    ///会出现相同Key
+                    //会出现相同Key
                     typeTable[type.Value] = child;
                 }
             }

+ 4 - 4
TEAMModelOS.Service/Services/PowerPoint/Implement/ShapeSvg.cs

@@ -2934,7 +2934,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
         {
          //   string result = "";
           //  result += " <polygon points='" + (w / 2) + " 0,0 " + (h / 2) + "," + (w / 2) + " " + h + "," + w + " " + (h / 2) + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
-              ///              "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
+              //              "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
 
             List<SvgShape> shapes = new List<SvgShape>() {new Polygon {
                 type = "polygon",
@@ -4479,7 +4479,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             { //gearNum=="9"
                 d = ShapeGear(w, h / 3.5, double.Parse(gearNum));
             }
-         ///   result += "<path   d='" + d + "' transform='rotate(20," + (3 / 7.00) * h + "," + (3 / 7.00) * h + ")' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
+         //   result += "<path   d='" + d + "' transform='rotate(20," + (3 / 7.00) * h + "," + (3 / 7.00) * h + ")' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
          //  "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
             List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
                 type = "path",
@@ -4665,7 +4665,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
         /// <returns></returns>
         private static Svg Plaque(XmlNode node, string shapType, double w, double h, bool imgFillFlg, bool grndFillFlg, int shpId, string fillColor, Border border)
         {
-          ///  string result = "";
+          //  string result = "";
             XmlNode shapAdjst = ShapeHelper.GetTextByPath(node, "p:spPr/a:prstGeom/a:avLst/a:gd/@fmla");
             double adj1 = 16667 * px9d6 / px91d4400;
             double cnsVal1 = 50000 * px9d6 / px91d4400;
@@ -5516,7 +5516,7 @@ namespace TEAMModelOS.Service.Services.PowerPoint.Implement
             }
 
          //   result += "<path d='" + d_val + "' fill='" + (!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")") +
-          ///  "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
+          //  "' stroke='#" + border.Color + "' stroke-width='" + border.Width + "' stroke-dasharray='" + border.Stroke + "' />";
             List<SvgShape> shapes = new List<SvgShape>() {new SvgPath {
                 type = "path",
                 //Fill =(!imgFillFlg ? (grndFillFlg ? "url(#linGrd_" + shpId + ")" : fillColor) : "url(#imgPtrn_" + shpId + ")"),

+ 6 - 6
TEAMModelOS.Service/Services/Syllabus/Implement/KnowledgeService.cs

@@ -3,10 +3,10 @@ using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
-using TEAMModelOS.Service.Services.Syllabus.Interface;
+using TEAMModelOS.Service.Models;
+using TEAMModelOS.Service.Services.Interface;
 
-namespace TEAMModelOS.Service.Services.Syllabus.Implement
+namespace TEAMModelOS.Service.Services.Implement
 {
     public class KnowledgeService : IKnowledgeService
     {
@@ -22,10 +22,10 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
             List<IdPk> idPks = await _cosmos.DeleteAll<Knowledge>(listPid);
             foreach (IdPk Knowledge in idPks)
             {
-                List<Knowledge> knowledges = await _cosmos.FindSQL<Knowledge>($"select value(c) from c join A0  in c.points where 1=1  and  c.type = 0 and A0 =  '"+ Knowledge.id + "' ");
-                List<SyllabusResource> Resources = await _cosmos.FindSQL<SyllabusResource>($"select value(c) from c join A0  in c.points where 1=1  and  c.type = 0 and A0 =  '" + Knowledge.id + "' ");
+                List<Knowledge> knowledges = await _cosmos.FindSQL<Knowledge>($"select value(c) from c join A0  in c.points where 1=1 and c.pk='Knowledge'  and  c.type = 0 and A0 =  '" + Knowledge.id + "' ");
+                List<Resource> Resources = await _cosmos.FindSQL<Resource>($"select value(c) from c join A0  in c.points where 1=1 and c.pk='Resource' and  c.type = 0 and A0 =  '" + Knowledge.id + "' ");
                 foreach (Knowledge knowledge in knowledges) knowledge.points.Remove(Knowledge.id);
-                foreach (SyllabusResource Resource in Resources) Resource.points.Remove(Knowledge.id);
+                foreach (Resource Resource in Resources) Resource.points.Remove(Knowledge.id);
                 await _cosmos.SaveOrUpdateAll(Resources);
                 await _cosmos.SaveOrUpdateAll(knowledges);
             }

+ 26 - 26
TEAMModelOS.Service/Services/Syllabus/Implement/SyllabusService.cs

@@ -7,10 +7,10 @@ using TEAMModelOS.SDK.Context.Exception;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Helper.Common.JsonHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
-using TEAMModelOS.Service.Services.Syllabus.Interface;
+using TEAMModelOS.Service.Models;
+using TEAMModelOS.Service.Services.Interface;
 
-namespace TEAMModelOS.Service.Services.Syllabus.Implement
+namespace TEAMModelOS.Service.Services.Implement
 {
     public class SyllabusService: ISyllabusService
     {
@@ -34,15 +34,15 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
             {
                 dict.Add("children[*]." + keyValuePair.Key, keyValuePair.Value);
             }
-            List<Syllabuses> data = await azureCosmosDBRepository.FindByDict<Syllabuses>(dict);
+            List<Syllabus> data = await azureCosmosDBRepository.FindByDict<Syllabus>(dict);
             List<SyllabusTree> treess = new List<SyllabusTree>();
             if (data.IsNotEmpty())
             {
-                Dictionary<string, Syllabuses> syllabuses = new Dictionary<string, Syllabuses>();
+                Dictionary<string, Syllabus> syllabuses = new Dictionary<string, Syllabus>();
                 data.ForEach(x => syllabuses.TryAdd(x.id, x));
-                data = new List<Syllabuses>(syllabuses.Values);
+                data = new List<Syllabus>(syllabuses.Values);
                
-                foreach (Syllabuses item in data)
+                foreach (Syllabus item in data)
                 {
 
                     List<SyllabusNode> nodedata = item.children;
@@ -87,15 +87,15 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
         }
         
 
-        public async Task<List<Syllabuses>> SaveOrUpdateAsNodes(List<SyllabusNode> syllabusNodes)
+        public async Task<List<Syllabus>> SaveOrUpdateAsNodes(List<SyllabusNode> syllabusNodes)
         {
-            List<Syllabuses> syllabuses;
+            List<Syllabus> syllabuses;
 
-            List<Syllabuses> data = await azureCosmosDBRepository.FindByDict<Syllabuses>(new Dictionary<string, object> { { "id", syllabusNodes[0].volumeCode } });
+            List<Syllabus> data = await azureCosmosDBRepository.FindByDict<Syllabus>(new Dictionary<string, object> { { "id", syllabusNodes[0].code } });
             if (data.IsEmpty()) {
-                var syllabus = new Syllabuses { id = syllabusNodes[0].volumeCode, volumeCode = syllabusNodes[0].volumeCode, children = new List<SyllabusNode>() };
+                var syllabus = new Syllabus { id = syllabusNodes[0].code, code = syllabusNodes[0].code, children = new List<SyllabusNode>() };
                 await azureCosmosDBRepository.SaveOrUpdate(syllabus);
-                data = new List<Syllabuses>() { syllabus };
+                data = new List<Syllabus>() { syllabus };
             }
             List<SyllabusNode> syllabusNodes1 = new List<SyllabusNode>();
             if (data.IsNotEmpty())
@@ -106,7 +106,7 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                 {
                     for (int j = 0; j < syllabusNodes.Count; j++)
                     {
-                        if (data[0].children[i].id == syllabusNodes[j].id && data[0].children[i].volumeCode == syllabusNodes[j].volumeCode)
+                        if (data[0].children[i].id == syllabusNodes[j].id && data[0].children[i].code == syllabusNodes[j].code)
                         {
                             syllabusNodes1.Remove(data[0].children[i]);
                             syllabusNodes1.Add(syllabusNodes[j]);
@@ -131,7 +131,7 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                         }
                     }
                 }
-                syllabuses = await azureCosmosDBRepository.SaveOrUpdateAll<Syllabuses>(data);
+                syllabuses = await azureCosmosDBRepository.SaveOrUpdateAll<Syllabus>(data);
 
             }
             else
@@ -146,14 +146,14 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
         public async Task<List<SyllabusTree>> SaveOrUpdateAsTree(List<SyllabusTree> request)
         {
             List<SyllabusNode> nodes = new List<SyllabusNode>();
-            Syllabuses syllabus = new Syllabuses();
+            Syllabus syllabus = new Syllabus();
 
             TreeToList(request, nodes);
             // List<SyllabusNode> nods = nodes.ToJson().FromJson<List<SyllabusNode>>() ;
             syllabus.children = nodes;
-            syllabus.id = request[0].volumeCode;
-            syllabus.volumeCode = request[0].volumeCode;
-            await azureCosmosDBRepository.SaveOrUpdate<Syllabuses>(syllabus);
+            syllabus.id = request[0].code;
+            syllabus.code = request[0].code;
+            await azureCosmosDBRepository.SaveOrUpdate<Syllabus>(syllabus);
             List<SyllabusTree> treess = ListToTree(nodes);
             return treess;
         }
@@ -210,7 +210,7 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
             return trees;
         }
 
-        public async Task<List<Syllabuses>> DeleteSyllabus(Dictionary<string, object> request)
+        public async Task<List<Syllabus>> DeleteSyllabus(Dictionary<string, object> request)
         {
             Dictionary<string, object> dict = new Dictionary<string, object>();
             foreach (KeyValuePair<string, object> keyValuePair in request)
@@ -218,17 +218,17 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                 dict.Add("children[*]." + keyValuePair.Key, keyValuePair.Value);
             }
 
-            List<Syllabuses> data = await azureCosmosDBRepository.FindByDict<Syllabuses>(dict);
-            Dictionary<string, Syllabuses> syllabuses = new Dictionary<string, Syllabuses>();
-            List<Syllabuses> data1 = new List<Syllabuses>();
+            List<Syllabus> data = await azureCosmosDBRepository.FindByDict<Syllabus>(dict);
+            Dictionary<string, Syllabus> syllabuses = new Dictionary<string, Syllabus>();
+            List<Syllabus> data1 = new List<Syllabus>();
             if (data.Count > 0)
             {
                 data.ForEach(x => syllabuses.TryAdd(x.id, x));
-                data = new List<Syllabuses>(syllabuses.Values);
+                data = new List<Syllabus>(syllabuses.Values);
 
                 //是否全删
                 bool flg = false;
-                foreach (Syllabuses item in data)
+                foreach (Syllabus item in data)
                 {
                     List<SyllabusNode> nodedata = item.children;
                     if (request.TryGetValue("id", out object id))
@@ -260,13 +260,13 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                     item.children = syllabusNodes;
                     if (item.children.Count == 0)
                     {
-                        await azureCosmosDBRepository.DeleteAsync<Syllabuses>(item.id, item.volumeCode);
+                        await azureCosmosDBRepository.DeleteAsync<Syllabus>(item.id, item.code);
                         flg = true;
                     }
                 }
                 if (!flg)
                 {
-                    data1 = await azureCosmosDBRepository.SaveOrUpdateAll<Syllabuses>(data);
+                    data1 = await azureCosmosDBRepository.SaveOrUpdateAll<Syllabus>(data);
 
                 }
 

+ 19 - 19
TEAMModelOS.Service/Services/Syllabus/Implement/VolumeService.cs

@@ -6,10 +6,10 @@ using TEAMModelOS.SDK.Context.Exception;
 using TEAMModelOS.SDK.Extension.SnowFlake;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
-using TEAMModelOS.Service.Services.Syllabus.Interface;
+using TEAMModelOS.Service.Models;
+using TEAMModelOS.Service.Services.Interface;
 
-namespace TEAMModelOS.Service.Services.Syllabus.Implement
+namespace TEAMModelOS.Service.Services.Implement
 {
     public class VolumeService : IVolumeService
     {
@@ -21,7 +21,7 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
             this.azureCosmosDBRepository = azureCosmosDBRepository;
         }
 
-        public async Task<List<SyllabusVolume>> SaveOrUpdateVolume(SyllabusVolume request)
+        public async Task<List<Volume>> SaveOrUpdateVolume(Volume request)
         {
             if (request.editors != null && request.editors.Count > 5)
             {
@@ -31,8 +31,8 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
             {
                 if (request.type == 0)
                 {
-                    List<SyllabusVolume> volumesFind = await azureCosmosDBRepository.FindByDict<SyllabusVolume>(new Dictionary<string, object>() {
-                        { "scopeCode",request.scopeCode},{ "periodCode", request.periodCode},
+                    List<Volume> volumesFind = await azureCosmosDBRepository.FindByDict<Volume>(new Dictionary<string, object>() {
+                        { "code",request.code},{ "periodCode", request.periodCode},
                         { "subjectCode", request.subjectCode},{ "gradeCode", request.gradeCode},
                         { "semesterCode",request.semesterCode},{ "volumeName",request.volumeName},
                         { "status",1} ,{ "type",0} });
@@ -40,15 +40,15 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                     {
                         throw new BizException("已存在!", ResponseCode.DATA_EXIST);
                     }
-                    ///校本课纲
-                    string key = request.scopeCode + IdWorker.getInstance().NextId();
+                    //校本课纲
+                    string key = request.code + IdWorker.getInstance().NextId();
                     request.id = key;
                     request.volumeCode = key;
                 }
                 else if (request.type == 1)
                 {
-                    List<SyllabusVolume> volumesFind = await azureCosmosDBRepository.FindByDict<SyllabusVolume>(new Dictionary<string, object>() {
-                        { "schoolCode",request.scopeCode},{ "periodCode", request.periodCode},
+                    List<Volume> volumesFind = await azureCosmosDBRepository.FindByDict<Volume>(new Dictionary<string, object>() {
+                        { "code",request.code},{ "periodCode", request.periodCode},
                         { "subjectCode", request.subjectCode},{ "gradeCode", request.gradeCode},
                         { "semesterCode",request.semesterCode},{ "volumeName",request.volumeName},
                         { "TEAMModelId",request.TEAMModelId}, { "status",1} ,{ "type",1} });
@@ -56,16 +56,16 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                     {
                         throw new BizException("已存在!", ResponseCode.DATA_EXIST);
                     }
-                    ///个人课纲
+                    //个人课纲
                     string key = "dynamic" + request.TEAMModelId.Replace("#", "") + IdWorker.getInstance().NextId();
                     request.id = key;
                     request.volumeCode = key;
                 }
                 else if (request.type == 2)
                 {
-                    ///系统课纲
+                    //系统课纲
                     string key = "system" + IdWorker.getInstance().NextId();
-                    request.scopeCode = "system";
+                    request.code = "system";
                     request.id = key;
                     request.volumeCode = key;
                 }
@@ -74,8 +74,8 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
             {
                 if (request.type == 0)
                 {
-                    List<SyllabusVolume> volumesFind = await azureCosmosDBRepository.FindByDict<SyllabusVolume>(new Dictionary<string, object>() {
-                    { "schoolCode",request.scopeCode},{ "periodCode", request.periodCode},
+                    List<Volume> volumesFind = await azureCosmosDBRepository.FindByDict<Volume>(new Dictionary<string, object>() {
+                    { "code",request.code},{ "periodCode", request.periodCode},
                         { "subjectCode", request.subjectCode},{ "gradeCode", request.gradeCode},
                         { "semesterCode",request.semesterCode},{ "volumeName",request.volumeName}  ,
                         { "status",1} ,{ "type",0} });
@@ -89,8 +89,8 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                 }
                 else if (request.type == 1)
                 {
-                    List<SyllabusVolume> volumesFind = await azureCosmosDBRepository.FindByDict<SyllabusVolume>(new Dictionary<string, object>() {
-                        { "schoolCode",request.scopeCode},{ "periodCode", request.periodCode},
+                    List<Volume> volumesFind = await azureCosmosDBRepository.FindByDict<Volume>(new Dictionary<string, object>() {
+                        { "code",request.code},{ "periodCode", request.periodCode},
                         { "subjectCode", request.subjectCode},{ "gradeCode", request.gradeCode},
                         { "semesterCode",request.semesterCode},{ "volumeName",request.volumeName},
                         { "TEAMModelId",request.TEAMModelId}, { "status",1} ,{ "type",1} });
@@ -108,11 +108,11 @@ namespace TEAMModelOS.Service.Services.Syllabus.Implement
                 }
 
             }
-            List<SyllabusVolume> volumes = new List<SyllabusVolume>
+            List<Volume> volumes = new List<Volume>
             {
                 request
             };
-            List<SyllabusVolume> volume = await azureCosmosDBRepository.SaveOrUpdateAll<SyllabusVolume>(volumes);
+            List<Volume> volume = await azureCosmosDBRepository.SaveOrUpdateAll<Volume>(volumes);
             return volume;
         }
     }

+ 2 - 2
TEAMModelOS.Service/Services/Syllabus/Interface/IKnowledgeService.cs

@@ -4,9 +4,9 @@ using System.Text;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Context.Configuration;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
+using TEAMModelOS.Service.Models;
 
-namespace TEAMModelOS.Service.Services.Syllabus.Interface
+namespace TEAMModelOS.Service.Services.Interface
 {
     public interface IKnowledgeService : IBusinessService
     {

+ 4 - 4
TEAMModelOS.Service/Services/Syllabus/Interface/ISyllabusService.cs

@@ -4,9 +4,9 @@ using System.Text;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Context.Configuration;
 using TEAMModelOS.SDK.Module.AzureCosmosDBV3;
-using TEAMModelOS.Service.Models.Syllabus;
+using TEAMModelOS.Service.Models;
 
-namespace TEAMModelOS.Service.Services.Syllabus.Interface
+namespace TEAMModelOS.Service.Services.Interface
 {
     public interface ISyllabusService : IBusinessService
     {
@@ -23,11 +23,11 @@ namespace TEAMModelOS.Service.Services.Syllabus.Interface
         /// </summary>
         /// <param name="syllabusNodes"></param>
         /// <returns></returns>
-        public Task<List<Syllabuses>> SaveOrUpdateAsNodes(List<SyllabusNode> syllabusNodes);
+        public Task<List<Syllabus>> SaveOrUpdateAsNodes(List<SyllabusNode> syllabusNodes);
 
         public Task<List<SyllabusTree>> SaveOrUpdateAsTree(List<SyllabusTree> request);
 
-        public Task<List<Syllabuses>> DeleteSyllabus(Dictionary<string, object> request);
+        public Task<List<Syllabus>> DeleteSyllabus(Dictionary<string, object> request);
 
 
     }

+ 3 - 3
TEAMModelOS.Service/Services/Syllabus/Interface/IVolumeService.cs

@@ -3,14 +3,14 @@ using System.Collections.Generic;
 using System.Text;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Context.Configuration;
-using TEAMModelOS.Service.Models.Syllabus;
+using TEAMModelOS.Service.Models;
 
-namespace TEAMModelOS.Service.Services.Syllabus.Interface
+namespace TEAMModelOS.Service.Services.Interface
 {
     public interface IVolumeService : IBusinessService
     {
 
-        public  Task<List<SyllabusVolume>> SaveOrUpdateVolume(SyllabusVolume request);
+        public  Task<List<Volume>> SaveOrUpdateVolume(Volume request);
 
     }
 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 498 - 565
TEAMModelOS.Service/TEAMModelOS.Model.xml


+ 16 - 15
TEAMModelOS/ClientApp/src/api/knowledge.js

@@ -1,38 +1,39 @@
 import { post } from '@/filters/http'
 export default {
-    // ��ȡ��׼֪ʶ��
+    // 获取标准知识点
     GetStantardPoints: function(data) {
-        return post('/api/Knowledge/FindKnowledgePointByDict', data)
+        return post('/api/Knowledge/findStdPoint', data)
     },
-    // ��ȡ��׼֪ʶ��
+    // 获取标准的知识块及包含的知识点
     GetStantardBlocks: function(data) {
-        return post('/api/Knowledge/FindKnowledgeBlockAndPointByDict', data)
+        return post('/api/Knowledge/findStdBlockPoint', data)
     },
-    // ��ȡѧУ֪ʶ��
+    // 获取知识块知识点
     GetSchoolPoints: function(data) {
-        return post('/api/Knowledge/FindKnowledge', data)
+        return post('/api/Knowledge/find', data)
     },
-    // ��ȡѧУ֪ʶ��
+    // 获取知识块知识点
     GetSchoolBlocks: function(data) {
-        return post('/api/Knowledge/FindKnowledge', data)
+        return post('/api/Knowledge/find', data)
     },
-    // ��������ѧУ֪ʶ�鼰֪ʶ��
+    // 批量更新保存知识点知识块
     SaveOrUpdateKnowledge: function(data) {
-        return post('/api/Knowledge/SaveOrUpdateKnowledge', data)
+        return post('/api/Knowledge/upsertAll', data)
     },
     // �ֶ�����ѧУ��˽��֪ʶ��
     SaveOrUpdateSchoolPoint: function(data) {
         return post('/api/Knowledge/SaveOrUpdateAllSchoolPoint', data)
     },
-    // ɾ��֪ʶ�����֪ʶ��
+    // 删除知识点知识块
     DeleteSchoolPoint: function(data) {
-        return post('/api/Knowledge/DeleteKnowledge', data)
+        return post('/api/Knowledge/delete', data)
     },
-    // ɾ��֪ʶ��
+    // 删除知识点知识块
     DeleteSchoolBlock: function(data) {
-        return post('/api/Knowledge/DeleteKnowledge', data)
+        return post('/api/Knowledge/delete', data)
     },
+    // 根据id集合获取知识点知识块
     FindKnowledgebyId: function(data) {
-        return post('/api/Knowledge/FindKnowledgebyId', data)
+        return post('/api/Knowledge/findByIds', data)
     },
 }

+ 27 - 25
TEAMModelOS/ClientApp/src/api/learnActivity.js

@@ -4,37 +4,37 @@ export default {
      *保存试卷
      */
     SaveExamPaper: function (data) {
-        return post('/api/Exam/SaveExamPaper', data)
+        return post('/api/Paper/upsert', data)
     },
     /*
      *查询试卷
      */
     FindExamPaper: function (data) {
-        return post('/api/Exam/FindExamPaper', data)
+        return post('/api/Paper/find', data)
     },
     /*
      *删除试卷
      */
     DeleteExamPaper: function (data) {
-        return post('/api/Exam/DeleteExamPaper', data)
+        return post('/api/Paper/delete', data)
     },
     /*
      *删除评测信息
      */
     DeleteExamInfo: function (data) {
-        return post('/api/Exam/DeleteExamInfo', data)
+        return post('/api/Exam/Delete', data)
     },
     /*
      *保存评测
      */
     SaveExamInfo: function (data) {
-        return post('/api/Exam/SaveExamInfo', data)
+        return post('/api/Exam/Save', data)
     },
     /*
      *查询评测
      */
     FindExamInfo: function (data) {
-        return post('/api/Exam/FindExamInfo', data)
+        return post('/api/Exam/Find', data)
     },
     /*
      *自动组题
@@ -46,7 +46,7 @@ export default {
      *保存最小单元
      */
     SaveUnit: function (data) {
-        return post('/api/Learn/SaveUnit', data)
+        return post('/api/Learn/upsertUnit', data)
     },
     /*
      *查询最小单元
@@ -64,80 +64,82 @@ export default {
     *根据id数组查询资源文件
     */
     FindSyllabusResourceById: function (data) {
-        return post('/api/Resource/FindSyllabusResourceById', data)
+        return post('/api/Resource/findById', data)
     },
     /*
     *根据id数组查询资源文件
     */
     FindQuestionById: function (data) {
-        return post('/api/ItemInfo/FindById', data)
+        return post('/api/ItemInfo/findByIds', data)
     },
     /*
     *保存编序式学习活动
     */
     SaveOrderLearn: function (data) {
-        return post('/api/Learn/SaveorUpdataLeanProcess', data)
+        return post('/api/Learn/upsertProcess', data)
     },
     /*
     *查询编序式学习活动
     */
     FindOrderLearn: function (data) {
-        return post('/api/Learn/FindLeanProcess', data)
+        return post('/api/Learn/FindProcess', data)
     },
+
+
     /*
     *查询作业活动
     */
     SaveorUpdataHomeWork: function (data) {
-        return post('/api/HomeWork/SaveorUpdataHomeWork', data)
+        return post('/api/HomeWork/upsert', data)
     },
     /*
     *新增或者编辑作业活动
     */
     FindHomeWork: function (data) {
-        return post('/api/HomeWork/FindHomeWork', data)
+        return post('/api/HomeWork/find', data)
     },
     /*
     * 撤销发布作业
     */
     RevokeHomeWork: function (data) {
-        return post('/api/HomeWork/RevokeHomeWork', data)
+        return post('/api/HomeWork/cancel', data)
     },
     /*
     * 删除作业
     */
     DeleteHomeWork: function (data) {
-        return post('/api/HomeWork/DeleteHomeWork', data)
+        return post('/api/HomeWork/delete', data)
     },
     /*
     * 查询老师课程下的所有班级
     */
     FindClassroomByTeacherId: function (data) {
-        return post('/api/HomeWork/FindClassroom', data)
+        return post('/api/Course/findTeachClass', data)
     },
     /*
     * 查询作业下的所有学生数据
     */
     FindStudentByHwId: function (data) {
-        return post('/api/HomeWork/FindStudent', data)
+        return post('/api/HomeWork/findStudent', data)
     },
 
     /*
      * 查询老师的评语罐头
      */
     FindTeacherComments: function (data) {
-        return post('/api/HomeWork/FindTeacherComments', data)
+        return post('/api/HomeWork/findComments', data)
     },
     /*
      * 新增老师的评语罐头
      */
     SaveOrUpdateTeacherComments: function (data) {
-        return post('/api/HomeWork/SaveOrUpdateTeacherComments', data)
+        return post('/api/HomeWork/upsertComments', data)
     },
     /*
      * 删除老师的评语罐头
      */
     DeleteTeacherComments: function (data) {
-        return post('/api/HomeWork/DeleteTeacherComments', data)
+        return post('/api/HomeWork/deleteComments', data)
     },
 
     /*
@@ -168,7 +170,7 @@ export default {
     *删除编序式活动
     */
     DeleteLeanProcess: function (data) {
-        return post('/api/Learn/DeleteLeanProcess', data)
+        return post('/api/Learn/DeleteProcess', data)
     },
     /*
     *删除最小单元
@@ -180,24 +182,24 @@ export default {
     * 新增或者修改投票活动
     */
     SaveorUpdataVote: function (data) {
-        return post('/api/Vote/SaveorUpdataVote', data)
+        return post('/api/Vote/upsert', data)
     },
     /*
     * 查询投票活动
     */
     FindVote: function (data) {
-        return post('/api/Vote/FindVote', data)
+        return post('/api/Vote/find', data)
     },
     /*
     * 删除投票活动
     */
     DeleteVote: function (data) {
-        return post('/api/Vote/DeleteVote', data)
+        return post('/api/Vote/delete', data)
     },
     /*
     * 查询学生投票活动数据
     */
     FindStudentByVoteId: function (data) {
-        return post('/api/Vote/FindStudent', data)
+        return post('/api/Vote/findStudent', data)
     },
 }

+ 11 - 11
TEAMModelOS/ClientApp/src/api/newEvaluation.js

@@ -4,30 +4,30 @@ export default {
         return post('/api/ImportExercise/AnalyzeHtml', data)
     },
     /**
-     * �������浥������
+     * 更新保存试题
      * @param {any} data
      */
     SaveSingleExercise: function(data) {
-        return post('/api/ItemInfo/Save', data)
+        return post('/api/ItemInfo/upsert', data)
     },
     /**
-     * �������浥������
+     * 批量更新保存试题
      * @param {any} data
      */
     SaveAllExercise: function(data) {
-        return post('/api/ItemInfo/SaveAll', data)
+        return post('/api/ItemInfo/upsertAll', data)
     },
 
     /**
-     * ��ѯ����б�
+     * 根据条件手动挑题
      * @param {any} data
      */
     FindExerciseList: function(data) {
-        return post('/api/ItemInfo/Find', data)
+        return post('/api/ItemInfo/find', data)
     },
 
     /**
-     * ������ѯ�������
+     * 查找总数
      * @param {any} data
      */
     FindCount: function(data) {
@@ -35,19 +35,19 @@ export default {
     },
 
     /**
-     * ��ѯ������Ŀ����ϸ����
+     * 根据试题id集合获取题目
      * @param {any} data
      */
     FindExerciseById: function(data) {
-        return post('/api/ItemInfo/FindById', data)
+        return post('/api/ItemInfo/findByIds', data)
     },
 
     /**
-     * ɾ��������Ŀ
+     * 删除试题
      * @param {any} data
      */
     DeleteExamItem: function(data) {
-        return post('/api/ItemInfo/DeleteExamItem', data)
+        return post('/api/ItemInfo/delete', data)
     }
 
 }

+ 5 - 4
TEAMModelOS/ClientApp/src/api/schoolSetting.js

@@ -1,16 +1,17 @@
 import { fetch, post } from '@/filters/http'
 export default {
     schoolSettingSaveOrUpdate: function(data) {
-        return post('/api/School/SaveOrUpdateAll', data)
+        return post('/api/School/upsert', data)
     },
     findSchoolSystem: function(data) {
-        return post('/api/School/FindSchool', data)
+        return post('/api/School/find', data)
     },
     findClassInfo: function(data) {
-        return post('/api/Classroom/FindClassInfo', data)
+        return post('/api/Classroom/Find', data)
     },
+    //¸üлòÐÂÔö½ÌÊÒ
     classroomSettingSaveOrUpdate: function(data) {
-        return post('/api/Classroom/SaveOrUpdate', data)
+        return post('/api/Classroom/upsert', data)
     },
     dataDefault: function(data) {
         return post('/api/Common/DataDefault', data)

+ 8 - 7
TEAMModelOS/ClientApp/src/api/stuAccount.js

@@ -1,32 +1,33 @@
 import { fetch, post } from '@/filters/http'
 export default {
     saveStudent: function(data) {
-        return post('/api/Student/SaveStudent', data)
+        return post('/api/Student/upsert', data)
     },
+    //查询学生
     findStudent: function(data) {
-        return post('/api/Student/FindStudent', data)
+        return post('/api/Student/Find', data)
     },
     saveAllStudent: function(data) {
-        return post('/api/Student/SaveAllStudent', data)
+        return post('/api/Student/upsertAll', data)
     },
     updateStudent: function(data) {
-        return post('/api/Student/UpdateStudent', data)
+        return post('/api/Student/upsert', data)
     },
     updateAllStudent: function(data) {
-        return post('/api/Student/UpdateAllStudent', data)
+        return post('/api/Student/upsertAll', data)
     },
     /**
      * 单个删除学生
      * @param {any} data
      */
     deleteStudent: function(data) {
-        return post('/api/Student/DeleteStudent', data)
+        return post('/api/Student/delete', data)
     },
     /**
      * 批量删除学生
      * @param {any} data
      */
     deleteAllStudent: function (data) {
-        return post('/api/Student/DeleteAllStudent', data)
+        return post('/api/Student/BulkDelete', data)
     }
 }

+ 18 - 24
TEAMModelOS/ClientApp/src/api/syllabus.js

@@ -1,45 +1,39 @@
 import { post } from '@/filters/http'
 export default {
-    // ����������ȡѧУ����
-    GetSchoolInfo: function(data) {
-        return post('/api/School/FindSchool', data)
-    },
-    // �������¿θٲ��
+    // 更新册别
     SaveOrUpdateVolume: function(data) {
-        return post('/api/Volume/SaveOrUpdate', data)
+        return post('/api/Volume/upsert', data)
     },
-    // ���ҿθٲ��
+    // 查找册别
     GetVolumes: function(data) {
-        return post('/api/Volume/Find', data)
+        return post('/api/Volume/find', data)
     },
-    // ɾ���θٲ��
+    // 删除册别
     DeleteVolume: function(data) {
-        return post('/api/Volume/Delete', data)
+        return post('/api/Volume/delete', data)
     },
-    // ���ݲ����ҿθ�����
+    // 根据册别查找树形课纲
     GetTreeByVolume: function(data) {
-        return post('/api/Syllabus/Find', data)
+        return post('/api/Syllabus/find', data)
     },
-    // �������α��������θ�
+    // 更新课纲树形结构
     SaveOrUpdateAsTree: function(data) {
-        return post('/api/Syllabus/SaveOrUpdateAsTree', data)
-    },
-    // ����������������ڵ�
-    SaveOrUpdateAsNodes: function(data) {
-        return post('/api/Syllabus/SaveOrUpdateAsNodes', data)
+        return post('/api/Syllabus/upsertTree', data)
     },
-    // ����������������ڵ�
+    // 更新节点
     SaveOrUpdateAsNodes: function(data) {
-        return post('/api/Syllabus/SaveOrUpdateAsNodes', data)
+        return post('/api/Syllabus/upsertNodes', data)
     },
-    // ͨ�ü��ϲ�ѯ�ӿ�
+    // 查找集合
     FindCollection: function(data) {
         return post('/api/Common/FindCollection', data)
-    },// ͨ�ü��ϲ�ѯ�ӿ�
+    },
+    // 查找册别数量
     FindSyllabusCount: function(data) {
-        return post('/api/Volume/FindSyllabusCount', data)
+        return post('/api/Volume/count', data)
     },
+    // 查找知识块数量
     FindBlockCount: function (data) {
-        return post('/api/Knowledge/FindKnowlegeCount', data)
+        return post('/api/Knowledge/count', data)
     },
 }

+ 4 - 4
TEAMModelOS/ClientApp/src/api/teachContent.js

@@ -1,15 +1,15 @@
 import { fetch, post } from '@/filters/http'
 export default {
     saveOrUpdateResource: function(data) {
-        return post('/api/Resource/SaveOrUpdateSyllabusResource', data)
+        return post('/api/Resource/upsertAll', data)
     },
     findResourceByDict: function(data) {
-        return post('/api/Resource/FindSyllabusResourceByDict', data)
+        return post('/api/Resource/find', data)
     },
     deleteResource: function(data) {
-        return post('/api/Resource/DeleteSyllabusResource', data)
+        return post('/api/Resource/delete', data)
     },
     FindSyllabusResourceById: function (data) {
-        return post('/api/Resource/FindSyllabusResourceById', data)
+        return post('/api/Resource/findById', data)
     },
 }

+ 0 - 0
TEAMModelOS/ClientApp/src/common/BaseQuestionList.vue


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.