Browse Source

返回irs

CrazyIter_Bin 3 years ago
parent
commit
20c06e4fe0

+ 16 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/Bloblog.cs

@@ -22,4 +22,20 @@ namespace TEAMModelOS.SDK.Models
         public string type { get; set; }
 
     }
+    public class BlobInfo : CosmosEntity
+    {
+        public string name { get; set; }
+        public string url { get; set; }
+        public string md5 { get; set; }
+        public long time { get; set; }
+        public long size { get; set; }
+        public List<string> periodId { get; set; } = new List<string>() { "" };
+        public List<string> subjectId { get; set; } = new List<string>() { "" };
+        public List<string> gradeId { get; set; } = new List<string>() { "" };
+        /// <summary>
+        /// audio 音频,video 视频 ,doc文档,image图片,other 其他,res教材,thum缩略图,avatar 头像
+        /// </summary>
+        public string type { get; set; }
+
+    }
 }

+ 16 - 10
TEAMModelOS/Controllers/School/StudentController.cs

@@ -274,7 +274,7 @@ namespace TEAMModelOS.Controllers
                         {
                             Student student = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
                                 .ReadItemAsync<Student>($"{__studentId}", new PartitionKey($"Base-{schoolId}"));
-                            return Ok(new { student.mail, student.mobile, student.name, student.picture, student.gender, student.id, student.schoolId, student.year, student.no, student.classId, student.periodId });
+                            return Ok(new { student.mail, student.mobile, student.name, student.picture, student.gender, student.id, student.schoolId, student.year, student.no, student.classId, student.periodId,irs=student.irs });
                         }
                         else
                         {
@@ -1430,10 +1430,10 @@ namespace TEAMModelOS.Controllers
             {
                 //TODO : 進階查詢選項調整、部分地方可用並行處理
                 //以學校學生角度去抓資料
-                Dictionary<string, List<(string id, string name, string pic, int year, string no, string periodId)>> dicClassStuds = new Dictionary<string, List<(string id, string name, string pic, int year, string no, string periodId)>>();
-                List<(string id, string name, string pic, int year, string no, string periodId)> notJoinClassStuds = new List<(string id, string name, string pic, int year, string no, string periodId)>();
+                Dictionary<string, List<(string id, string name, string pic, int year, string no, string periodId,string irs)>> dicClassStuds = new Dictionary<string, List<(string id, string name, string pic, int year, string no, string periodId,string irs )>>();
+                List<(string id, string name, string pic, int year, string no, string periodId,string irs)> notJoinClassStuds = new List<(string id, string name, string pic, int year, string no, string periodId,string irs)>();
 
-                string queryText = $"SELECT c.id, c.name, c.picture, c.year, c.classId, c.no ,c.periodId FROM c WHERE c.code = 'Base-{schoolId}'";
+                string queryText = $"SELECT c.id, c.name, c.picture, c.year, c.classId, c.no,c.irs ,c.periodId FROM c WHERE c.code = 'Base-{schoolId}'";
 
                 //回傳用ContinuationToken
                 string continuationToken = string.Empty;
@@ -1458,6 +1458,7 @@ namespace TEAMModelOS.Controllers
                             JsonElement acc = accounts.Current;
 
                             string classId = acc.GetProperty("classId").GetString();
+                             acc.TryGetProperty("irs",out JsonElement irs);
 
                             if (string.IsNullOrWhiteSpace(classId))
                             {
@@ -1467,7 +1468,9 @@ namespace TEAMModelOS.Controllers
                                             acc.GetProperty("name").GetString(),
                                             acc.GetProperty("picture").GetString(),
                                             acc.GetProperty("year").GetInt32(),
-                                            acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null
+                                            acc.GetProperty("no").GetString(), 
+                                            acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
+                                            $"{irs}"
                                         )
                                     );
                             }
@@ -1481,21 +1484,22 @@ namespace TEAMModelOS.Controllers
                                                 acc.GetProperty("name").GetString(),
                                                 acc.GetProperty("picture").GetString(),
                                                 acc.GetProperty("year").GetInt32(),
-                                                acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null
+                                                acc.GetProperty("no").GetString(), acc.TryGetProperty("periodId", out JsonElement _periodId) && _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,
+                                                $"{irs}"
                                             )
                                         );
                                 }
                                 else
                                 {
                                     dicClassStuds.Add(classId,
-                                            new List<(string id, string name, string pic, int year, string no, string periodId)>()
+                                            new List<(string id, string name, string pic, int year, string no, string periodId,string irs)>()
                                             {
                                             (
                                                 acc.GetProperty("id").GetString(),
                                                 acc.GetProperty("name").GetString(),
                                                 acc.GetProperty("picture").GetString(),
                                                 acc.GetProperty("year").GetInt32(),
-                                                acc.GetProperty("no").GetString(),  acc.TryGetProperty("periodId",out JsonElement _periodId)&&  _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null
+                                                acc.GetProperty("no").GetString(),  acc.TryGetProperty("periodId",out JsonElement _periodId)&&  _periodId.ValueKind.Equals(JsonValueKind.String) ? _periodId.GetString() : null,$"{irs}"
                                             )
                                             }
                                         );
@@ -1544,7 +1548,8 @@ namespace TEAMModelOS.Controllers
                                          className,
                                          gradeId,
                                          periodId = string.IsNullOrEmpty(periodId) ? o.periodId : periodId,
-                                         classYear
+                                         classYear,
+                                         irs=o.irs
 
                                      });
                     ret.AddRange(tmp);
@@ -1564,7 +1569,8 @@ namespace TEAMModelOS.Controllers
                         className = (string)null,
                         gradeId = (string)null,
                         o.periodId,
-                        classYear = -1
+                        classYear = -1,
+                        irs = o.irs
                     }));
 
                 return ret;