Browse Source

提交学生账号

CrazyIter 5 years ago
parent
commit
cb5c8b7f58

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

@@ -319,7 +319,7 @@ namespace TEAMModelOS.SDK.Module.AzureCosmosDB.Implements
             //查询条数 -1是全部
             //查询条数 -1是全部
             FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = open };
             FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1, EnableCrossPartitionQuery = open };
             var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), queryOptions);
             var query = CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name), queryOptions);
-
+            var ass = DynamicLinq.GenerateFilter<T>(query, filters);
             List<T> list = DynamicLinq.GenerateFilter<T>(query, filters).ToList();
             List<T> list = DynamicLinq.GenerateFilter<T>(query, filters).ToList();
             return list;
             return list;
             //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name),sql);
             //return CosmosClient.CreateDocumentQuery<T>(UriFactory.CreateDocumentCollectionUri(Database, t.Name),sql);

+ 1 - 1
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -15,7 +15,7 @@
     <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.0.0" />
     <PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.0.0" />
     <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
     <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
     <PackageReference Include="Microsoft.Azure.CosmosDB.BulkExecutor" Version="2.4.1-preview" />
     <PackageReference Include="Microsoft.Azure.CosmosDB.BulkExecutor" Version="2.4.1-preview" />
-    <PackageReference Include="Microsoft.Azure.DocumentDB" Version="2.8.1" />
+    <PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.9.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration" Version="3.0.0" />
     <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" />
     <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.6.0" />
     <PackageReference Include="Scrutor" Version="3.1.0" />
     <PackageReference Include="Scrutor" Version="3.1.0" />

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

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace TEAMModelOS.Service.Models.Core
+{
+   public class ClassroomStudent
+    {
+        public string id { get; set; }
+        public string classroomCode { get; set; }
+        public string TEAMModelId { get; set; }
+        public string schoolCode { get; set; }
+        public string periodCode { get; set; }
+        public string gradeCode { get; set; }
+    }
+}

+ 48 - 9
TEAMModelOS.Service/Models/Core/Student.cs

@@ -8,17 +8,56 @@ namespace TEAMModelOS.Service.Models.Core
 {
 {
     public class Student
     public class Student
     {
     {
-        [JsonProperty(PropertyName = "id")]
         public string id { get; set; }
         public string id { get; set; }
-        public string studentId { get; set; }
-        //  public string Password { get; set; }
-        public string password { get; set; }
+        /// <summary>
+        /// 0 动态id  透過第三方申請,未認證手機號,TEAMModelId暫時為virtualId但是不顯示在介面上,當使用者驗證手機號後TEAMModelId會變為手機號。
+        /// 1 动态id  透過手機號申請,TEAMModelId為手機號
+        /// 2 學生ID,透過學校建立,TEAMModelId格式為 {學校簡碼}#{學號}
+        /// </summary>
+        public int  type { get; set; }
         public string name { get; set; }
         public string name { get; set; }
-        public int seatNo { get; set; }
-        public string classroomCode { get; set; }
-        public string gradeCode { get; set; }
-        public string periodCode { get; set; }
+        public string email { get; set; }
+        public string cellphone { get; set; }
+        public string countryCode { get; set; }
+        public string verifyFlg { get; set; }
+        public string status { get; set; }
+        public string createDate { get; set; }
+        public string studentId { get; set; }
+        public Password password { get; set; }
+        public string exValue { get; set; }
+        public string product { get; set; }
+        public List<ProductToken> productToken { get; set; }
+        /// <summary>
+        ///   0 1 dynamic   1学校id
+        /// </summary>
         [PartitionKey]
         [PartitionKey]
-        public string schoolCode { get; set; }
+        public string schoolCode { get; set; }  ///
+        public string shortCode { get; set; }
+        public string profilePicture { get; set; }
+        public string profilePictureUrl { get; set; }
+        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 class Password {
+    public string value { get; set; }
+    public bool isSet { get; set; }
+    public bool isReset { get; set; }
+}
+public class ProductToken
+{
+    public string station { get; set; }
+    public string url { get; set; }
+    public string licenseStatus { get; set; }
+    public int exp { get; set; }
+    public string memberId { get; set; }
+}
+public class Oauth
+{
+    public string provider { get; set; }
+    public string openId { get; set; }
+}

+ 8 - 8
TEAMModelOS.Service/Models/Syllabus/KnowledgeBlock.cs

@@ -18,31 +18,31 @@ namespace TEAMModelOS.Service.Models.Syllabus
         /// 名称
         /// 名称
         /// </summary>
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [Required(ErrorMessage = "{0} 必须填写")]
-        public string Name { get; set; }
+        public string name { get; set; }
         /// <summary>
         /// <summary>
         /// 描述
         /// 描述
         /// </summary>
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [Required(ErrorMessage = "{0} 必须填写")]
-        public string Alias { get; set; }
+        public string alias { get; set; }
         /// <summary>
         /// <summary>
         /// 学科
         /// 学科
         /// </summary>
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [Required(ErrorMessage = "{0} 必须填写")]
-        public string SubjectCode { get; set; }
+        public string subjectCode { get; set; }
         /// <summary>
         /// <summary>
         /// 学校编码
         /// 学校编码
         /// </summary>
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [Required(ErrorMessage = "{0} 必须填写")]
         [PartitionKey]
         [PartitionKey]
-        public string SchoolCode { get; set; }
+        public string schoolCode { get; set; }
         [Required(ErrorMessage = "{0} 必须填写")]
         [Required(ErrorMessage = "{0} 必须填写")]
-        public int Order { get; set; }
+        public int order { get; set; }
         /// <summary>
         /// <summary>
         /// 删除状态0 删除 1 有效
         /// 删除状态0 删除 1 有效
         /// </summary>
         /// </summary>
         [Required(ErrorMessage = "{0} 必须填写")]
         [Required(ErrorMessage = "{0} 必须填写")]
-        public int Status { get; set; } = 1;
-    }
+        public int status { get; set; } = 1;
 
 
-    
+        public List<KnowledgePoint> points { get; set; }
+    }
 }
 }

+ 6 - 4
TEAMModelOS/Controllers/Core/StudentController.cs

@@ -9,6 +9,8 @@ using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
 using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
 using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Helper.Common.CollectionHelper;
 using TEAMModelOS.SDK.Module.AzureCosmosDB.Interfaces;
 using TEAMModelOS.SDK.Module.AzureCosmosDB.Interfaces;
+using System.Text.Json;
+using TEAMModelOS.Models;
 
 
 namespace TEAMModelOS.Controllers.Syllabus
 namespace TEAMModelOS.Controllers.Syllabus
 {
 {
@@ -48,7 +50,7 @@ namespace TEAMModelOS.Controllers.Syllabus
             }
             }
         }
         }
         [HttpPost("SaveAllStudent")]
         [HttpPost("SaveAllStudent")]
-        public async Task<BaseJosnRPCResponse> SaveAllStudentInfo(JosnRPCRequest<List<Student>> request)
+        public async Task<BaseJosnRPCResponse> SaveAllStudentInfo(JosnRPCRequest<List<StudentDto>> request)
         {
         {
             JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
             JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
             Dictionary<string, List<Student>> dictInfo = new Dictionary<string, List<Student>>();
             Dictionary<string, List<Student>> dictInfo = new Dictionary<string, List<Student>>();
@@ -59,13 +61,13 @@ namespace TEAMModelOS.Controllers.Syllabus
             List<Student> studentInfos = new List<Student>();
             List<Student> studentInfos = new List<Student>();
             foreach (string key in dictInfo.Keys)
             foreach (string key in dictInfo.Keys)
             {
             {
-                List<Classroom> classroom = await azureCosmosDBRepository.FindByParams<Classroom>(new Dictionary<string, object> { { "ClassroomCode", key } });
+                List<Classroom> classroom = await azureCosmosDBRepository.FindByParams<Classroom>(new Dictionary<string, object> { { "classroomCode", key } });
                 if (classroom.IsNotEmpty())
                 if (classroom.IsNotEmpty())
                 {
                 {
                     dictInfo.TryGetValue(key, out List<Student> sts);
                     dictInfo.TryGetValue(key, out List<Student> sts);
                     sts.ForEach(x => {
                     sts.ForEach(x => {
-                        x.gradeCode = classroom[0].gradeCode;
-                        x.periodCode = classroom[0].periodCode;
+                       // x.gradeCode = classroom[0].gradeCode;
+                       // x.periodCode = classroom[0].periodCode;
                         x.schoolCode = classroom[0].schoolCode;
                         x.schoolCode = classroom[0].schoolCode;
                         x.id = x.studentId;
                         x.id = x.studentId;
                     });
                     });

+ 4 - 29
TEAMModelOS/JsonFile/Core/lang.json

@@ -1,32 +1,7 @@
 [
 [
   {
   {
-    "code": "zh-CN",
-    "name": "中国大陆",
-    "lang": "简体中文"
-  },
-  {
-    "code": "zh-HK",
-    "name": "中國香港",
-    "lang": "繁體中文"
-  },
-  {
-    "code": "zh-MO",
-    "name": "中國澳門",
-    "lang": "繁體中文"
-  },
-  {
-    "code": "zh-TW",
-    "name": "中國台灣",
-    "lang": "繁體中文"
-  },
-  {
-    "code": "en-US",
-    "name": "United States",
-    "lang": "English"
-  },
-  {
-    "code": "en-UK",
-    "name": "United Kingdom",
-    "lang": "English"
-  }
+    
+      "name": "aaa",
+      "class": "clas1"
+    }
 ]
 ]

+ 13 - 0
TEAMModelOS/Models/StudentDto.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TEAMModelOS.Service.Models.Core;
+
+namespace TEAMModelOS.Models
+{
+    public class StudentDto : Student
+    {
+        public string classroomCode { get; set; }
+    }
+}