瀏覽代碼

TeacherWork修改为Homework

CrazyIter_Bin 3 年之前
父節點
當前提交
a538325101

+ 1 - 1
TEAMModelFunction/MonitorCosmosDB.cs

@@ -109,7 +109,7 @@ namespace TEAMModelFunction
                                 case "Study":
                                     TriggerStudy.Trigger(_serviceBus, _azureStorage, _dingDing, client, input, data, _azureRedis);
                                     break;
-                                case "TeacherWork":
+                                case "Homework":
                                     TriggerWork.Trigger(_serviceBus, _azureStorage, _dingDing, client, input, data, _azureRedis);
                                     break;
 

+ 2 - 2
TEAMModelFunction/TriggerWork.cs

@@ -36,7 +36,7 @@ namespace TEAMModelFunction
                     blobcntr = tdata.creatorId;
                 }
                 await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}研修作业活动【{tdata.name}-{tdata.id}-ttl={tdata.ttl}】正在操作", GroupNames.成都开发測試群組);
-                TeacherWork work = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<TeacherWork>(input.Id, new Azure.Cosmos.PartitionKey($"{tdata.code}"));
+                Homework work = await client.GetContainer("TEAMModelOS", "Common").ReadItemAsync<Homework>(input.Id, new Azure.Cosmos.PartitionKey($"{tdata.code}"));
                 //List<ChangeRecord> voteRecords = await _azureStorage.FindListByDict<ChangeRecord>(new Dictionary<string, object>() { { "RowKey", input.Id }, { "PartitionKey", vote.progress } });
                 if (work != null)
                 {
@@ -52,7 +52,7 @@ namespace TEAMModelFunction
                                 pk = "Activity",
                                 id = work.id,
                                 code = $"Activity-{x.id}",
-                                type = "TeacherWork",
+                                type = "Homework",
                                 name = work.name,
                                 startTime = work.startTime,
                                 endTime = work.endTime,

+ 76 - 47
TEAMModelOS.SDK/Models/Cosmos/Common/Homework.cs

@@ -2,80 +2,109 @@ using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
 using System.Text;
-
+using System.Text.Json;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
 
 namespace TEAMModelOS.SDK.Models
 {
     /// <summary>
-    /// 作业
+    /// 教师作业活动
     /// </summary>    
-    public class Homework:CosmosEntity
-    {        
-        public Homework()
-        {
-           
-
-            resource = new List<ProcessRes>();
-        }   
+    public class Homework : CosmosEntity
+    {
+        public Homework() {
+            pk = "Homework";//
+            classes = new List<string>();
+            stuLists = new List<string>();
+            tchLists = new List<string>();
+        }
+        /// <summary> 
+        ///发布层级 类型 school  teacher
+        /// </summary>
 
+        /// <summary>
+        /// 学校编码或教室tmdid
+        /// </summary>
+        [Required(ErrorMessage = "owner 必须设置")]
+        public string owner { get; set; }
+      
+        public string school { get; set; }
         /// <summary>
         /// 作业名称
         /// </summary>
+        [Required(ErrorMessage = "name 必须设置")]
         public string name { get; set; }
-
-       
-
         /// <summary>
-        /// 发布模式 0 立即发布 1 定时
+        ///  作业内容
         /// </summary>
-        public string publishModel { get; set; }
-
+        public string description { get; set; }
         /// <summary>
-        /// 开始时间
+        /// 创建者的id 
         /// </summary>
-        public long startTime { get; set; }
-
+        [Required(ErrorMessage = "creatorId 必须设置")]
+        public string creatorId { get; set; }
+        // public int year { get; set; }
         /// <summary>
-        /// 结束时间
+        /// pending 待发布|going 已发布|finish 已结束
         /// </summary>
-        public long endTime { get; set; }
-        //记录ServiceBus每条消息的编号
-
-        public long sequenceNumber { get; set; }
-
-
-
-
+        //[Required(ErrorMessage = "progress 必须设置")]
+        public string progress { get; set; }
+        public string scope { get; set; }
 
+        //public List<string> tmdids { get; set; } = new List<string>();
         /// <summary>
-        /// 作业描述
+        ///  行政班  
         /// </summary>
-        public string description { get; set; }
-
-  
+        public List<string> classes { get; set; } = new List<string>();
         /// <summary>
-        /// 作业附件
+        /// 学生名单(包含自定义个人学生名单,学校教学班)
         /// </summary>
-        public List<ProcessRes> resource { get; set; }
-
-
+        public List<string> stuLists { get; set; } = new List<string>();
         /// <summary>
-        /// 状态 (100:待发布 200:已发布 300:已结束)
+        /// 教研组名单
         /// </summary>
-        public int status { get; set; }
-
-        //public Subdto subdto { get; set; }
-
+        public List<string> tchLists { get; set; } = new List<string>();
         /// <summary>
-        /// 学生 是否互评 是否可见 
+        /// student 学生名单类型    research 教研组名单
         /// </summary>
-        public List<string> other { get; set; }
-        //创建时间 
-        public long createTime { get; set; }
-        
-
+        public string targetType { get; set; }
+        /// <summary>
+        /// 发布对象全部信息。由前端操作,用于前端回显发布对象的格式。
+        /// </summary>
+        public List<JsonElement> targets { get; set; } = new List<JsonElement>();
+        /// <summary>
+        ///class行政班/teach教学班
+        /// </summary>
+        //public string classType { get; set; }
+        /// <summary>
+        /// 开始时间
+        /// </summary>
+        public long startTime { get; set; }
 
+        /// <summary>
+        /// 结束时间
+        /// </summary>
+        public long endTime { get; set; }
+        public long createTime { get; set; } // 作业发布时间
+        /// <summary>
+        /// 更新时间
+        /// </summary>
+        public long updateTime { get; set; }
+        public string  blob { get; set; }
+        /// <summary>
+        /// TTL删除改变状态使用
+        /// </summary>
+        public int? status { get; set; } = 0;
+        public long? size { get; set; } = 0;
+        public string areaId { get; set; }
+        public List<Submits> teachers { get; set; } = new List<Submits>();
+    }
+    public class Submits {
+        public string id { get; set; }
+        //public string name { get; set; }
+        //记录作业上传内容
+        public string hw { get; set; }
+        public long hwTime { get; set; }
     }
 }

+ 0 - 110
TEAMModelOS.SDK/Models/Cosmos/Teacher/TeacherWork.cs

@@ -1,110 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Text;
-using System.Text.Json;
-using TEAMModelOS.SDK.Context.Attributes.Azure;
-
-
-namespace TEAMModelOS.SDK.Models
-{
-    /// <summary>
-    /// 教师作业活动
-    /// </summary>    
-    public class TeacherWork : CosmosEntity
-    {
-        public TeacherWork() {
-            pk = "TeacherWork";
-            classes = new List<string>();
-            stuLists = new List<string>();
-            tchLists = new List<string>();
-        }
-        /// <summary> 
-        ///发布层级 类型 school  teacher
-        /// </summary>
-
-        /// <summary>
-        /// 学校编码或教室tmdid
-        /// </summary>
-        [Required(ErrorMessage = "owner 必须设置")]
-        public string owner { get; set; }
-      
-        public string school { get; set; }
-        /// <summary>
-        /// 作业名称
-        /// </summary>
-        [Required(ErrorMessage = "name 必须设置")]
-        public string name { get; set; }
-        /// <summary>
-        ///  作业内容
-        /// </summary>
-        public string description { get; set; }
-        /// <summary>
-        /// 创建者的id 
-        /// </summary>
-        [Required(ErrorMessage = "creatorId 必须设置")]
-        public string creatorId { get; set; }
-        // public int year { get; set; }
-        /// <summary>
-        /// pending 待发布|going 已发布|finish 已结束
-        /// </summary>
-        //[Required(ErrorMessage = "progress 必须设置")]
-        public string progress { get; set; }
-        public string scope { get; set; }
-
-        //public List<string> tmdids { get; set; } = new List<string>();
-        /// <summary>
-        ///  行政班  
-        /// </summary>
-        public List<string> classes { get; set; } = new List<string>();
-        /// <summary>
-        /// 学生名单(包含自定义个人学生名单,学校教学班)
-        /// </summary>
-        public List<string> stuLists { get; set; } = new List<string>();
-        /// <summary>
-        /// 教研组名单
-        /// </summary>
-        public List<string> tchLists { get; set; } = new List<string>();
-        /// <summary>
-        /// student 学生名单类型    research 教研组名单
-        /// </summary>
-        public string targetType { get; set; }
-        /// <summary>
-        /// 发布对象全部信息。由前端操作,用于前端回显发布对象的格式。
-        /// </summary>
-        public List<JsonElement> targets { get; set; } = new List<JsonElement>();
-        /// <summary>
-        ///class行政班/teach教学班
-        /// </summary>
-        //public string classType { get; set; }
-        /// <summary>
-        /// 开始时间
-        /// </summary>
-        public long startTime { get; set; }
-
-        /// <summary>
-        /// 结束时间
-        /// </summary>
-        public long endTime { get; set; }
-        public long createTime { get; set; } // 作业发布时间
-        /// <summary>
-        /// 更新时间
-        /// </summary>
-        public long updateTime { get; set; }
-        public string  blob { get; set; }
-        /// <summary>
-        /// TTL删除改变状态使用
-        /// </summary>
-        public int? status { get; set; } = 0;
-        public long? size { get; set; } = 0;
-        public string areaId { get; set; }
-        public List<Submits> teachers { get; set; } = new List<Submits>();
-    }
-    public class Submits {
-        public string id { get; set; }
-        //public string name { get; set; }
-        //记录作业上传内容
-        public string hw { get; set; }
-        public long hwTime { get; set; }
-    }
-}

+ 5 - 5
TEAMModelOS.SDK/Models/Service/TeacherWorkService.cs

@@ -1,4 +1,4 @@
-using Azure.Cosmos;
+using Azure.Cosmos;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -7,14 +7,14 @@ using TEAMModelOS.SDK.DI;
 
 namespace TEAMModelOS.SDK.Models.Service
 {
-	public static class TeacherWorkService
+	public static class HomeworkService
 	{
-        public static async Task<string> saveMoreAsync(CosmosClient client, DingDing _dingDing, TeacherWork work)
+        public static async Task<string> saveMoreAsync(CosmosClient client, DingDing _dingDing, Homework work)
         {
             try
             {
                 work.ttl = -1;
-                work.code = "TeacherWork-" + work.school;
+                work.code = "Homework-" + work.school;
                 long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 work.createTime = now;
 
@@ -31,7 +31,7 @@ namespace TEAMModelOS.SDK.Models.Service
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-TeacherWorkService-saveMore\n{e.Message}{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-HomeworkService-saveMore\n{e.Message}{e.StackTrace}", GroupNames.醍摩豆服務運維群組);
                 return "";
 
             }

+ 15 - 15
TEAMModelOS/Controllers/Common/AreaController.cs

@@ -305,16 +305,16 @@ namespace TEAMModelOS.Controllers
                         if (setting.Equals("hw"))
                         {
                             if (!request.TryGetProperty("work", out JsonElement work)) return BadRequest();
-                            TeacherWork teacherWork = work.ToObject<TeacherWork>();
-                            teacherWork.owner = "area";
-                            teacherWork.school = pa.sId;
-                            teacherWork.areaId = id.GetString();
-                            teacherWork.tchLists = pa.gId;
-                            teacherWork.scope = "school";
-                            teacherWork.targetType = "research";
-                            //teacherWork.blob = $"/{teacherWork.areaId}/survey/{study.pId}/index.json";
-                            await getMoreWork(pa, teacherWork);
-                            string workId = await TeacherWorkService.saveMoreAsync(client, _dingDing, teacherWork);
+                            Homework homework = work.ToObject<Homework>();
+                            homework.owner = "area";
+                            homework.school = pa.sId;
+                            homework.areaId = id.GetString();
+                            homework.tchLists = pa.gId;
+                            homework.scope = "school";
+                            homework.targetType = "research";
+                            //homework.blob = $"/{homework.areaId}/survey/{study.pId}/index.json";
+                            await getMoreWork(pa, homework);
+                            string workId = await HomeworkService.saveMoreAsync(client, _dingDing, homework);
                             if (string.IsNullOrEmpty(workId))
                             {
                                 return Ok(new { code = (int)HttpStatusCode.BadRequest, msg = "作业活动异常" });
@@ -420,7 +420,7 @@ namespace TEAMModelOS.Controllers
                 List<(List<TmdInfo> teac, Survey sur)> trSurveys = new List<(List<TmdInfo> teac, Survey sur)>();
                 List<(List<TmdInfo> teac, ExamLite examLite)> trExams = new List<(List<TmdInfo> teac, ExamLite examLite)>();
                 List<(List<TmdInfo> teac, Study stu)> moreInfo = new List<(List<TmdInfo> teac, Study stu)>();
-                List<(List<TmdInfo> teac, TeacherWork tw)> works = new List<(List<TmdInfo> teac, TeacherWork tw)>();
+                List<(List<TmdInfo> teac, Homework tw)> works = new List<(List<TmdInfo> teac, Homework tw)>();
                 foreach (Study study in studies)
                 {
                     (List<TmdInfo> tchList, _) = await TriggerStuActivity.GetTchList(client, _dingDing, study.tchLists, study.school);
@@ -447,11 +447,11 @@ namespace TEAMModelOS.Controllers
                     }
                     if (!string.IsNullOrEmpty(study.workId))
                     {
-                        var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(study.workId, new PartitionKey($"TeacherWork-{study.school}"));
+                        var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(study.workId, new PartitionKey($"Homework-{study.school}"));
                         if (sresponse.Status == 200)
                         {
                             using var json = await JsonDocument.ParseAsync(sresponse.ContentStream);
-                            TeacherWork work = json.ToObject<TeacherWork>();
+                            Homework work = json.ToObject<Homework>();
                             works.Add((tchList, work));
                         }
                     }
@@ -929,7 +929,7 @@ namespace TEAMModelOS.Controllers
                                 }
                                 if (!string.IsNullOrEmpty(study.workId))
                                 {
-                                    await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(study.workId, new PartitionKey($"TeacherWork-{study.school}"));
+                                    await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(study.workId, new PartitionKey($"Homework-{study.school}"));
                                 }
                             }
                         }
@@ -1217,7 +1217,7 @@ namespace TEAMModelOS.Controllers
             }
             return Task.FromResult(trSurvey);
         }
-        private Task<TeacherWork> getMoreWork(parameter pa, TeacherWork work)
+        private Task<Homework> getMoreWork(parameter pa, Homework work)
         {
             if (pa.gName.Count == 0)
             {

+ 1 - 1
TEAMModelOS/Controllers/Common/StudyController.cs

@@ -253,7 +253,7 @@ namespace TEAMModelOS.Controllers.Common
                     }
                     if (!string.IsNullOrEmpty(study.workId))
                     {
-                        await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(study.workId, new PartitionKey($"TeacherWork-{code}"));
+                        await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(study.workId, new PartitionKey($"Homework-{code}"));
                     }
                 }
                 var response = await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Study-{code}"));

+ 17 - 17
TEAMModelOS/Controllers/Common/WorkController.cs

@@ -56,12 +56,12 @@ namespace TEAMModelOS.Controllers.Common
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                TeacherWork work = request.ToObject<TeacherWork>();
+                Homework work = request.ToObject<Homework>();
                 work.owner = "school";
                 try
                 {
                     work.ttl = -1;
-                    work.code = "TeacherWork-" + work.school;
+                    work.code = "Homework-" + work.school;
                     long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                     work.createTime = now;
 
@@ -84,7 +84,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/save()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/save()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
 
@@ -110,11 +110,11 @@ namespace TEAMModelOS.Controllers.Common
                 var client = _azureCosmos.GetCosmosClient();
                 //List<List<string>> answer = ans.ToObject<List<List<string>>>();
                 long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"TeacherWork-{code}"));
+                var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"Homework-{code}"));
                 if (response.Status == (int)HttpStatusCode.OK)
                 {
                     var json = await JsonDocument.ParseAsync(response.ContentStream);
-                    TeacherWork work = json.ToObject<TeacherWork>();
+                    Homework work = json.ToObject<Homework>();
                     //List<List<string>> standard = work.items.answers;                  
                     bool flag = work.teachers.Exists(s => s.id.Equals(tId.GetString()));
                     List<string> ids = work.teachers.Select(e => e.id).ToList();
@@ -148,7 +148,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/record-in()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/record-in()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
 
@@ -164,7 +164,7 @@ namespace TEAMModelOS.Controllers.Common
                 if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                var response = await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"TeacherWork-{code}"));
+                var response = await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"Homework-{code}"));
                 return Ok(new { id, code = response.Status });
 
 
@@ -172,7 +172,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/delete()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/delete()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
         }
@@ -209,7 +209,7 @@ namespace TEAMModelOS.Controllers.Common
                 }
 
                 List<object> works = new();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"TeacherWork-{code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, continuationToken: token, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"Homework-{code}") }))
                 {
 
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -231,7 +231,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/find()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/find()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
 
@@ -247,8 +247,8 @@ namespace TEAMModelOS.Controllers.Common
                 if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
-                List<TeacherWork> works = new();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<TeacherWork>(queryText: $"select value(c) from c where c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TeacherWork-{code}") }))
+                List<Homework> works = new();
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Homework>(queryText: $"select value(c) from c where c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))
                 {
                     works.Add(item);
                 }
@@ -256,7 +256,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/FindSummary()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/FindSummary()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
 
@@ -277,7 +277,7 @@ namespace TEAMModelOS.Controllers.Common
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,A0.time from c join A0 in c.teachers where A0.id = '{tId}'";
                 List<object> works = new();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TeacherWork-{code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))
                 {
 
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -293,7 +293,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/find-by-teacher()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/find-by-teacher()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
 
@@ -311,7 +311,7 @@ namespace TEAMModelOS.Controllers.Common
                 if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> works = new();
-                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"TeacherWork-{code}") }))
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -326,7 +326,7 @@ namespace TEAMModelOS.Controllers.Common
             }
             catch (Exception e)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},TeacherWork/find-summary-by-teacher()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},Homework/find-summary-by-teacher()\n{e.Message}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }