Jelajahi Sumber

合并数据结构

CrazyIter_Bin 3 tahun lalu
induk
melakukan
39710db225

+ 7 - 7
TEAMModelOS.SDK/Models/Service/FixDataService.cs

@@ -30,7 +30,7 @@ namespace TEAMModelOS.SDK.Models.Service
             var dict = data.GetProperty("dict").ToObject<Dictionary<string, object>>();
             var dict = data.GetProperty("dict").ToObject<Dictionary<string, object>>();
             string queryText = $"SELECT VALUE c FROM c WHERE c.id IN ({string.Join(",", ids.Select(o => $"'{o}'"))})";
             string queryText = $"SELECT VALUE c FROM c WHERE c.id IN ({string.Join(",", ids.Select(o => $"'{o}'"))})";
             List<Student> students = new List<Student>();
             List<Student> students = new List<Student>();
-            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student")
+            await foreach (var item in client.GetContainer("TEAMModelOS", "Student")
                             .GetItemQueryIterator<Student>(
                             .GetItemQueryIterator<Student>(
                                 queryText: queryText,
                                 queryText: queryText,
                                 requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{code}") })) {
                                 requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{code}") })) {
@@ -53,7 +53,7 @@ namespace TEAMModelOS.SDK.Models.Service
                         default:
                         default:
                             break;
                             break;
                     }
                     }
-                  await  client.GetContainer(Constant.TEAMModelOS, "Student").ReplaceItemAsync<Student>(item, item.id, new PartitionKey(item.code));
+                  await  client.GetContainer("TEAMModelOS", "Student").ReplaceItemAsync<Student>(item, item.id, new PartitionKey(item.code));
                     students.Add(item);
                     students.Add(item);
                 }
                 }
             }
             }
@@ -79,7 +79,7 @@ namespace TEAMModelOS.SDK.Models.Service
                 }
                 }
             }
             }
             List<School> schools = new List<School>();
             List<School> schools = new List<School>();
-            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") })) {
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") })) {
                 schools.Add(item);
                 schools.Add(item);
             }
             }
             foreach (var school in schools) {
             foreach (var school in schools) {
@@ -95,11 +95,11 @@ namespace TEAMModelOS.SDK.Models.Service
                 tb = "School";
                 tb = "School";
             }
             }
             List<string> ids = new List<string>();
             List<string> ids = new List<string>();
-            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, tb).GetItemQueryIterator<Bloblog>(queryDefinition: new QueryDefinition("select c.id from c "), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
+            await foreach (var item in client.GetContainer("TEAMModelOS", tb).GetItemQueryIterator<Bloblog>(queryDefinition: new QueryDefinition("select c.id from c "), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
             {
             {
                 ids.Add(item.id);
                 ids.Add(item.id);
             }
             }
-            await client.GetContainer(Constant.TEAMModelOS, tb).DeleteItemsStreamAsync(ids, $"Bloblog-{name}");
+            await client.GetContainer("TEAMModelOS", tb).DeleteItemsStreamAsync(ids, $"Bloblog-{name}");
             long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             foreach (var prefix in prefixs)
             foreach (var prefix in prefixs)
             {
             {
@@ -123,7 +123,7 @@ namespace TEAMModelOS.SDK.Models.Service
                                 url += ".HTEX";
                                 url += ".HTEX";
                             }
                             }
                             Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = url, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
                             Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = url, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
-                            await client.GetContainer(Constant.TEAMModelOS, tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
+                            await client.GetContainer("TEAMModelOS", tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
                         }
                         }
                     }
                     }
                 }
                 }
@@ -136,7 +136,7 @@ namespace TEAMModelOS.SDK.Models.Service
                         {
                         {
                             var urlsSize = await ContainerClient.GetBlobsSize(item);
                             var urlsSize = await ContainerClient.GetBlobsSize(item);
                             Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = item, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
                             Bloblog bloblog = new Bloblog { id = Guid.NewGuid().ToString(), code = $"Bloblog-{name}", pk = "Bloblog", time = now, url = item, size = urlsSize != null && urlsSize.HasValue ? urlsSize.Value : 0, type = prefix };
-                            await client.GetContainer(Constant.TEAMModelOS, tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
+                            await client.GetContainer("TEAMModelOS", tb).UpsertItemAsync(bloblog, new Azure.Cosmos.PartitionKey(bloblog.code));
                         }
                         }
                     }
                     }
                 }
                 }

+ 14 - 14
TEAMModelOS.SDK/Models/Service/StuListService.cs

@@ -27,14 +27,14 @@ namespace TEAMModelFunction
                     //$"and A1 in('{stuListChange.listid}') ";
                     //$"and A1 in('{stuListChange.listid}') ";
                 List<MQActivity> datas = new List<MQActivity>();
                 List<MQActivity> datas = new List<MQActivity>();
                 if (stuListChange.scope.Equals("school", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(stuListChange.school)) {
                 if (stuListChange.scope.Equals("school", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrEmpty(stuListChange.school)) {
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(queryText: query,
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<MQActivity>(queryText: query,
                        requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{type}-{stuListChange.school}") }))
                        requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{type}-{stuListChange.school}") }))
                     {
                     {
                         datas.Add(item);
                         datas.Add(item);
                     }
                     }
                     ///还要处理该学校每个老师发布的班级的
                     ///还要处理该学校每个老师发布的班级的
                     List<SchoolTeacher> teachers = new List<SchoolTeacher>();
                     List<SchoolTeacher> teachers = new List<SchoolTeacher>();
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<SchoolTeacher>(queryText: $"SELECT c.id, c.name FROM c",
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<SchoolTeacher>(queryText: $"SELECT c.id, c.name FROM c",
                         requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{stuListChange.school}") }))
                         requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{stuListChange.school}") }))
                     {
                     {
                         teachers.Add(item);
                         teachers.Add(item);
@@ -44,7 +44,7 @@ namespace TEAMModelFunction
                             $" where c.school='{stuListChange.school}'   and   c.pk='{type}'" +
                             $" where c.school='{stuListChange.school}'   and   c.pk='{type}'" +
                             $" and (( array_contains(c.classes,'{stuListChange.listid}')) or ( array_contains(c.teachclasses,'{stuListChange.listid}')))";
                             $" and (( array_contains(c.classes,'{stuListChange.listid}')) or ( array_contains(c.teachclasses,'{stuListChange.listid}')))";
                       //  $" and A1 in('{stuListChange.listid}') ";
                       //  $" and A1 in('{stuListChange.listid}') ";
-                        await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(queryText: queryTech,
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<MQActivity>(queryText: queryTech,
                             requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{type}-{techer.id}") }))
                             requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{type}-{techer.id}") }))
                         {
                         {
                             datas.Add(item);
                             datas.Add(item);
@@ -53,7 +53,7 @@ namespace TEAMModelFunction
                 }
                 }
                 if (stuListChange.scope.Equals("private", StringComparison.OrdinalIgnoreCase)&&!string.IsNullOrEmpty(stuListChange.creatorId))
                 if (stuListChange.scope.Equals("private", StringComparison.OrdinalIgnoreCase)&&!string.IsNullOrEmpty(stuListChange.creatorId))
                 {
                 {
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(queryText: query,
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<MQActivity>(queryText: query,
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{type}-{stuListChange.creatorId}") }))
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"{type}-{stuListChange.creatorId}") }))
                     {
                     {
                         datas.Add(item);
                         datas.Add(item);
@@ -92,7 +92,7 @@ namespace TEAMModelFunction
                             classIds = classes
                             classIds = classes
                         };
                         };
                         await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                         await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                        await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }//tmd新加入的
                     }//tmd新加入的
                     foreach (string tmdid in stuListChange.tmdjoin)
                     foreach (string tmdid in stuListChange.tmdjoin)
                     {
                     {
@@ -117,14 +117,14 @@ namespace TEAMModelFunction
                             classIds = classes
                             classIds = classes
                         }; 
                         }; 
                         await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                         await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixActivity\n名单发生变更 新建活动中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                        await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }
                     }
                     foreach (Students students in stuListChange.stuleave)
                     foreach (Students students in stuListChange.stuleave)
                     {
                     {
                         try
                         try
                         {
                         {
 
 
-                            await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemAsync<StuActivity>(activity.id, new PartitionKey($"Activity-{students.code.Replace("Base-", "")}-{students.id}"));
+                            await client.GetContainer("TEAMModelOS", "Teacher").DeleteItemAsync<StuActivity>(activity.id, new PartitionKey($"Activity-{students.code.Replace("Base-", "")}-{students.id}"));
                         }
                         }
                         catch (CosmosException ex)
                         catch (CosmosException ex)
                         {
                         {
@@ -136,7 +136,7 @@ namespace TEAMModelFunction
                         try
                         try
                         {
                         {
 
 
-                            await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemAsync<StuActivity>(activity.id, new PartitionKey($"Activity-{tmdid}"));
+                            await client.GetContainer("TEAMModelOS", "Teacher").DeleteItemAsync<StuActivity>(activity.id, new PartitionKey($"Activity-{tmdid}"));
                         }
                         }
                         catch(CosmosException ex )
                         catch(CosmosException ex )
                         {
                         {
@@ -157,7 +157,7 @@ namespace TEAMModelFunction
             List<Course> courses = new List<Course>();
             List<Course> courses = new List<Course>();
             if (stuListChange.scope.Equals("school") && !string.IsNullOrEmpty(stuListChange.school))
             if (stuListChange.scope.Equals("school") && !string.IsNullOrEmpty(stuListChange.school))
             {
             {
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Course>(queryText: query,
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<Course>(queryText: query,
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{stuListChange.school}") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{stuListChange.school}") }))
                 {
                 {
                     courses.Add(item);
                     courses.Add(item);
@@ -165,7 +165,7 @@ namespace TEAMModelFunction
             }
             }
             if (stuListChange.scope.Equals("private") && !string.IsNullOrEmpty(stuListChange.creatorId))
             if (stuListChange.scope.Equals("private") && !string.IsNullOrEmpty(stuListChange.creatorId))
             {
             {
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<Course>(queryText: query,
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Course>(queryText: query,
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{stuListChange.creatorId}") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{stuListChange.creatorId}") }))
                 {
                 {
                     courses.Add(item);
                     courses.Add(item);
@@ -192,7 +192,7 @@ namespace TEAMModelFunction
                         createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                         createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                     };
                     };
                     await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixStuCourse\n名单发生变更 新建课程中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                     await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixStuCourse\n名单发生变更 新建课程中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
-                    await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                    await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                 }
                 }
                 //tmd新加入的
                 //tmd新加入的
                 foreach (string tmdid in stuListChange.tmdjoin)
                 foreach (string tmdid in stuListChange.tmdjoin)
@@ -211,16 +211,16 @@ namespace TEAMModelFunction
                         createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                         createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
                     };
                     };
                     await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixStuCourse\n名单发生变更 新建课程中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                     await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-StuListService-FixStuCourse\n名单发生变更 新建课程中间表\n{stucourse.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
-                    await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                    await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                 }
                 }
                 //移除名单的。 在点击相关的课程,再去二次校验是否存在,不存在则再去删除。
                 //移除名单的。 在点击相关的课程,再去二次校验是否存在,不存在则再去删除。
                 foreach (var delStu in stuListChange.stuleave)
                 foreach (var delStu in stuListChange.stuleave)
                 {
                 {
-                    await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemStreamAsync(course.id, new PartitionKey($"StuCourse-{delStu.code.Replace("Base-", "")}-{delStu.id}"));
+                    await client.GetContainer("TEAMModelOS", "Student").DeleteItemStreamAsync(course.id, new PartitionKey($"Course-{delStu.code.Replace("Base-", "")}-{delStu.id}"));
                 }
                 }
                 foreach (var delTmd in stuListChange.tmdhleave)
                 foreach (var delTmd in stuListChange.tmdhleave)
                 {
                 {
-                    await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemStreamAsync(course.id, new PartitionKey($"StuCourse-{delTmd}"));
+                    await client.GetContainer("TEAMModelOS", "Teacher").DeleteItemStreamAsync(course.id, new PartitionKey($"Course-{delTmd}"));
                 }
                 }
             }
             }
         }
         }

+ 19 - 19
TEAMModelOS.SDK/Models/Service/TriggerStuActivity.cs

@@ -24,7 +24,7 @@ namespace TEAMModelFunction
             MQActivity activity = null;
             MQActivity activity = null;
             try
             try
             {
             {
-                var aactivity = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync(id, new Azure.Cosmos.PartitionKey(code));
+                var aactivity = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id, new Azure.Cosmos.PartitionKey(code));
                 using var da = await JsonDocument.ParseAsync(aactivity.ContentStream);
                 using var da = await JsonDocument.ParseAsync(aactivity.ContentStream);
                 activity = da.ToObject<MQActivity>();
                 activity = da.ToObject<MQActivity>();
             }
             }
@@ -59,7 +59,7 @@ namespace TEAMModelFunction
                             taskStatus = -1,
                             taskStatus = -1,
                             classIds = classes
                             classIds = classes
                         };
                         };
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                        await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }
                     }
                 }
                 }
                 if (students.IsNotEmpty())
                 if (students.IsNotEmpty())
@@ -86,7 +86,7 @@ namespace TEAMModelFunction
                             taskStatus = -1,
                             taskStatus = -1,
                             classIds = classes
                             classIds = classes
                         };
                         };
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
+                        await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stucourse, new PartitionKey(stucourse.code));
                     }
                     }
                 }
                 }
             }
             }
@@ -98,14 +98,14 @@ namespace TEAMModelFunction
                 {
                 {
                     foreach (var x in stuActivities)
                     foreach (var x in stuActivities)
                     {
                     {
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code));
+                        await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(x, new PartitionKey(x.code));
                     }
                     }
                 }
                 }
                 if (tmdActivities.IsNotEmpty())
                 if (tmdActivities.IsNotEmpty())
                 {
                 {
                     foreach (var x in tmdActivities)
                     foreach (var x in tmdActivities)
                     {
                     {
-                        await client.GetContainer(Constant.TEAMModelOS, "Student").UpsertItemAsync(x, new PartitionKey(x.code));
+                        await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(x, new PartitionKey(x.code));
                     }
                     }
                 }
                 }
             } catch (Exception ex) {
             } catch (Exception ex) {
@@ -131,13 +131,13 @@ namespace TEAMModelFunction
                     string sql = string.Join(" , ", sqlList);
                     string sql = string.Join(" , ", sqlList);
                     if (!string.IsNullOrEmpty(school))
                     if (!string.IsNullOrEmpty(school))
                     {
                     {
-                        await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name ,c.periodId,c.year from c where c.id in ({sql})",
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name ,c.periodId,c.year from c where c.id in ({sql})",
                            requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Class-{school}") }))
                            requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Class-{school}") }))
                         {
                         {
 
 
                             classInfos.Add(item);
                             classInfos.Add(item);
                         }
                         }
-                        await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
                           requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                           requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                         {
                         {
                             //item.from = "SchStuList";
                             //item.from = "SchStuList";
@@ -145,7 +145,7 @@ namespace TEAMModelFunction
                         }
                         }
                     }
                     }
                     List<StuList> tchLists = new List<StuList>();
                     List<StuList> tchLists = new List<StuList>();
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<ClassInfo>(queryText: $"select c.id,c.name from c where c.id in ({sql})",
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
                     {
                     {
                        // item.from = "TchStuList";
                        // item.from = "TchStuList";
@@ -180,19 +180,19 @@ namespace TEAMModelFunction
                 List<Student> students = new List<Student>();
                 List<Student> students = new List<Student>();
                 if (!string.IsNullOrEmpty(school))
                 if (!string.IsNullOrEmpty(school))
                 {
                 {
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                     {
                     {
                         schList.Add(item);
                         schList.Add(item);
                     }
                     }
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<Student>(queryText: $"select value(c) from c where c.classId in ({sql})",
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<Student>(queryText: $"select value(c) from c where c.classId in ({sql})",
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{school}") }))
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{school}") }))
                     {
                     {
                         students.Add(item);
                         students.Add(item);
                     }
                     }
                 }
                 }
                 List<StuList> tchLists = new List<StuList>();
                 List<StuList> tchLists = new List<StuList>();
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
                 {
                 {
                     tchLists.Add(item);
                     tchLists.Add(item);
@@ -230,7 +230,7 @@ namespace TEAMModelFunction
                     tmdids.ForEach(x => { inids.Add($"'{x}'"); });
                     tmdids.ForEach(x => { inids.Add($"'{x}'"); });
                     var insql = string.Join(",", inids);
                     var insql = string.Join(",", inids);
                     var queryslt = $"SELECT  value(c) FROM c where c.id in ({insql})";
                     var queryslt = $"SELECT  value(c) FROM c where c.id in ({insql})";
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<TmdInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<TmdInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
                     {
                     {
                         infos.Add(item);
                         infos.Add(item);
                     }
                     }
@@ -245,7 +245,7 @@ namespace TEAMModelFunction
                         PartitionKey partitionKey = new PartitionKey($"Base-{gp.key.Replace("Base-", "")}");
                         PartitionKey partitionKey = new PartitionKey($"Base-{gp.key.Replace("Base-", "")}");
                         var insqlstu = string.Join(",", inidstus);
                         var insqlstu = string.Join(",", inidstus);
                         var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id in ({insqlstu})";
                         var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id in ({insqlstu})";
-                        await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey= partitionKey }))
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey= partitionKey }))
                         {
                         {
                             stuInfos.Add(item);
                             stuInfos.Add(item);
                         }
                         }
@@ -347,19 +347,19 @@ namespace TEAMModelFunction
                 List<StuList> schList = new List<StuList>();
                 List<StuList> schList = new List<StuList>();
                 List<Student> students = new List<Student>();
                 List<Student> students = new List<Student>();
                 if (!string.IsNullOrEmpty(school)) {
                 if (!string.IsNullOrEmpty(school)) {
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList-{school}") }))
                     {
                     {
                         schList.Add(item);
                         schList.Add(item);
                     }
                     }
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<Student>(queryText: $"select value(c) from c where c.classId in ({sql})",
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<Student>(queryText: $"select value(c) from c where c.classId in ({sql})",
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{school}") }))
                         requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Base-{school}") }))
                     {
                     {
                         students.Add(item);
                         students.Add(item);
                     }
                     }
                 }
                 }
                 List<StuList> tchLists = new List<StuList>();
                 List<StuList> tchLists = new List<StuList>();
-                await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<StuList>(queryText: $"select value(c) from c where c.id in ({sql})",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"StuList") }))
                 {
                 {
                     tchLists.Add(item);
                     tchLists.Add(item);
@@ -394,7 +394,7 @@ namespace TEAMModelFunction
                     tmdids.ForEach(x => { inids.Add($"'{x}'"); });
                     tmdids.ForEach(x => { inids.Add($"'{x}'"); });
                     var insql = string.Join(",", inids);
                     var insql = string.Join(",", inids);
                     var queryslt = $"SELECT  value(c) FROM c where c.id in ({insql})";
                     var queryslt = $"SELECT  value(c) FROM c where c.id in ({insql})";
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<TmdInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<TmdInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base") }))
                     {
                     {
                         infos.Add(item);
                         infos.Add(item);
                     }
                     }
@@ -404,7 +404,7 @@ namespace TEAMModelFunction
                     List<string> inidstus = new List<string>();
                     List<string> inidstus = new List<string>();
                     foreach (Students stu in studentss) {
                     foreach (Students stu in studentss) {
                         var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id = '{stu.id}'";
                         var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id = '{stu.id}'";
-                        await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{stu.code}") }))
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{stu.code}") }))
                         {
                         {
                             stuInfos.Add(item);
                             stuInfos.Add(item);
                         }
                         }
@@ -412,7 +412,7 @@ namespace TEAMModelFunction
                     /*studentss.Select(x => x.id).ToList().ForEach(x => { inidstus.Add($"'{x}'"); });
                     /*studentss.Select(x => x.id).ToList().ForEach(x => { inidstus.Add($"'{x}'"); });
                     var insqlstu = string.Join(",", inidstus);
                     var insqlstu = string.Join(",", inidstus);
                     var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id in ({insqlstu})";
                     var querystu = $"SELECT  c.id,c.code,c.name,c.picture,c.classId,c.year,c.schoolId FROM c where c.id in ({insqlstu})";
-                    await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{school}") }))
+                    await foreach (var item in client.GetContainer("TEAMModelOS", "Student").GetItemQueryIterator<StuInfo>(queryText: querystu, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{school}") }))
                     {
                     {
                         stuInfos.Add(item);
                         stuInfos.Add(item);
                     }*/
                     }*/