瀏覽代碼

Merge branch 'develop' into ZJ/develop-2022729

zhouj1203@hotmail.com 2 年之前
父節點
當前提交
8998a1ec6c
共有 42 個文件被更改,包括 790 次插入544 次删除
  1. 11 9
      TEAMModelBI/Controllers/BIBlob/AnalyseFileController.cs
  2. 14 10
      TEAMModelBI/Controllers/BIHome/OnLineController.cs
  3. 157 67
      TEAMModelBI/Controllers/BITest/TestController.cs
  4. 2 1
      TEAMModelBI/Controllers/Census/ActivitySticsController.cs
  5. 二進制
      TEAMModelBI/JsonFile/Core/ip2region.db
  6. 3 0
      TEAMModelBI/Startup.cs
  7. 4 1
      TEAMModelOS.FunctionV4/Program.cs
  8. 1 0
      TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs
  9. 3 0
      TEAMModelOS.FunctionV4/TEAMModelOS.FunctionV4.csproj
  10. 57 16
      TEAMModelOS.FunctionV4/TimeTrigger/IESTimerTrigger.cs
  11. 二進制
      TEAMModelOS.FunctionV4/ip2region.db
  12. 2 1
      TEAMModelOS.SDK/Helper/Network/IP2Region/IPSearcherExtensions.cs
  13. 9 1
      TEAMModelOS.SDK/Models/Cosmos/BI/RecAppGWInfo.cs
  14. 24 0
      TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs
  15. 16 0
      TEAMModelOS.SDK/Models/Dtos/IdCodeCount.cs
  16. 53 6
      TEAMModelOS.SDK/Models/Service/BI/BILogAnalyseService.cs
  17. 3 1
      TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue
  18. 14 14
      TEAMModelOS/Controllers/Analysis/ClassAnalysisController.cs
  19. 55 55
      TEAMModelOS/Controllers/Both/CourseController.cs
  20. 8 8
      TEAMModelOS/Controllers/Both/PaperController.cs
  21. 2 2
      TEAMModelOS/Controllers/Client/AClassONEController.cs
  22. 2 2
      TEAMModelOS/Controllers/Client/HiTeachController.cs
  23. 24 24
      TEAMModelOS/Controllers/Common/AreaController.cs
  24. 117 117
      TEAMModelOS/Controllers/Common/ExamController.cs
  25. 14 14
      TEAMModelOS/Controllers/Common/ExamLiteController.cs
  26. 29 29
      TEAMModelOS/Controllers/Common/LearnController.cs
  27. 14 14
      TEAMModelOS/Controllers/Common/StudyController.cs
  28. 10 10
      TEAMModelOS/Controllers/Common/SurveyController.cs
  29. 11 11
      TEAMModelOS/Controllers/Common/VoteController.cs
  30. 14 14
      TEAMModelOS/Controllers/Common/WorkController.cs
  31. 1 1
      TEAMModelOS/Controllers/OpenApi/Init/OpenApiConfigController.cs
  32. 7 7
      TEAMModelOS/Controllers/School/ClassController.cs
  33. 8 8
      TEAMModelOS/Controllers/School/CorrectController.cs
  34. 17 17
      TEAMModelOS/Controllers/School/NoticeController.cs
  35. 9 9
      TEAMModelOS/Controllers/School/RoomController.cs
  36. 2 2
      TEAMModelOS/Controllers/School/SchoolController.cs
  37. 3 3
      TEAMModelOS/Controllers/Student/StudentController.cs
  38. 6 6
      TEAMModelOS/Controllers/System/OpenApiController.cs
  39. 5 5
      TEAMModelOS/Controllers/Teacher/FavoriteController.cs
  40. 7 7
      TEAMModelOS/Controllers/Teacher/InitController.cs
  41. 51 51
      TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs
  42. 1 1
      TEAMModelOS/Startup.cs

+ 11 - 9
TEAMModelBI/Controllers/BIBlob/AnalyseFileController.cs

@@ -61,18 +61,20 @@ namespace TEAMModelBI.Controllers.BIBlob
 
             await foreach (BlobItem blobItem in blobCilent.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"visitCnt/{day}"))
             {
-                BlobClient tempClient = blobCilent.GetBlobClient(blobItem.Name);
-                if (await tempClient.ExistsAsync())
+                if (blobItem.Name.EndsWith(".json") && !blobItem.Name.EndsWith("/days.json"))
                 {
-                    using (var meomoryStream = new MemoryStream())
+                    BlobClient tempClient = blobCilent.GetBlobClient(blobItem.Name);
+                    if (await tempClient.ExistsAsync())
                     {
-                        var response = blobCilent.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
-                        //var response = await blob.GetBlobClient($"{blobItem.Name}").DownloadToAsync(meomoryStream);
-
-                        RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                        using (var meomoryStream = new MemoryStream())
+                        {
+                            var response = blobCilent.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
+                            //var response = await blob.GetBlobClient($"{blobItem.Name}").DownloadToAsync(meomoryStream);
 
-                        string name = stringSuffix.MidStrEx(blobItem.Name, "/", ".");
-                        days.Add(name, recCnt);
+                            RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                            string name = stringSuffix.MidStrEx(blobItem.Name, "/", ".");
+                            days.Add(name, recCnt);
+                        }
                     }
                 }
             }

+ 14 - 10
TEAMModelBI/Controllers/BIHome/OnLineController.cs

@@ -43,13 +43,13 @@ namespace TEAMModelBI.Controllers.BIHome
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("get-count")]
-        public async Task<IActionResult> GetCount(JsonElement jsonElement) 
+        public async Task<IActionResult> GetCount(JsonElement jsonElement)
         {
             var cosmosClient = _azureCosmos.GetCosmosClient();
             var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
             var blobClient = _azureStorage.GetBlobContainerClient($"0-public");
             jsonElement.TryGetProperty("site", out JsonElement site);
-            if ($"{site}".Equals(BIConst.Global)) 
+            if ($"{site}".Equals(BIConst.Global))
             {
                 cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
                 table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
@@ -61,9 +61,9 @@ namespace TEAMModelBI.Controllers.BIHome
 
             var (daySt, dayEt) = TimeHelper.GetStartOrEnd(dateTime);  //今天开始时间    13位
             var (daySf, dayEf) = TimeHelper.GetStartOrEnd(dateTime, dateLenth: false);  //今天开始时间  10位
-            
+
             var (lastDayS, lastdayE) = TimeHelper.GetStartOrEnd(dateTime.AddDays(-1));   //昨天开始时间
-            
+
             var near7S = dateTime.AddDays(-7).ToUnixTimeMilliseconds();  //前七天的开始时间
             var near7E = dateTime.ToUnixTimeMilliseconds();     //当前结束时间
             long hour1 = dateTime.AddHours(-1).ToUnixTimeMilliseconds(); //一小时前时间戳
@@ -101,15 +101,19 @@ namespace TEAMModelBI.Controllers.BIHome
             List<RecCnt> recCnts = new();
             await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"visitCnt/{cDay}"))
             {
-                BlobClient tempBlobClient = blobClient.GetBlobClient(blobItem.Name);
-                if (await tempBlobClient.ExistsAsync())
+                if (blobItem.Name.EndsWith(".json") && !blobItem.Name.EndsWith("/days.json"))
                 {
-                    using (var meomoryStream = new MemoryStream())
+                    BlobClient tempBlobClient = blobClient.GetBlobClient(blobItem.Name);
+                    if (await tempBlobClient.ExistsAsync())
                     {
-                        var response = blobClient.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
-                        RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
-                        recCnts.Add(recCnt);
+                        using (var meomoryStream = new MemoryStream())
+                        {
+                            var response = blobClient.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
+                            RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
+                            recCnts.Add(recCnt);
+                        }
                     }
+
                 }
             }
             apiCnt = recCnts.Select(x => x.apiCnt.Select(s => s.count).Sum()).Sum();

+ 157 - 67
TEAMModelBI/Controllers/BITest/TestController.cs

@@ -51,6 +51,7 @@ using TEAMModelOS.SDK.Context.Constant;
 using Azure.Storage.Blobs.Models;
 using Azure.Storage.Blobs;
 using Azure.Storage.Blobs.Specialized;
+using System.Web;
 
 namespace TEAMModelBI.Controllers.BITest
 {
@@ -69,8 +70,8 @@ namespace TEAMModelBI.Controllers.BITest
         private readonly IConfiguration _configuration;
         private readonly CoreAPIHttpService _coreAPIHttpService;
         private readonly HttpClient _httpClient;
-
-        public TestController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IWebHostEnvironment hostingEnvironment, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService, HttpClient httpClient)
+        private IPSearcher _ipSearcher;
+        public TestController(IPSearcher ipSearcher, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, DingDing dingDing, IOptionsSnapshot<Option> option, IWebHostEnvironment hostingEnvironment, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService, HttpClient httpClient)
         {
             _azureCosmos = azureCosmos;
             _azureStorage = azureStorage;
@@ -80,7 +81,7 @@ namespace TEAMModelBI.Controllers.BITest
             _environment = hostingEnvironment;
             _configuration = configuration;
             _coreAPIHttpService = coreAPIHttpService;
-            _httpClient = httpClient;
+            _httpClient = httpClient; _ipSearcher = ipSearcher;
         }
 
         /// <summary>
@@ -280,7 +281,7 @@ namespace TEAMModelBI.Controllers.BITest
 
             //access_token的有效期为7200秒(2小时),有效期内重复获取会返回相同结果并自动续期,过期后获取会返回新的access_token
             string access_token = response.AccessToken;
-            
+
             IDingTalkClient quitStaffClient = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/smartwork/hrm/employee/querydimission");
             OapiSmartworkHrmEmployeeQuerydimissionRequest reqDimission = new() { Offset = 0L, Size = 50L };
             OapiSmartworkHrmEmployeeQuerydimissionResponse rspDimission = quitStaffClient.Execute(reqDimission, access_token);
@@ -356,7 +357,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// </summary>
         /// <returns></returns>
         [HttpPost("get-onthejob")]
-        public async Task<IActionResult> GetOnTheJob() 
+        public async Task<IActionResult> GetOnTheJob()
         {
 
             string appKey = _configuration["DingDingAuth:appKey"];
@@ -396,10 +397,10 @@ namespace TEAMModelBI.Controllers.BITest
             {
                 return Ok(new { state = 200, msg = jobrsp.SubErrMsg });
             }
-                foreach (var item in jobrsp.Result.DataList)
-                {
-                    
-                }
+            foreach (var item in jobrsp.Result.DataList)
+            {
+
+            }
 
             var ser = jobrsp.Result.DataList;  // jobrsp.Body.GetEnumerator("result");
 
@@ -583,28 +584,28 @@ namespace TEAMModelBI.Controllers.BITest
         /// </summary>
         /// <returns></returns>
         [HttpPost("set-rolesorperm")]
-        public async Task<IActionResult> SetRolesOrPermissions() 
+        public async Task<IActionResult> SetRolesOrPermissions()
         {
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIDDUserInfo");
             List<DingDingUserInfo> ddUserId = await table.FindListByDict<DingDingUserInfo>(new Dictionary<string, object> { { "PartitionKey", "continent" } });
             List<string> read = new() { "abilitystandard-read", "batcharea-read", "batchschool-read", "orgusers-read" };
             List<DingDingUserInfo> tempUserInfo = new();
-            foreach (var user in ddUserId) 
+            foreach (var user in ddUserId)
             {
-                if (string.IsNullOrEmpty(user.roles)) 
+                if (string.IsNullOrEmpty(user.roles))
                 {
                     user.roles = "assist";
                 }
 
-                if (string.IsNullOrEmpty(user.permissions)) 
+                if (string.IsNullOrEmpty(user.permissions))
                 {
                     user.permissions = string.Join(",", read);
                 }
                 List<string> tempRead = new(user.permissions.Split(","));
 
-                foreach (var temp in read) 
+                foreach (var temp in read)
                 {
-                    if (!tempRead.Contains(temp)) 
+                    if (!tempRead.Contains(temp))
                     {
                         tempRead.Add(temp);
                     }
@@ -694,7 +695,7 @@ namespace TEAMModelBI.Controllers.BITest
             {
                 ste = new DateTime(ere.Year, ere.Month - 4, 1);
             }
-            else 
+            else
             {
                 ste = new DateTime(ere.Year - 1, ere.Month, 1);
             }
@@ -714,7 +715,7 @@ namespace TEAMModelBI.Controllers.BITest
             //return Ok(new { strList, dateTime, year, start, end, endList, endList1, endList2 });
 
 
-            return Ok(new { day7, day30, datetime7, start1, end1, start2, end2, start3, end3, start4, end4 , start5, end5 , start6, end6 , start7, end7 });
+            return Ok(new { day7, day30, datetime7, start1, end1, start2, end2, start3, end3, start4, end4, start5, end5, start6, end6, start7, end7 });
         }
 
         public static List<string> monthsOfYear(string yearMonth)
@@ -723,11 +724,11 @@ namespace TEAMModelBI.Controllers.BITest
             int year = dateTime.Year;
             int month = dateTime.Month;
             List<string> months = new List<string>();
-            while (year > dateTime.Year - 1 || month > dateTime.Month) 
+            while (year > dateTime.Year - 1 || month > dateTime.Month)
             {
                 months.Add($"{year}-{(month < 10 ? "0" : "") + month}");
                 month -= 1;
-                if (month <= 0) 
+                if (month <= 0)
                 {
                     year -= 1;
                     month = 12;
@@ -903,10 +904,10 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-repeat")]
-        public async Task<IActionResult> GetRepeat(JsonElement jsonElement) 
+        public async Task<IActionResult> GetRepeat(JsonElement jsonElement)
         {
             jsonElement.TryGetProperty("datetime", out JsonElement _datetime);
-            Dictionary<string, string> prodict = new() { { "YMPCVCIM", "学情分析模组" }, { "IPDYZYLC", "智慧学校管理服务" }, { "3CLYJ6NP", "AClass ONE智慧学伴" }, { "IPALJ6NY", "数据储存服务空间" },{ "VABAJ6NV", "卷卡合一阅卷系统" } };
+            Dictionary<string, string> prodict = new() { { "YMPCVCIM", "学情分析模组" }, { "IPDYZYLC", "智慧学校管理服务" }, { "3CLYJ6NP", "AClass ONE智慧学伴" }, { "IPALJ6NY", "数据储存服务空间" }, { "VABAJ6NV", "卷卡合一阅卷系统" } };
             var ste = prodict["IPDYZYLC"];
 
             List<string> str_str = new() { "12", "20", "13", "13", "14", "16" };
@@ -926,7 +927,7 @@ namespace TEAMModelBI.Controllers.BITest
             int pydays = (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) ? 366 : 365;
             //int pydays = DateTimeHelper.getDays(year);
 
-            return Ok(new { state = 200, pydays, days, strends , str_strend1, str_strend2 , ste  });
+            return Ok(new { state = 200, pydays, days, strends, str_strend1, str_strend2, ste });
         }
 
         /// <summary>
@@ -935,7 +936,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-dateday")]
-        public async Task<IActionResult> GetDateDay(JsonElement jsonElement) 
+        public async Task<IActionResult> GetDateDay(JsonElement jsonElement)
         {
             jsonElement.TryGetProperty("year", out JsonElement _year);
             jsonElement.TryGetProperty("moth", out JsonElement _moth);
@@ -968,29 +969,29 @@ namespace TEAMModelBI.Controllers.BITest
                         if (item <= 8 && item >= 3)
                             years = year;
                         else
-                            years = year+1;
+                            years = year + 1;
 
-                        if (years % 4 == 0 && year % 100 != 0 || year % 400 == 0)                        
-                            days = 29;                        
+                        if (years % 4 == 0 && year % 100 != 0 || year % 400 == 0)
+                            days = 29;
                         else
                             days = 28;
-                        break;                        
+                        break;
                 }
 
                 day += days;
             }
 
             return Ok(new { state = 200, day });
-            
+
         }
-        
+
         /// <summary>
         /// 测试CosmosDB分页查询  SQL语句分页
         /// </summary>
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-page")]
-        public async Task<IActionResult> cosmosDBPage(JsonElement jsonElement) 
+        public async Task<IActionResult> cosmosDBPage(JsonElement jsonElement)
         {
             if (!jsonElement.TryGetProperty("pageSize", out JsonElement pageSize)) return BadRequest();
             if (!jsonElement.TryGetProperty("endPosition", out JsonElement endPosition)) return BadRequest();
@@ -998,7 +999,7 @@ namespace TEAMModelBI.Controllers.BITest
             List<School> schools = new List<School>();
             //string sqlTxt = $"SELECT * FROM c where c.code='Base' order by c.id offset {endPosition} limit {pageSize}";
             string sqlTxt = $"SELECT * FROM c order by c.id offset {pageSize} limit {endPosition}";
-            await foreach (var tempPage in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions:new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var tempPage in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: sqlTxt, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") }))
             {
                 using var json = await JsonDocument.ParseAsync(tempPage.ContentStream);
                 if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetInt16() > 0)
@@ -1028,9 +1029,9 @@ namespace TEAMModelBI.Controllers.BITest
             int? pageSize = null;
             string continuationToken = string.Empty;
             string pageToken = default;
-            if (jsonElement.TryGetProperty("pageSize", out JsonElement jsonPageSize)) 
+            if (jsonElement.TryGetProperty("pageSize", out JsonElement jsonPageSize))
             {
-                if (!jsonPageSize.ValueKind.Equals(JsonValueKind.Undefined) && !jsonPageSize.ValueKind.Equals(JsonValueKind.Null) && jsonPageSize.TryGetInt32(out int tempPageSize)) 
+                if (!jsonPageSize.ValueKind.Equals(JsonValueKind.Undefined) && !jsonPageSize.ValueKind.Equals(JsonValueKind.Null) && jsonPageSize.TryGetInt32(out int tempPageSize))
                 {
                     pageSize = tempPageSize;
                 }
@@ -1051,14 +1052,14 @@ namespace TEAMModelBI.Controllers.BITest
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: "select value(c) from c", continuationToken: pageToken, requestOptions: new QueryRequestOptions() { MaxItemCount = pageSize, PartitionKey = new PartitionKey("Base") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.ContentStream);
-                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0) 
+                if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                 {
                     foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
                     {
                         schools.Add(obj.ToObject<School>());
                     }
 
-                    if (iscontinuation) 
+                    if (iscontinuation)
                     {
                         continuationToken = item.GetContinuationToken();
                         break;
@@ -1095,7 +1096,7 @@ namespace TEAMModelBI.Controllers.BITest
             list2.Add(new Test { score = 100, name = "010" });
 
             //list3 return 2
-            List<Test> list3 = list1.Where(x => !list2.Any(x2 => x.score == x2.score && x.name==x2.name)).ToList();
+            List<Test> list3 = list1.Where(x => !list2.Any(x2 => x.score == x2.score && x.name == x2.name)).ToList();
             //list4 return 2
             List<Test> list4 = list1.Where(x => list2.All(x2 => x.score != x2.score)).ToList();
 
@@ -1120,8 +1121,8 @@ namespace TEAMModelBI.Controllers.BITest
             var ss = DateTime.Now.AddDays(0 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7).ToString("yyyy-MM-dd");//上周日
             var sss = DateTime.Now.AddDays(6 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7).ToString("yyyy-MM-dd");//上周六
 
-            var ssss = DateTime.Now.AddDays(1 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7+1).ToString("yyyy-MM-dd");//上周一
-            var sssss = DateTime.Now.AddDays(7 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7+1).ToString("yyyy-MM-dd");//上周日
+            var ssss = DateTime.Now.AddDays(1 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7 + 1).ToString("yyyy-MM-dd");//上周一
+            var sssss = DateTime.Now.AddDays(7 - Convert.ToInt16(DateTime.Now.DayOfWeek) - 7 + 1).ToString("yyyy-MM-dd");//上周日
 
             //计算上周
             var date = DateTime.Now;
@@ -1132,7 +1133,7 @@ namespace TEAMModelBI.Controllers.BITest
 
             var (lastWeekStart, lastWeekEnd) = TimeHelper.GetStartOrEnd(DateTimeOffset.UtcNow, "lastweek");
 
-            return Ok(new { state = 200, Mon,Sun, ss, sss, ssss, sssss, lastWeekStart, lastWeekEnd, have, en2, bingji, cha, jiaoji, chaji, list3, list4, temp, list1 });
+            return Ok(new { state = 200, Mon, Sun, ss, sss, ssss, sssss, lastWeekStart, lastWeekEnd, have, en2, bingji, cha, jiaoji, chaji, list3, list4, temp, list1 });
         }
 
         /// <summary>
@@ -1141,11 +1142,11 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-tablepage")]
-        public async Task<IActionResult> GetTablePage(JsonElement jsonElement) 
+        public async Task<IActionResult> GetTablePage(JsonElement jsonElement)
         {
             jsonElement.TryGetProperty("page", out JsonElement jpage);
             jsonElement.TryGetProperty("size", out JsonElement jsize);
-            int page = string.IsNullOrEmpty($"{jsize}") ?1: int.Parse($"{jpage}");
+            int page = string.IsNullOrEmpty($"{jsize}") ? 1 : int.Parse($"{jpage}");
             int size = string.IsNullOrEmpty($"{jsize}") ? 2 : int.Parse($"{jsize}");
             var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
 
@@ -1182,7 +1183,7 @@ namespace TEAMModelBI.Controllers.BITest
             Console.WriteLine(sw.Elapsed);
 
             HttpContext.Response.ContentType = "text/plain";
-            
+
             StreamWriter writer;
             //using (writer = new StreamWriter(HttpContext.Response.Body))
             //    for (int i = 0; i < 100; i++)
@@ -1191,21 +1192,21 @@ namespace TEAMModelBI.Controllers.BITest
             //    }
             //    //await writer.FlushAsync("Hello World");
 
-            return Ok(new { state = 200});
+            return Ok(new { state = 200 });
         }
 
         [HttpPost("get-linqcount")]
-        public async Task<IActionResult> GetLinqCount() 
+        public async Task<IActionResult> GetLinqCount()
         {
             List<linqTest> linqTests = new();
             for (int i = 0; i < 10; i++)
             {
-                linqTest linqt = new() { id = $"qwe{i}",name=$"名字{i}" ,linq1s = new List<linq1> { new linq1 { id =$"abc{i}",times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}, new linq1 { id = $"def{i}", times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } } };
+                linqTest linqt = new() { id = $"qwe{i}", name = $"名字{i}", linq1s = new List<linq1> { new linq1 { id = $"abc{i}", times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() }, new linq1 { id = $"def{i}", times = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() } } };
                 linqTests.Add(linqt);
             }
 
             //var set = linqTests.Select((x, y) => x.linq1s.Find(l => l.id.Equals($"abc0"))).ToList();
-            var set = linqTests.Where(x=> !string.IsNullOrEmpty(x.linq1s.Find(l => l.id.Equals($"abc0")).ToString()) );
+            var set = linqTests.Where(x => !string.IsNullOrEmpty(x.linq1s.Find(l => l.id.Equals($"abc0")).ToString()));
             //var tem220p = linqTests.ForEach(x => {
             //    var coreUser = linqTests.Find(c => c.id.Equals("abc0"));
             //   });  //.Except(linqTests.Select(y => y.linq1s.Find(n => n.times.Equals("abc0"))));
@@ -1256,7 +1257,7 @@ namespace TEAMModelBI.Controllers.BITest
             }
             var redisGl = _azureRedis.GetRedisClient(dbnum: 0, name: "Global");
 
-            var temps= await _azureRedis.GetRedisClient(dbnum: 0, name: "Global").SortedSetIncrementAsync($"Login:IES:Test", $"1", 1);//一天24小时  小时为单位
+            var temps = await _azureRedis.GetRedisClient(dbnum: 0, name: "Global").SortedSetIncrementAsync($"Login:IES:Test", $"1", 1);//一天24小时  小时为单位
 
             var cosmosDefaulat = _azureCosmos.GetCosmosClient(); //默认数据库
             List<School> schools = new();
@@ -1321,7 +1322,7 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-loganalyse")]
-        public async Task<IActionResult> GetLogAnalyse(JsonElement jsonElement) 
+        public async Task<IActionResult> GetLogAnalyse(JsonElement jsonElement)
         {
             if (!jsonElement.TryGetProperty("path", out JsonElement path)) return BadRequest();
 
@@ -1342,11 +1343,100 @@ namespace TEAMModelBI.Controllers.BITest
             //    }
             //}
 
-            var (an, saveUrl) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, $"{path}", BIConst.LogGlobal);
+            var (an, saveUrl) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, $"{path}", BIConst.LogChina);
 
             return Ok(new { state = RespondCode.Ok, cnt = filename.Count, filename, an, saveUrl });
         }
 
+        /// <summary>
+        /// 小时/天读取防火墙文件,分析;
+        /// </summary>
+        /// <param name="jsonElement"></param>
+        /// <returns></returns>
+        [HttpPost("get-savefile")]
+        public async Task<IActionResult> GetSaveFile(JsonElement jsonElement)
+        {
+            if (!jsonElement.TryGetProperty("time", out JsonElement time)) return BadRequest();
+
+            long str = time.GetInt64();
+            DateTimeOffset dateTimeJ = TimeHelper.GetDateTime(str);
+
+            var datetime = dateTimeJ.AddHours(-1);
+            var y = datetime.Year;
+            var m = datetime.Month >= 10 ? $"{datetime.Month}" : $"0{datetime.Month}";
+            var d = datetime.Day >= 10 ? $"{datetime.Day}" : $"0{datetime.Day}";
+            var h = datetime.Hour >= 10 ? $"{datetime.Hour}" : $"0{datetime.Hour}";
+
+            string path = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={y}/m={m}/d={d}/h={h}/m=00/PT1H.json";
+            var retn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, path, BIConst.LogChina);
+            if (retn.recCnts.IsNotEmpty())
+            {
+                //https://teammodelos.blob.core.chinacloudapi.cn/0-public/pie-borderRadius.html
+                string publishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retn.saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时"), Encoding.UTF8)}";
+                string ulrs = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retn.saveUrls.First()}&time={datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时")}";
+                string ulr = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(ulrs, Encoding.UTF8)}&delay=6000";
+                string image = "";
+
+                try
+                {
+                    string strs = await _httpClient.GetStringAsync(ulr);
+                    if (!string.IsNullOrWhiteSpace(strs))
+                    {
+                        JsonElement json = strs.ToObject<JsonElement>();
+                        json.TryGetProperty("url", out JsonElement base64);
+                        using (MemoryStream ms = new MemoryStream(Convert.FromBase64String($"{base64}")))
+                        {
+                            image = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(ms, $"visitCnt/{y}{m}{d}", $"{y}{m}{d}{h}.png", false);
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+                await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 测试(小时)-防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
+                    $" [发布地址]({publishUrl}) \n", GroupNames.醍摩豆服務運維群組);
+            }
+            List<RecCnt> recCnts = new();
+            List<string> saveUrls = new();
+
+            if (h.Equals("00"))
+            {
+                var pastTime = datetime.AddHours(-1);
+                var ptY = pastTime.Year;
+                var ptM = pastTime.Month >= 10 ? $"{pastTime.Month}" : $"0{pastTime.Month}";
+                var ptD = pastTime.Day >= 10 ? $"{pastTime.Day}" : $"0{pastTime.Day}";
+
+                string dayPath = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={ptY}/m={ptM}/d={ptD}";
+                (recCnts, saveUrls) = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, dayPath, BIConst.LogChina);
+
+                if (recCnts.IsNotEmpty())
+                {
+                    //一天的统计
+                    string dayPublishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(pastTime.ToString("yyyy年MM月dd日"), Encoding.UTF8)}";
+                    string dayUrls = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={saveUrls.First()}&time={pastTime.ToString("yyyy年MM月dd日")}";
+                    string dayUrl = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(dayUrls, Encoding.UTF8)}&delay=6000";
+                    string dayImage = "";
+
+                    string dayStr = await _httpClient.GetStringAsync(dayUrl);
+                    if (!string.IsNullOrWhiteSpace(dayStr))
+                    {
+                        JsonElement dayJson = dayStr.ToObject<JsonElement>();
+                        dayJson.TryGetProperty("url", out JsonElement dayBase64);
+                        using (MemoryStream dayMs = new(Convert.FromBase64String($"{dayBase64}")))
+                        {
+                            dayImage = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(dayMs, $"visitCnt/{ptY}{ptM}{ptD}", "days.png", false);
+                        }
+                    }
+
+                    await _dingDing.SendBotMarkdown("测试-防火墙日志记录", $"#### 测试(天)-防火墙日志记录\n> 记录时间:{pastTime.ToString("yyyy-MM-dd")}\n> ![screenshot]({dayImage})\n> ###### 发布时间:{pastTime.ToString("yyyy-MM-dd HH:mm:ss")}" +$" [发布地址]({dayPublishUrl}) \n", GroupNames.成都开发測試群組);
+
+                }
+            }
+
+            return Ok(new { state = 200, recCnts });
+        }
+
 
         /// <summary>
         /// 测试研究table 表分页的问题
@@ -1354,34 +1444,34 @@ namespace TEAMModelBI.Controllers.BITest
         /// <param name="jsonElement"></param>
         /// <returns></returns>
         [HttpPost("get-logrec")]
-        public async Task<IActionResult> GetLogRec(JsonElement jsonElement) 
-        {
-            int takeCount = 500;
-            var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
-            var table1 = _azureStorage.GetCloudTableClient();
-            int pagesize = 10;
-            int pageNum = 2;
+            public async Task<IActionResult> GetLogRec(JsonElement jsonElement)
+            {
+                int takeCount = 500;
+                var table = _azureStorage.GetCloudTableClient().GetTableReference("BIOptLog");
+                var table1 = _azureStorage.GetCloudTableClient();
+                int pagesize = 10;
+                int pageNum = 2;
 
-            var query = (from entity in table.CreateQuery<BIOptLog>()
-                          select entity).ToList().Skip(pagesize * (pageNum - 1)).Take(pagesize);
+                var query = (from entity in table.CreateQuery<BIOptLog>()
+                             select entity).ToList().Skip(pagesize * (pageNum - 1)).Take(pagesize);
 
-            //var query = (from entity in table.CreateQuery<BIOptLog>()
-            //             orderby entity.time descending
-            //             select  entity).Skip(pagesize * (pageNum - 1)).Take(pagesize);
-            //var ster = AzureStorageTableExtensions.GetTablePage<BIOptLog>(table1, "BIOptLog", 10, 1);
-            return Ok(new { state = 200 , query });
+                //var query = (from entity in table.CreateQuery<BIOptLog>()
+                //             orderby entity.time descending
+                //             select  entity).Skip(pagesize * (pageNum - 1)).Take(pagesize);
+                //var ster = AzureStorageTableExtensions.GetTablePage<BIOptLog>(table1, "BIOptLog", 10, 1);
+                return Ok(new { state = 200, query });
 
-        }
+            }
 
 
         public class linqTest
         {
-            public string id{ get; set; }
+            public string id { get; set; }
             public string name { get; set; }
             public List<linq1> linq1s { get; set; }
         }
 
-        public class linq1 
+        public class linq1
         {
             public string id { get; set; }
             public long times { get; set; }
@@ -1422,7 +1512,7 @@ namespace TEAMModelBI.Controllers.BITest
 
         }
 
-        public static long GetMonthEnd(DateTimeOffset dt) 
+        public static long GetMonthEnd(DateTimeOffset dt)
         {
             DateTime dtNew = new DateTime(dt.Year, dt.Month, 1);
             var ste = dtNew.AddMonths(1).AddDays(-1).Day;

+ 2 - 1
TEAMModelBI/Controllers/Census/ActivitySticsController.cs

@@ -486,7 +486,8 @@ namespace TEAMModelBI.Controllers.Census
             scCount = await CommonFind.GetSqlValueCount(cosmosClient, "School", commSql,  "Base");
             tecCount = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", commSql,"Base");
             stuCount = await CommonFind.GetSqlValueCount(cosmosClient, "Student", commSql,  "Base");
-            allSize = await CommonFind.GetSqlValueCount(cosmosClient, "School", commSql,  "Base");
+            string sizeSql = "select value(sum(c.size)) from c";
+            allSize = await CommonFind.GetSqlValueCount(cosmosClient, "School", sizeSql,  "Base");
 
 
             weekScCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", $"{commSql} where c.createTime >= {weekStart} and c.createTime <= {weekEnd}", "Base");

二進制
TEAMModelBI/JsonFile/Core/ip2region.db


+ 3 - 0
TEAMModelBI/Startup.cs

@@ -137,6 +137,9 @@ namespace TEAMModelBI
             services.AddHttpContextAccessor();
             services.Configure<Option>(options => Configuration.GetSection("Option").Bind(options));
             services.AddControllers();
+
+            string path = $"{ environment.ContentRootPath}/JsonFile/Core";
+            services.AddIPSearcher(path);
             services.AddSpaStaticFiles(configuration =>
             {
                 configuration.RootPath = "ClientApp";

+ 4 - 1
TEAMModelOS.FunctionV4/Program.cs

@@ -12,6 +12,7 @@ using System.IO;
 using System.Linq;
 using System.Runtime.InteropServices;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using TEAMModelOS.Models;
 using TEAMModelOS.SDK;
@@ -31,7 +32,7 @@ namespace TEAMModelOS.FunctionV4
             Debugger.Launch();
 #endif
 
-
+             
             var host = new HostBuilder()
             .ConfigureFunctionsWorkerDefaults()
            .ConfigureAppConfiguration((context, configure) =>
@@ -41,6 +42,7 @@ namespace TEAMModelOS.FunctionV4
            })
            .ConfigureServices((context, services) =>
            {
+           
                //services.Configure<Option>(options => context. Configuration.GetSection("Option").Bind(options));
                services.AddHttpClient();
                services.AddHttpClient<DingDing>();
@@ -61,6 +63,7 @@ namespace TEAMModelOS.FunctionV4
                    storageConnects.Add(("LogStorage", LogStorageConnectionString));   //防火墙日志统计文件
                }
                services.AddMultipleAzureStorage(storageConnects);
+               services.AddIPSearcher("");
            })
            .Build();
             await host.RunAsync();

+ 1 - 0
TEAMModelOS.FunctionV4/ServiceBus/ActiveTaskTopic.cs

@@ -1389,6 +1389,7 @@ namespace TEAMModelOS.FunctionV4.ServiceBus
                                         lessonRecord.clientInteractionAverge = lessonBase.summary.clientInteractionAverge;
                                         lessonRecord.examCount = lessonBase.summary.examCount;
                                         lessonRecord.totalInteractPoint = lessonBase.summary.totalInteractPoint;
+                                        lessonRecord.learningCategory = lessonBase.summary.learningCategory;
                                         if (!string.IsNullOrWhiteSpace(lessonRecord.school))
                                         {
                                             lessonBase.student.ForEach(x =>

+ 3 - 0
TEAMModelOS.FunctionV4/TEAMModelOS.FunctionV4.csproj

@@ -42,6 +42,9 @@
 		<None Update="host.json">
 			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
 		</None>
+		<None Update="ip2region.db">
+		  <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+		</None>
 		<None Update="libwkhtmltox.dll">
 		  <CopyToOutputDirectory>Always</CopyToOutputDirectory>
 		</None>

+ 57 - 16
TEAMModelOS.FunctionV4/TimeTrigger/IESTimerTrigger.cs

@@ -43,7 +43,8 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
         private readonly IConverter _converter;
         private readonly SnowflakeId _snowflakeId;
         private readonly HttpClient _httpClient;
-        public IESTimerTrigger(HttpClient httpClient,SnowflakeId snowflakeId,IConverter converter, AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis)
+        private IPSearcher _ipSearcher;
+        public IESTimerTrigger(IPSearcher ipSearcher,HttpClient httpClient,SnowflakeId snowflakeId,IConverter converter, AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis)
         {
             _azureCosmos = azureCosmos;
             _dingDing = dingDing;
@@ -52,6 +53,7 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
             _converter = converter;
             _snowflakeId=snowflakeId;
             _httpClient = httpClient;
+            _ipSearcher = ipSearcher;
         }
         /// <summary>
         /// 防火墙日志记录文件
@@ -81,15 +83,13 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
 
                 {
                     string path = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={y}/m={m}/d={d}/h={h}/m=00/PT1H.json";
-                    var retn = await BILogAnalyseService.GetPathAnalyse(_azureStorage, path, "LogStorage");
+                    var retn = await BILogAnalyseService.GetPathAnalyse(_azureStorage,_ipSearcher,_dingDing, path, "LogStorage");
                     if (retn.recCnts.IsNotEmpty())
                     {
-
-                        
                         //https://teammodelos.blob.core.chinacloudapi.cn/0-public/pie-borderRadius.html
                         string publishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retn.saveUrls.First(),Encoding.UTF8)}&time={HttpUtility.UrlEncode(datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时"),Encoding.UTF8)}";
                         string ulrs = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retn.saveUrls.First()}&time={datetime.AddHours(8).ToString("yyyy年MM月dd日 HH时")}";
-                        string ulr = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=980&url={HttpUtility.UrlEncode(ulrs,Encoding.UTF8)}&delay=5000";
+                        string ulr = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(ulrs,Encoding.UTF8)}&delay=5000";
                         string image = "";
                         try
                         {
@@ -106,9 +106,47 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
                         catch (Exception ex) { 
                           
                         }
-                        await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
+                        await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录(小时)\n> 记录时间:{datetime.AddHours(8).ToString("yyyy-MM-dd HH")}\n> ![screenshot]({image})\n> ###### 发布时间:{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}" +
                             $" [发布地址]({publishUrl}) \n", GroupNames.醍摩豆服務運維群組);
                     }
+
+                    //处理昨天的防火墙日志
+                    if (h.Equals("00"))
+                    {
+                        var pastTime = datetime.AddHours(-1);
+                        var ptY = pastTime.Year;
+                        var ptM = pastTime.Month >= 10 ? $"{pastTime.Month}" : $"0{pastTime.Month}";
+                        var ptD = pastTime.Day >= 10 ? $"{pastTime.Day}" : $"0{pastTime.Day}";
+
+                        string dayPath = $"resourceId=/SUBSCRIPTIONS/73B7F9EF-D8B7-4444-9E8D-D80B43BF3CD4/RESOURCEGROUPS/TEAMMODELCHENGDU/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/OSFIREWARE/y={ptY}/m={ptM}/d={ptD}";
+                        var retnDay = await BILogAnalyseService.GetPathAnalyse(_azureStorage, _ipSearcher, _dingDing, dayPath, "LogStorage");
+
+                        if (retn.recCnts.IsNotEmpty()) 
+                        {
+                            //一天的统计
+                            string dayPublishUrl = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={HttpUtility.UrlEncode(retnDay.saveUrls.First(), Encoding.UTF8)}&time={HttpUtility.UrlEncode(pastTime.ToString("yyyy年MM月dd日"), Encoding.UTF8)}";
+                            string dayUrls = $"https://teammodelos.blob.core.chinacloudapi.cn/0-public/api-count.html?url={retnDay.saveUrls.First()}&time={pastTime.ToString("yyyy年MM月dd日")}";
+                            string dayUrl = $"http://cdhabook.teammodel.cn:8805/screen/screenshot-png?width=1920&height=1450&url={HttpUtility.UrlEncode(dayUrls, Encoding.UTF8)}&delay=6000";
+                            string dayImage = "";
+
+                            try
+                            {
+                                string dayStr = await _httpClient.GetStringAsync(dayUrl);
+                                if (!string.IsNullOrWhiteSpace(dayStr)) 
+                                {
+                                    JsonElement dayJson = dayStr.ToObject<JsonElement>();
+                                    dayJson.TryGetProperty("utl", out JsonElement dayBase64);
+                                    using (MemoryStream dayMs = new(Convert.FromBase64String($"{dayBase64}"))) 
+                                    {
+                                        dayImage = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(dayMs, $"visitCnt/{ptY}{ptM}{ptD}", "days.png", false);
+                                    }
+                                }
+                            }
+                            catch (Exception ex) { }
+
+                            await _dingDing.SendBotMarkdown("防火墙日志记录", $"#### 防火墙日志记录(天)\n> 记录时间:{pastTime.ToString("yyyy-MM-dd")}\n> ![screenshot]({dayImage})\n> ###### 发布时间:{pastTime.ToString("yyyy-MM-dd HH:mm:ss")}" + $" [发布地址]({dayPublishUrl}) \n", GroupNames.成都开发測試群組);
+                        }
+                    }
                 }
                 else if (location.Contains("Global"))
                 {
@@ -137,10 +175,11 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
                 if (location.Equals("China") || location.Equals("Global"))
                 {
                     bool lockKey = await _azureRedis.GetRedisClient(8).KeyExistsAsync($"LessonRecord:Unused:Lock:{location}");
-                    //bool keyLock = await _azureRedis.GetRedisClient(8).KeyExistsAsync($"LessonRecord:Unused:Lock:Lock");
-                    //if (keyLock) { 
-                    //    return; 
-                    //}
+                    bool keyLock = await _azureRedis.GetRedisClient(8).KeyExistsAsync($"LessonRecord:Unused:Lock:Lock");
+                    if (keyLock)
+                    {
+                        return;
+                    }
                     //key不存在的时候 。
                     if (!lockKey)
                     {
@@ -330,6 +369,13 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
                                 content.Add($"{url.Key}\n   {string.Join("  \t\n", url.Value)}");
                             }
                         }
+                        if (max == unusedLock.field)
+                        {
+                            //锁定15至少小时。
+                            await _azureRedis.GetRedisClient(8).StringSetAsync($"LessonRecord:Unused:Lock:Lock", "用于在清理完所有Blob容器后,锁定不再进行多次清理。");
+                            await _azureRedis.GetRedisClient(8).KeyExpireAsync($"LessonRecord:Unused:Lock:Lock",  DateTime.UtcNow.AddHours(15)   );
+                        }
+
                         if (content.IsNotEmpty())
                         {
                             string str = string.Join("\n", content);
@@ -353,11 +399,6 @@ namespace TEAMModelOS.FunctionV4.TimeTrigger
             public int status { get; set; }
             public IEnumerable<IdCodeCount> item { get; set; } = new List<IdCodeCount>();
         }
-        public class IdCodeCount { 
-            public string id { get; set; }
-            public string name { get; set; }
-            public string code { get; set; }
-            public int count { get; set; }
-        }
+       
     }
 }

二進制
TEAMModelOS.FunctionV4/ip2region.db


+ 2 - 1
TEAMModelOS.SDK/Helper/Network/IP2Region/IPSearcherExtensions.cs

@@ -2,6 +2,7 @@
 using Microsoft.Extensions.DependencyInjection.Extensions;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -14,7 +15,7 @@ namespace TEAMModelOS.SDK
         {
             if (services == null) throw new ArgumentNullException(nameof(services));
             if (path == null) throw new ArgumentNullException(nameof(path));
-            services.TryAddSingleton(new IPSearcher($"{path}/ip2region.db"));
+            services.TryAddSingleton(new IPSearcher(Path.Combine(path, "ip2region.db")));
             return services;
         }
     }

+ 9 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/RecAppGWInfo.cs

@@ -22,6 +22,8 @@ namespace TEAMModelOS.SDK.Models.Cosmos.BI
         public List<RecApiCnt> apiCnt { get; set; }
         public List<RecIpCnt> ipCnt { get; set; }
         public List<MinuteCnt> minCnts { get; set; }
+        public List<RecRegionCnt> regionCnts { get; set; }
+        
     }
 
     /// <summary>
@@ -51,7 +53,13 @@ namespace TEAMModelOS.SDK.Models.Cosmos.BI
         public string api { get; set; }
         public List<string> ip { get; set; }
     }
-
+    /// <summary>
+    /// 防火墙按照地区统计
+    /// </summary>
+    public record RecRegionCnt : RecCntBas
+    {
+        public string region { get; set; }
+    }
     /// <summary>
     /// 分钟数统计接口数量
     /// </summary>

+ 24 - 0
TEAMModelOS.SDK/Models/Cosmos/Common/LessonRecord.cs

@@ -200,6 +200,29 @@ namespace TEAMModelOS.SDK.Models
         /// 默认未上传
         /// </summary>
         public int upload { get; set; }
+        public LearningCategory learningCategory { get; set; }
+    }
+    public class LearningCategory {
+        /// <summary>
+        /// //合作學習
+        /// </summary>
+        public int cooperation { get; set; }
+        /// <summary>
+        /// 互動學習
+        /// </summary>
+        public int interaction { get; set; }
+        /// <summary>
+        /// 任務學習
+        /// </summary>
+        public int task { get; set; }
+        /// <summary>
+        /// 測驗學習
+        /// </summary>
+        public int exam { get; set; }
+        /// <summary>
+        /// 差異化學習
+        /// </summary>
+        public int diffential { get; set; }
     }
     public class LessonTC
     {
@@ -337,6 +360,7 @@ namespace TEAMModelOS.SDK.Models
         /// </summary>
         public double clientInteractionAverge { get; set; } = 0;
         public int examCount { get; set; }
+        public LearningCategory learningCategory { get; set; }
     }
 
     public class QuizSummaryList

+ 16 - 0
TEAMModelOS.SDK/Models/Dtos/IdCodeCount.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace TEAMModelOS.SDK.Models
+{
+    public class IdCodeCount
+    {
+        public string id { get; set; }
+        public string name { get; set; }
+        public string code { get; set; }
+        public int count { get; set; }
+    }
+}

+ 53 - 6
TEAMModelOS.SDK/Models/Service/BI/BILogAnalyseService.cs

@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using TEAMModelOS.SDK.Context.BI;
 using TEAMModelOS.SDK.DI;
@@ -96,11 +97,14 @@ namespace TEAMModelOS.SDK.Models.Service.BI
         /// <param name="path">防火墙路径</param>
         /// <param name="connectStr">连接字串</param>
         /// <returns></returns>
-        public static async Task<(List<RecCnt> recCnts, List<string> saveUrls)> GetPathAnalyse(AzureStorageFactory _azureStorage,string path, string connectName)
+        public static async Task<(List<RecCnt> recCnts, List<string> saveUrls)> GetPathAnalyse(AzureStorageFactory _azureStorage,IPSearcher _ipSearcher,DingDing _dingDing, string path, string connectName)
         {
             List<RecCnt> recCnts = new();
             List<string> urls = new();
 
+            DateTimeOffset dtime = DateTimeOffset.UtcNow;
+            string cDay = dtime.ToString("yyyyMMdd");
+
             try {
                 var blobClient = _azureStorage.GetBlobContainerClient($"insights-logs-applicationgatewayfirewalllog", name: connectName);
                 await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, path))
@@ -148,13 +152,13 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                     //        aGInfos.Add(item);
                     //}
 
-                    DateTimeOffset dtime = DateTimeOffset.UtcNow;
                     string cHour = dtime.ToString("yyyyMMddHH");
-                    string cDay = dtime.ToString("yyyyMMdd");
+                    string cHH = dtime.ToString("HH");
                     if (aGInfos.Count > 0)
                     {
                         cHour = aGInfos.Select(s => DateTimeOffset.Parse(s.time).ToString("yyyyMMddHH")).First();
                         cDay = aGInfos.Select(s => DateTimeOffset.Parse(s.time).ToString("yyyyMMdd")).First();
+                        cHH = aGInfos.Select(s => DateTimeOffset.Parse(s.time).ToString("HH")).First();
                     }
 
                     RecCnt saveCnts = new();
@@ -170,13 +174,54 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                     List<MinuteCnt> minCnts = recInfo.GroupBy(a => a.minute).Select(s => new MinuteCnt { minute = s.Key, cnt = s.Count() }).ToList();                  
                     saveCnts.minCnts = minCnts;
 
+                    var ipcounts = saveCnts.ipCnt.Select(z => new IdCodeCount { id = z.ip, count = z.count }).ToList();
+                    ipcounts.ForEach(async x => {
+                        string region =await _ipSearcher.SearchIpAsync(x.id);
+                        if (!string.IsNullOrWhiteSpace(region))
+                        {
+                            string[] dis = region.Split("·");
+                            if (dis.Length >= 2)
+                            {
+                                x.code = dis[dis.Length - 1];
+                                x.name = dis[dis.Length - 2];  // 不保留省份
+                                //x.name = region.Substring(0, region.LastIndexOf("·"));  //保留省份
+                            }
+                            else {
+                                var disrs = Regex.Split(region.TrimStart().TrimEnd(), @"\s+");
+                                if (disrs.Length >= 2)
+                                {
+                                    x.code = disrs[disrs.Length - 1];
+                                    x.name = disrs[disrs.Length - 2];   //不保留省份
+                                    //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
+                                }
+                                else {
+                                    x.code = region;
+                                    x.name = region;
+                                }
+                            }
+                        }
+                        else {
+                            x.name = x.id;
+                            x.code = x.id;
+                        }
+                    });
+                    List<RecRegionCnt> regionCnts = new List<RecRegionCnt>();
+                    ipcounts.GroupBy(x => x.name).ToList().ForEach(z => {
+                        regionCnts.Add(new RecRegionCnt { region = z.Key, count = z.ToList().Sum(y => y.count), hour = cHour });
+                    });
+                    saveCnts.regionCnts = regionCnts;
                     recCnts.Add(saveCnts);
                     //保存存至Blob文件
-                    var url = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(saveCnts.ToJsonString(), $"visitCnt/{cDay}", $"{cHour}.json");
-
+                    var url = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(saveCnts.ToJsonString(), $"visitCnt/{cDay}", $"{cHH}.json");
                     urls.Add(url);
                 }
 
+                if (recCnts.Count > 1) 
+                {
+                    //保存一天的数据至Blob文件
+                    var daysUrl = await _azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(recCnts.ToJsonString(), $"visitCnt/{cDay}", $"days.json");
+                }
+                
                 var azureClient = _azureStorage.GetBlobContainerClient("0-public");//获取容器连接地址
                 int expireTime = int.Parse(DateTimeOffset.UtcNow.AddDays(-180).ToString("yyyyMMdd"));
                 await foreach (var blobItem in azureClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix: "visitCnt"))
@@ -191,7 +236,9 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                     }
                 }
 
-            } catch (Exception ex) { }
+            } catch (Exception ex) {
+               await _dingDing.SendBotMsg($"防火墙日志统计异常:{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
+            }
 
             return (recCnts, urls);
         }

+ 3 - 1
TEAMModelOS/ClientApp/src/view/syllabus/Syllabus.vue

@@ -2354,7 +2354,9 @@ export default {
       return this.$store.state.userInfo.name
     },
     getDefaultVolumeName() {
-      return this.hasSchool && this.isSchool ? this.subjectList[this.activeSubjectIndex].name + this.gradeList[this.addVolumeForm.grade] + this.semesterList[this.addVolumeForm.semester].name : ''
+      let isEnUs = localStorage.getItem('local') === 'en-us'
+      // 如果是英文语系状态下 自动拼接的课纲名称中间需要添加空格
+      return this.hasSchool && this.isSchool ? this.subjectList[this.activeSubjectIndex].name + (isEnUs ? ' ' : '') + this.gradeList[this.addVolumeForm.grade] + (isEnUs ? ' ' : '') + this.semesterList[this.addVolumeForm.semester].name : ''
     },
     getGradeName() {
       return index => {

+ 14 - 14
TEAMModelOS/Controllers/Analysis/ClassAnalysisController.cs

@@ -52,16 +52,16 @@ namespace TEAMModelOS.Controllers.Analysis
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("analysis-recod")]
-        public async Task<IActionResult> analysisRecod(JsonElement requert)
+        public async Task<IActionResult> analysisRecod(JsonElement request)
         {
             try
             {
                 //区级Id
-                //if (!requert.TryGetProperty("time", out JsonElement time)) return BadRequest();
-                if (!requert.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
-                if (!requert.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
+                //if (!request.TryGetProperty("time", out JsonElement time)) return BadRequest();
+                if (!request.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
+                if (!request.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
                 long st = stime.GetInt64();
                 long et = etime.GetInt64();
                 //获取当前学期所有的课程记录
@@ -69,7 +69,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 var client = _azureCosmos.GetCosmosClient();
                 var queryClass = $"select value(c) from c where c.periodId = '{pId}'";
                 string tId = string.Empty;
-                if (requert.TryGetProperty("tmdId", out JsonElement tmdId))
+                if (request.TryGetProperty("tmdId", out JsonElement tmdId))
                 {
                     queryClass = $"select value(c) from c where c.tmdid = '{tmdId}' and c.periodId = '{pId}'";
                     tId = tmdId.GetString();
@@ -215,16 +215,16 @@ namespace TEAMModelOS.Controllers.Analysis
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("analysis-recod-teacher")]
-        public async Task<IActionResult> analysisRecordTeacher(JsonElement requert)
+        public async Task<IActionResult> analysisRecordTeacher(JsonElement request)
         {
             try
             {
                 //区级Id
-                //if (!requert.TryGetProperty("time", out JsonElement time)) return BadRequest();
-                if (!requert.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
-                if (!requert.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                //if (!requert.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
+                //if (!request.TryGetProperty("time", out JsonElement time)) return BadRequest();
+                if (!request.TryGetProperty("stime", out JsonElement stime)) return BadRequest();
+                if (!request.TryGetProperty("etime", out JsonElement etime)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                //if (!request.TryGetProperty("periodId", out JsonElement pId)) return BadRequest();
                 long st = 0;
                 long et = 0;
                 try
@@ -247,7 +247,7 @@ namespace TEAMModelOS.Controllers.Analysis
                 var client = _azureCosmos.GetCosmosClient();
                 var queryClass = $"select value(c) from c ";
                 string tId = string.Empty;
-                if (requert.TryGetProperty("tmdId", out JsonElement tmdId))
+                if (request.TryGetProperty("tmdId", out JsonElement tmdId))
                 {
                     queryClass = $"select value(c) from c where c.tmdid = '{tmdId}'";
                     tId = tmdId.GetString();

+ 55 - 55
TEAMModelOS/Controllers/Both/CourseController.cs

@@ -68,16 +68,16 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
 #endif
 
-        public async Task<IActionResult> upsert(JsonElement requert)
+        public async Task<IActionResult> upsert(JsonElement request)
         {
             try
             {
                 (string id, _, _, string school) = HttpContext.GetAuthTokenInfo();
-                if (!requert.TryGetProperty("option", out JsonElement option)) return BadRequest();
-                if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+                if (!request.TryGetProperty("option", out JsonElement option)) return BadRequest();
+                if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
                 Course course = null; 
                 var client = _azureCosmos.GetCosmosClient();
-                if (requert.TryGetProperty("course", out JsonElement _course)) {
+                if (request.TryGetProperty("course", out JsonElement _course)) {
                     course = _course.ToObject<Course>();
 
                     course.pk = typeof(Course).Name;
@@ -136,7 +136,7 @@ namespace TEAMModelOS.Controllers
                         return Ok(new { course });
                 }
                 else if ($"{option}".Equals("import")  && $"{scope}".Equals("school", StringComparison.OrdinalIgnoreCase)) {
-                    if (!requert.TryGetProperty("courses", out JsonElement _courses)) return BadRequest();
+                    if (!request.TryGetProperty("courses", out JsonElement _courses)) return BadRequest();
                     List<Course> courses = _courses.ToObject<List<Course>>();
                     if (courses.IsNotEmpty())
                     {
@@ -398,11 +398,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
-            requert.TryGetProperty("period", out JsonElement _period) ;
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            request.TryGetProperty("period", out JsonElement _period) ;
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -412,14 +412,14 @@ namespace TEAMModelOS.Controllers
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 //bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     //iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -464,7 +464,7 @@ namespace TEAMModelOS.Controllers
                         }
                         //break;
                     }
-                    if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
+                    if (request.TryGetProperty("schoolId", out JsonElement schoolId))
                     {
                         var querySchool = $"select distinct c.code,c.id,c.no,c.name,c.period,c.subject,c.scope from c join A0 in c.schedule where A0.teacherId = '{code}'";
                          
@@ -513,11 +513,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-all-by-teacher")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            //if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
-            //if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            //if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+            //if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
 
             try
             {
@@ -560,7 +560,7 @@ namespace TEAMModelOS.Controllers
                     }
                     ps.Add((s, n, sc, sName));
                 }
-                if (requert.TryGetProperty("schoolId", out JsonElement schoolId))
+                if (request.TryGetProperty("schoolId", out JsonElement schoolId))
                 {
                     var querySchool = $"select distinct c.code,c.id,c.no,c.name,c.scope from c join A0 in c.schedule where A0.teacherId = '{code}'";
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: querySchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{schoolId.GetString()}") }))
@@ -642,13 +642,13 @@ namespace TEAMModelOS.Controllers
 #if !DEBUG
         [Authorize(Roles = "IES")]
 #endif
-        public async Task<IActionResult> DelStulistRmvRelCourse(JsonElement requert) {
+        public async Task<IActionResult> DelStulistRmvRelCourse(JsonElement request) {
             //教师编码
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             //课程id 
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             //名单id 
-            if (!requert.TryGetProperty("stulist", out JsonElement stulist)) return BadRequest();
+            if (!request.TryGetProperty("stulist", out JsonElement stulist)) return BadRequest();
             try {
                 var client = _azureCosmos.GetCosmosClient();
                 List<Course> courses = new List<Course>();
@@ -690,12 +690,12 @@ namespace TEAMModelOS.Controllers
 #if !DEBUG
         [Authorize(Roles = "IES")]
 #endif
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
 
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -944,26 +944,26 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("upsert-management")]
-        //public async Task<IActionResult> upsertCourseManagement(CourseManagement requert)
+        //public async Task<IActionResult> upsertCourseManagement(CourseManagement request)
         //{
         //    try
         //    {
         //        CourseManagement course = new CourseManagement();
         //        //course = room.ToObject<CourseManagement>();
         //        var client = _azureCosmos.GetCosmosClient();
-        //        string code = requert.code;
-        //        requert.code = "CourseManagement-" + requert.code;
-        //        /*                if (requert.scope.Equals) { 
+        //        string code = request.code;
+        //        request.code = "CourseManagement-" + request.code;
+        //        /*                if (request.scope.Equals) { 
 
         //                        }*/
-        //        var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(requert.id, new PartitionKey($"CourseManagement-{code}"));
+        //        var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(request.id, new PartitionKey($"CourseManagement-{code}"));
         //        if (response.Status == 200)
         //        {
-        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(requert, requert.id, new PartitionKey($"CourseManagement-{code}"));
+        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(request, request.id, new PartitionKey($"CourseManagement-{code}"));
         //        }
         //        else
         //        {
-        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync(requert, new PartitionKey($"CourseManagement-{code}"));
+        //            course = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync(request, new PartitionKey($"CourseManagement-{code}"));
         //        }
         //        return Ok(new { course });
         //    }
@@ -983,16 +983,16 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("find-management")]
-        //public async Task<IActionResult> FindManagement(JsonElement requert)
+        //public async Task<IActionResult> FindManagement(JsonElement request)
         //{
-        //    //if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-        //    if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+        //    //if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+        //    if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
         //    var client = _azureCosmos.GetCosmosClient();
         //    List<object> courses = new List<object>();
         //    StringBuilder sql = new StringBuilder();
         //    sql.Append("select c.code,c.id,c.name,c.courses,c.scope,c.teacher from c ");
         //    Dictionary<string, object> dict = new Dictionary<string, object>();
-        //    var emobj = requert.EnumerateObject();
+        //    var emobj = request.EnumerateObject();
         //    while (emobj.MoveNext())
         //    {
         //        dict[emobj.Current.Name] = emobj.Current.Value;
@@ -1019,10 +1019,10 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("find-course")]
-        //public async Task<IActionResult> FindCourse(JsonElement requert)
+        //public async Task<IActionResult> FindCourse(JsonElement request)
         //{
-        //    if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-        //    if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+        //    if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+        //    if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
         //    var client = _azureCosmos.GetCosmosClient();
         //    List<object> courses = new List<object>();
         //    var query = $"select c.code,c.id,c.name,A0.course.id courseId,A0.course.name courseName ,A0.course.notice notice ,A1,c.scope,c.teacher from c  join A0  in c.courses join A1  in A0.teachers where A1.id = '{id}' ";
@@ -1043,11 +1043,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-course-by-room")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindCourseByRoom(JsonElement requert)
+        public async Task<IActionResult> FindCourseByRoom(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             HashSet<Course> courseList = new HashSet<Course>();
             List<object> courses = new List<object>();
@@ -1131,13 +1131,13 @@ namespace TEAMModelOS.Controllers
         //[ProducesDefaultResponseType]
         ////[AuthToken(Roles = "Teacher")]
         //[HttpPost("upsert-notice")]
-        //public async Task<IActionResult> upsertNotice(JsonElement requert)
+        //public async Task<IActionResult> upsertNotice(JsonElement request)
         //{
-        //    if (!requert.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
-        //    if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-        //    if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-        //    if (!requert.TryGetProperty("notice", out JsonElement notice)) return BadRequest();
-        //    if (!requert.TryGetProperty("A1", out JsonElement teacherInfo)) return BadRequest();
+        //    if (!request.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
+        //    if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+        //    if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+        //    if (!request.TryGetProperty("notice", out JsonElement notice)) return BadRequest();
+        //    if (!request.TryGetProperty("A1", out JsonElement teacherInfo)) return BadRequest();
         //    Teachers teachers = teacherInfo.ToObject<Teachers>();
         //    var client = _azureCosmos.GetCosmosClient();
         //    List<CourseManagement> courseManagements = new List<CourseManagement>();
@@ -1183,13 +1183,13 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("upsert-teacher-course")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> upsertCourse(JsonElement requert)
+        public async Task<IActionResult> upsertCourse(JsonElement request)
         {
             try
             {
                 TeacherCourse course = new TeacherCourse();
-                if (!requert.TryGetProperty("course", out JsonElement room)) return BadRequest();
-                if (!requert.TryGetProperty("option", out JsonElement option)) return BadRequest();
+                if (!request.TryGetProperty("course", out JsonElement room)) return BadRequest();
+                if (!request.TryGetProperty("option", out JsonElement option)) return BadRequest();
                 course = room.ToObject<TeacherCourse>();
                 var client = _azureCosmos.GetCosmosClient();
                 course.pk = typeof(Course).Name;
@@ -1283,10 +1283,10 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-teacher-course")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindTeacherCourse(JsonElement requert)
+        public async Task<IActionResult> FindTeacherCourse(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<object> courses = new List<object>();
             var query = $"select c.code,c.id,c.name,c.subjectId,c.periodId,c.scope,c.notice,c.classes from c ";

+ 8 - 8
TEAMModelOS/Controllers/Both/PaperController.cs

@@ -89,11 +89,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-summary")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> findSummary(JsonElement requert)
+        public async Task<IActionResult> findSummary(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
-            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             var jwt = new JwtSecurityToken(id_token.GetString());
             var id = jwt.Payload.Sub;
             var client = _azureCosmos.GetCosmosClient();
@@ -134,16 +134,16 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
-            //if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+            //if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             StringBuilder sql = new StringBuilder();
             Dictionary<string, object> dict = new Dictionary<string, object>();
-            var emobj = requert.EnumerateObject();
+            var emobj = request.EnumerateObject();
             while (emobj.MoveNext())
             {
                 dict[emobj.Current.Name] = emobj.Current.Value;

+ 2 - 2
TEAMModelOS/Controllers/Client/AClassONEController.cs

@@ -285,13 +285,13 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         //[Authorize(Roles = "AClassONE")]
         [HttpPost("find-activity")]
-        public async Task<IActionResult> FindExam(JsonElement requert)
+        public async Task<IActionResult> FindExam(JsonElement request)
         {
             try
             {
                 //var client = _azureCosmos.GetCosmosClient();
                 var (id, name, pic, school) = HttpContext.GetAuthTokenInfo();
-                (List<StuActivity> datas, string continuationToken) = await ActivityStudentService.FindActivity(requert, id, school, _azureCosmos, _azureRedis);
+                (List<StuActivity> datas, string continuationToken) = await ActivityStudentService.FindActivity(request, id, school, _azureCosmos, _azureRedis);
                 return Ok(new { datas, continuationToken });
 
 

+ 2 - 2
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -628,14 +628,14 @@ namespace TEAMModelOS.Controllers.Client
 
         [ProducesDefaultResponseType]
         [HttpPost("get-school-info")]
-        public async Task<IActionResult> GetSchoolInfo(JsonElement requert)
+        public async Task<IActionResult> GetSchoolInfo(JsonElement request)
         {
             try
             {
                 string id_token = HttpContext.GetXAuth("IdToken");
                 (string ip, string region) = await LoginService.LoginIp(HttpContext, _searcher);
                 if (string.IsNullOrEmpty(id_token)) return BadRequest();
-                if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+                if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
                 var jwt = new JwtSecurityToken(id_token);
                 if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
                 var id = jwt.Payload.Sub;

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

@@ -58,12 +58,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-group")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //获取区级以下所有学校编码和基础信息
                 List<string> baseIds = new();
@@ -128,12 +128,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> FindGroup(JsonElement requert)
+        public async Task<IActionResult> FindGroup(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //获取区级以下所有学校编码和基础信息
                 List<string> baseIds = new();
@@ -389,12 +389,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-study")]
-        public async Task<IActionResult> FindAllStudy(JsonElement requert)
+        public async Task<IActionResult> FindAllStudy(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 // List<string> baseIds = await getId(client, id.GetString());
                 List<object> studies = new();
@@ -429,13 +429,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-study-teachers")]
-        public async Task<IActionResult> FindAllStudyTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllStudyTeacher(JsonElement request)
         {
             try
             {
                 //区级活动Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<Study> studies = new();
@@ -546,12 +546,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-vote")]
-        public async Task<IActionResult> FindAllVote(JsonElement requert)
+        public async Task<IActionResult> FindAllVote(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //List<string> baseIds = await getId(client, id.GetString());
                 List<object> votes = new();
@@ -583,13 +583,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-vote-id")]
-        public async Task<IActionResult> FindAllVoteTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllVoteTeacher(JsonElement request)
         {
             try
             {
                 //区级活动Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 //List<object> votes = new();
@@ -641,12 +641,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-survey")]
-        public async Task<IActionResult> FindAllSurvey(JsonElement requert)
+        public async Task<IActionResult> FindAllSurvey(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //List<string> baseIds = await getId(client, id.GetString());
                 List<object> surveys = new();
@@ -680,12 +680,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-survey-id")]
-        public async Task<IActionResult> FindAllSurveyTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllSurveyTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<object> surveys = new();
@@ -735,12 +735,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-Exam")]
-        public async Task<IActionResult> FindAllExam(JsonElement requert)
+        public async Task<IActionResult> FindAllExam(JsonElement request)
         {
             try
             {
                 //区级Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 //List<string> baseIds = await getId(client, id.GetString());
                 List<object> exams = new();
@@ -775,13 +775,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-all-exam-teachers")]
-        public async Task<IActionResult> FindAllExamTeacher(JsonElement requert)
+        public async Task<IActionResult> FindAllExamTeacher(JsonElement request)
         {
             try
             {
                 //区级活动Id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<(string id, string name)> baseIds = await getId(client, areaId.GetString());
                 List<object> exams = new();

+ 117 - 117
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -423,14 +423,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 StringBuilder stringBuilder = new($"select c.id,c.name,c.code,c.period,c.startTime,c.endTime,c.stuCount,c.type,c.progress,c.examType,c.createTime,c.source, c.subjects, c.grades,c.owner, c.scope,c.classes, c.stuLists, c.sRate,c.lostStu,c.sStatus,c.qamode,c.school from c where (c.status<>404 or IS_DEFINED(c.status) = false) ");
-                if (requert.TryGetProperty("classIds", out JsonElement classIds))
+                if (request.TryGetProperty("classIds", out JsonElement classIds))
                 {
                     List<string> ids = classIds.ToObject<List<string>>();
                     HashSet<string> strs = new HashSet<string>();
@@ -449,19 +449,19 @@ namespace TEAMModelOS.Controllers
                     string ss = string.Join(" or ", strs);
                     stringBuilder.Append($" and {ss}");
                 };
-                if (requert.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
+                if (request.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
                 {
                     stringBuilder.Append($" and c.period.id = '{period}' ");
                 }
-                if (requert.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
+                if (request.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
                 {
                     stringBuilder.Append($" and Contains( c.name , '{name}') =  true ");
                 }
-                if (requert.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
+                if (request.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
                 {
                     stringBuilder.Append($" and c.progress = '{progress}' ");
                 }
-                if (requert.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
+                if (request.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
                 {
                     stringBuilder.Append($" and c.source = '{source}' ");
                 }
@@ -470,7 +470,7 @@ namespace TEAMModelOS.Controllers
                 string token = default;
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -484,7 +484,7 @@ namespace TEAMModelOS.Controllers
                     iscontinuation = true;
                 }
                 //如果指定了返回大小
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     if (!token_1.ValueKind.Equals(JsonValueKind.Null) && token_1.ValueKind.Equals(JsonValueKind.String))
                     {
@@ -527,11 +527,11 @@ namespace TEAMModelOS.Controllers
 /*        [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]*/
         [HttpPost("find-by-analysis")]
-        public async Task<IActionResult> FindByAnalysis(JsonElement requert)
+        public async Task<IActionResult> FindByAnalysis(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("SchoolYear");
                 List<SchoolYear> years = await table.FindListByDict<SchoolYear>(new Dictionary<string, object>() { { "RowKey", code }, { "PartitionKey", "Exam" } });
@@ -589,49 +589,49 @@ namespace TEAMModelOS.Controllers
                 }
                 string sub = string.Empty;
                 string subject = string.Empty;
-                if (requert.TryGetProperty("subjectId", out JsonElement subjectId) && !string.IsNullOrWhiteSpace($"{subjectId}"))
+                if (request.TryGetProperty("subjectId", out JsonElement subjectId) && !string.IsNullOrWhiteSpace($"{subjectId}"))
                 {
                     sub = $" join A0 in c.subjects ";
                     subject = $" and A0.id = '{subjectId}'";
                 }
                 string grade = string.Empty;
                 string grades = string.Empty;
-                if (requert.TryGetProperty("grades", out JsonElement gs) && !string.IsNullOrWhiteSpace($"{gs}"))
+                if (request.TryGetProperty("grades", out JsonElement gs) && !string.IsNullOrWhiteSpace($"{gs}"))
                 {
                     grade = $" join A1 in c.grades ";
                     grades = $" and A1.id = '{gs}'";
                 }
                 StringBuilder stringBuilder = new StringBuilder($"select c.id,c.name,c.code,c.period,c.startTime,c.endTime,c.stuCount,c.type,c.progress,c.examType,c.createTime,c.source, c.subjects, c.grades,c.owner, c.scope,c.classes,c.sRate,c.lostStu,c.sStatus,c.qamode,c.school from c {sub} {grade}" +
                     $"where (c.status<>404 or IS_DEFINED(c.status) = false) and c.scope = 'school' and c.school = '{code}' and c.pk = 'Exam' {subject} {grades}");
-                if (requert.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
+                if (request.TryGetProperty("period", out JsonElement period) && !string.IsNullOrWhiteSpace($"{period}"))
                 {
                     stringBuilder.Append($" and c.period.id = '{period}' ");
                 }
-                if (requert.TryGetProperty("owner", out JsonElement owner) && !string.IsNullOrWhiteSpace($"{owner}"))
+                if (request.TryGetProperty("owner", out JsonElement owner) && !string.IsNullOrWhiteSpace($"{owner}"))
                 {
                     stringBuilder.Append($" and c.owner= '{owner}' ");
                 }
                 
-                if (requert.TryGetProperty("year", out JsonElement yy) && !string.IsNullOrWhiteSpace($"{yy}"))
+                if (request.TryGetProperty("year", out JsonElement yy) && !string.IsNullOrWhiteSpace($"{yy}"))
                 {
                     int end = yy.GetInt32() + 1;
                     long stime = DateTimeOffset.Parse($"{yy.GetInt32()}-1-1").ToUnixTimeMilliseconds();
                     long etime = DateTimeOffset.Parse($"{end}-1-1").ToUnixTimeMilliseconds();
                     stringBuilder.Append($" and c.startTime >= {stime} and c.startTime < {etime} ");
                 }
-                if (requert.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
+                if (request.TryGetProperty("name", out JsonElement name) && !string.IsNullOrWhiteSpace($"{name}"))
                 {
                     stringBuilder.Append($" and Contains( c.name , '{name}') =  true ");
                 }
-                if (requert.TryGetProperty("examType", out JsonElement examType) && !string.IsNullOrWhiteSpace($"{examType}"))
+                if (request.TryGetProperty("examType", out JsonElement examType) && !string.IsNullOrWhiteSpace($"{examType}"))
                 {
                     stringBuilder.Append($" and c.examType.id = '{examType}' ");
                 }
-                if (requert.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
+                if (request.TryGetProperty("progress", out JsonElement progress) && !string.IsNullOrWhiteSpace($"{progress}"))
                 {
                     stringBuilder.Append($" and c.progress = '{progress}' ");
                 }
-                if (requert.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
+                if (request.TryGetProperty("source", out JsonElement source) && !string.IsNullOrWhiteSpace($"{source}"))
                 {
                     stringBuilder.Append($" and c.source = '{source}' ");
                 }
@@ -639,13 +639,13 @@ namespace TEAMModelOS.Controllers
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -703,12 +703,12 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
 
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamInfo> examInfo = new List<ExamInfo>();
@@ -1347,14 +1347,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary-record")]
-        public async Task<IActionResult> findSummaryRecord(JsonElement requert)
+        public async Task<IActionResult> findSummaryRecord(JsonElement request)
         {
             //var (id, school) = HttpContext.GetAuthTokenInfo();
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
-            if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
-            if (!requert.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("classId", out JsonElement classId)) return BadRequest();
             try
             {
                 // 如果只有学生id则返回学生参加过的考试 只返回相关摘要信息
@@ -1484,7 +1484,7 @@ namespace TEAMModelOS.Controllers
                 //List<ufo> students = new List<ufo>();
 
 
-                /*if (StringHelper.getKeyCount(requert) == 1 && requert.TryGetProperty("code", out JsonElement code))
+                /*if (StringHelper.getKeyCount(request) == 1 && request.TryGetProperty("code", out JsonElement code))
                 {
                     List<object> props = new List<object>();
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Student").GetItemQueryStreamIterator(queryText: $"select c.id, c.code, c.examCode, c.status ,c.mark, c.score from c where c.id = {id}", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamRecord-{school_code}") }))
@@ -1502,7 +1502,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    if (requert.TryGetProperty("examCode", out JsonElement _))
+                    if (request.TryGetProperty("examCode", out JsonElement _))
                     {
                         //List<string> props = new List<string> { "id", "code", "examCode", "status", "mark", "score" };
                         //List<ExamRecord> examRecords = await _azureCosmos.FindByDict<ExamRecord>(request, props);
@@ -1536,15 +1536,15 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "student,teacher,admin")]
         [HttpPost("find-summary-by-student")]
-        public async Task<IActionResult> findSummaryStudent(JsonElement requert)
+        public async Task<IActionResult> findSummaryStudent(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("cIds", out JsonElement cIds)) return BadRequest();
-            if (!requert.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement school)) return BadRequest();
-            if (!requert.TryGetProperty("scode", out JsonElement scode)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("cIds", out JsonElement cIds)) return BadRequest();
+            if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement school)) return BadRequest();
+            if (!request.TryGetProperty("scode", out JsonElement scode)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -1916,14 +1916,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "student")]
         [HttpPost("find-all-by-student")]
-        public async Task<IActionResult> findAllStudent(JsonElement requert)
+        public async Task<IActionResult> findAllStudent(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
                 List<string> resultIds = new List<string>();
                 var client = _azureCosmos.GetCosmosClient();
                 //查询校本班级ID
@@ -1975,7 +1975,7 @@ namespace TEAMModelOS.Controllers
                     //builder.Append($" array_contains(c.targetClassIds,'{ssr}')");
                 }
                 string ss = string.Join(" or ", strs);
-                //if (!requert.TryGetProperty("school", out JsonElement school)) return BadRequest();
+                //if (!request.TryGetProperty("school", out JsonElement school)) return BadRequest();
 
                 var query = $"select c.id,c.code,c.name,c.startTime,c.endTime,c.type,c.progress,c.school,c.scope from c where ({ss}) and c.progress != 'pending' ";
                 List<object> props = new List<object>();
@@ -2030,14 +2030,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "student")]
         [HttpPost("find-score-by-student")]
-        public async Task<IActionResult> findScoreByStudent(JsonElement requert)
+        public async Task<IActionResult> findScoreByStudent(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.examId,c.subjectId,c.studentScores from c where array_contains(c.studentIds,'{id}') ";
                 List<object> props = new List<object>();
@@ -2069,14 +2069,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("finish")]
-        public async Task<IActionResult> finish(JsonElement requert)
+        public async Task<IActionResult> finish(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 ExamInfo info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 info.progress = "finish";
@@ -2122,15 +2122,15 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "Student")]
         [HttpPost("scoring")]
-        public async Task<IActionResult> Scoring(JsonElement requert)
+        public async Task<IActionResult> Scoring(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 ExamInfo info = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamInfo>(id.ToString(), new PartitionKey($"Exam-{code}"));
                 int index = 0;
@@ -2207,18 +2207,18 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("scoring")]
-        public async Task<IActionResult> scoring(JsonElement requert)
+        public async Task<IActionResult> scoring(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-                //if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
-                if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
-                if (!requert.TryGetProperty("count", out JsonElement scount)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                //if (!request.TryGetProperty("type", out JsonElement type)) return BadRequest();
+                if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("count", out JsonElement scount)) return BadRequest();
 
                 var client = _azureCosmos.GetCosmosClient();
                 //var redisClient = _azureRedis.GetRedisClient(8);
@@ -2329,7 +2329,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    if (requert.TryGetProperty("stuId", out JsonElement stuId))
+                    if (request.TryGetProperty("stuId", out JsonElement stuId))
                     {
                         objs = await Review(attrSc, id.GetString(), code.GetString(), subjectId.GetString(), scount.GetInt32(), tId.GetString(), stuId.GetString());
                     }
@@ -2356,16 +2356,16 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-err")]
-        public async Task<IActionResult> findErr(JsonElement requert)
+        public async Task<IActionResult> findErr(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-                //if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                //if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var response = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"Exam-{code}"));
                 if (response.Status == 200)
@@ -2424,17 +2424,17 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-arb")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> findArb(JsonElement requert)
+        public async Task<IActionResult> findArb(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-                if (!requert.TryGetProperty("et", out JsonElement et)) return BadRequest();
-                //if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!request.TryGetProperty("et", out JsonElement et)) return BadRequest();
+                //if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 long time = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 if (et.GetInt64() > time)
@@ -2694,20 +2694,20 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("sub-result")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> SubResult(JsonElement requert)
+        public async Task<IActionResult> SubResult(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
-                if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-                if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
-                if (!requert.TryGetProperty("score", out JsonElement score)) return BadRequest();
-                if (!requert.TryGetProperty("count", out JsonElement count)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                requert.TryGetProperty("mark", out JsonElement mark);
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
+                if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("score", out JsonElement score)) return BadRequest();
+                if (!request.TryGetProperty("count", out JsonElement count)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                request.TryGetProperty("mark", out JsonElement mark);
                 var client = _azureCosmos.GetCosmosClient();
                 var (userid, name, _, school) = HttpContext.GetAuthTokenInfo();
                 //取得学校基本信息
@@ -2738,7 +2738,7 @@ namespace TEAMModelOS.Controllers
                     {
                         int itemIndex = 0;
                         //int tIdIndex = scoring.tIds.IndexOf(tId.GetString());
-                        if (requert.TryGetProperty("qu", out JsonElement qu))
+                        if (request.TryGetProperty("qu", out JsonElement qu))
                         {
                             List<int> nos = qu.ToObject<List<int>>();
                             foreach (int number in nos)
@@ -2953,14 +2953,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-scoring")]
-        public async Task<IActionResult> findScoring(JsonElement requert)
+        public async Task<IActionResult> findScoring(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
-            if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-            if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
-            if (!requert.TryGetProperty("type", out JsonElement type)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("stuId", out JsonElement sId)) return BadRequest();
+            if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+            if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+            if (!request.TryGetProperty("type", out JsonElement type)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<SDK.Models.Cosmos.Common.Scoring> attr = new();
             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(
@@ -2977,13 +2977,13 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("save-err")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> saveErr(JsonElement requert)
+        public async Task<IActionResult> saveErr(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("err", out JsonElement err)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("index", out JsonElement index)) return BadRequest();
-            if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("err", out JsonElement err)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("index", out JsonElement index)) return BadRequest();
+            if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             var (userid, name, _, school) = HttpContext.GetAuthTokenInfo();
             //取得学校基本信息
@@ -3056,13 +3056,13 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("fd-err")]
-        public async Task<IActionResult> fdErr(JsonElement requert)
+        public async Task<IActionResult> fdErr(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("improve", out JsonElement improve)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("index", out JsonElement index)) return BadRequest();
-            //if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("improve", out JsonElement improve)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("index", out JsonElement index)) return BadRequest();
+            //if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             SDK.Models.Cosmos.Common.Scoring scoring = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<SDK.Models.Cosmos.Common.Scoring>(id.GetString(), new PartitionKey($"Scoring-{code}"));
             if (null != scoring)
@@ -3094,12 +3094,12 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("save-arb")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> saveArb(JsonElement requert)
+        public async Task<IActionResult> saveArb(JsonElement request)
         {
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            if (!requert.TryGetProperty("score", out JsonElement score)) return BadRequest();
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-            if (!requert.TryGetProperty("index", out JsonElement indexScore)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("score", out JsonElement score)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("index", out JsonElement indexScore)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             //List<double> scs = score.ToObject<List<double>>();
             List<ExamClassResult> classResults = new();
@@ -3140,11 +3140,11 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin,student")]
         [HttpPost("score")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> score(JsonElement requert)
+        public async Task<IActionResult> score(JsonElement request)
         {
-            if (!requert.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
-            if (!requert.TryGetProperty("cId", out JsonElement cId)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("courseId", out JsonElement courseId)) return BadRequest();
+            if (!request.TryGetProperty("cId", out JsonElement cId)) return BadRequest();
+            //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<(string eId, string cId, string cname, List<string> sIds, List<double> sum)> classResults = new();
             List<string> eIds = new();
@@ -3182,7 +3182,7 @@ namespace TEAMModelOS.Controllers
                 }
             }
             string sub = string.Empty;
-            if (requert.TryGetProperty("subjectId", out JsonElement subjectId))
+            if (request.TryGetProperty("subjectId", out JsonElement subjectId))
             {
                 sub = subjectId.GetString();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(
@@ -3265,7 +3265,7 @@ namespace TEAMModelOS.Controllers
                 papers = exam.Where(e => e.id.Equals(x.eId)).FirstOrDefault().points,
                 sum = x.sum
             });
-            if (requert.TryGetProperty("stuId", out JsonElement stuId))
+            if (request.TryGetProperty("stuId", out JsonElement stuId))
             {
                 var info = scores.Where(x => !string.IsNullOrEmpty(x.examName) && x.studentIds.Contains(stuId.GetString())).Select(x => new
                 {
@@ -3307,14 +3307,14 @@ namespace TEAMModelOS.Controllers
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("analysis-scoring")]
-        public async Task<IActionResult> Analysis(JsonElement requert)
+        public async Task<IActionResult> Analysis(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                //if (!requert.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
-                //if (!requert.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                //if (!request.TryGetProperty("subjectId", out JsonElement subjectId)) return BadRequest();
+                //if (!request.TryGetProperty("tmdId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var queryTeacher = $"select c.id,c.name from c ";
                 //List<object> props = new List<object>();

+ 14 - 14
TEAMModelOS/Controllers/Common/ExamLiteController.cs

@@ -195,25 +195,25 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime from c where (c.status<>404 or IS_DEFINED(c.status) = false )   ";
                 string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -254,12 +254,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamLite> trExams = new();
                 ExamLite examLite = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<ExamLite>(id.GetString(), new PartitionKey($"ExamLite-{code}"));
@@ -290,12 +290,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-by-teacher")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,A0.time from c join A0 in c.teachers where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}'";
                 List<object> exams = new();
@@ -325,13 +325,13 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary-by-teacher")]
-        public async Task<IActionResult> FindSummaryByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> exams = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamLite-{code}") }))

+ 29 - 29
TEAMModelOS/Controllers/Common/LearnController.cs

@@ -34,9 +34,9 @@ namespace TEAMModelOS.Controllers.Learn
 //        [HttpPost("upsert-task")]
 //        public async Task<IActionResult> UpsertTask(LearnTask request)
 //        {
-//            /*//if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-//            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+//            /*//if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
 //           *//* var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*//*
@@ -51,12 +51,12 @@ namespace TEAMModelOS.Controllers.Learn
 //            else
 //            {
 //                //如果沒有,則初始化LearnTask
-//                requert.TryGetProperty("endTime", out JsonElement endTime);
-//                requert.TryGetProperty("status", out JsonElement status);
-//                requert.TryGetProperty("type", out JsonElement type);
-//                requert.TryGetInt64(out long createTime);
-//                requert.TryGetProperty("stage", out JsonElement stage);
-//                requert.TryGetProperty("passScore", out JsonElement passScore);
+//                request.TryGetProperty("endTime", out JsonElement endTime);
+//                request.TryGetProperty("status", out JsonElement status);
+//                request.TryGetProperty("type", out JsonElement type);
+//                request.TryGetInt64(out long createTime);
+//                request.TryGetProperty("stage", out JsonElement stage);
+//                request.TryGetProperty("passScore", out JsonElement passScore);
 
 //                if (createTime <= 0)
 //                {
@@ -127,13 +127,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-task")]
-//        public async Task<IActionResult> FindTask(JsonElement requert)
+//        public async Task<IActionResult> FindTask(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/
@@ -207,8 +207,8 @@ namespace TEAMModelOS.Controllers.Learn
 //            }
 
 //            return Ok(new { learnUnit });
-//            /*if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
-//            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+//            /*if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+//            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;
@@ -223,12 +223,12 @@ namespace TEAMModelOS.Controllers.Learn
 //            else
 //            {
 //                //如果沒有,則初始化LearnTask
-//                requert.TryGetProperty("endTime", out JsonElement endTime);
-//                requert.TryGetProperty("status", out JsonElement status);
-//                requert.TryGetProperty("type", out JsonElement type);
-//                //requert.TryGetInt64(out long createTime);
-//                requert.TryGetProperty("stage", out JsonElement stage);
-//                requert.TryGetProperty("passScore", out JsonElement passScore);
+//                request.TryGetProperty("endTime", out JsonElement endTime);
+//                request.TryGetProperty("status", out JsonElement status);
+//                request.TryGetProperty("type", out JsonElement type);
+//                //request.TryGetInt64(out long createTime);
+//                request.TryGetProperty("stage", out JsonElement stage);
+//                request.TryGetProperty("passScore", out JsonElement passScore);
 //                long createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
 //                using var stream = new MemoryStream();
 //                using var writer = new Utf8JsonWriter(stream); //new JsonWriterOptions() { Indented = true }
@@ -272,13 +272,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-unit")]
-//        public async Task<IActionResult> FindUnit(JsonElement requert)
+//        public async Task<IActionResult> FindUnit(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+//            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/
@@ -359,13 +359,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-process")]
-//        public async Task<IActionResult> FindProcess(JsonElement requert)
+//        public async Task<IActionResult> FindProcess(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/
@@ -444,13 +444,13 @@ namespace TEAMModelOS.Controllers.Learn
 //        /// <returns></returns>
 //        [ProducesDefaultResponseType]
 //        [HttpPost("find-record")]
-//        public async Task<IActionResult> FindRecord(JsonElement requert)
+//        public async Task<IActionResult> FindRecord(JsonElement request)
 //        {
 
 //            var client = _azureCosmos.GetCosmosClient();
-//            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+//            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
 //            //var (id, name, picture, _) = HttpContext.GetAuthTokenInfo();
-///*            if (!requert.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
+///*            if (!request.TryGetProperty("id_token", out JsonElement id_token)) return BadRequest();
 //            var jwt = new JwtSecurityToken(id_token.GetString());
 //            if (!jwt.Payload.Iss.Equals("account.teammodel", StringComparison.Ordinal)) return BadRequest();
 //            var id = jwt.Payload.Sub;*/

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

@@ -410,25 +410,25 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.img,c.name,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress,c.groupLists from c where (c.status<>404 or IS_DEFINED(c.status) = false )    ";
                 string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -469,12 +469,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 Study study = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<Study>(id.GetString(), new PartitionKey($"Study-{code}"));
                 if (study != null)
@@ -556,12 +556,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-by-teacher")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.img,c.name,c.startTime,c.type,c.endTime,c.presenter,c.topic,c.address,c.owner from c join A0 in c.teachers where A0.id = '{tId}'";
                 List<object> studies = new();
@@ -591,13 +591,13 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-summary-by-teacher")]
-        public async Task<IActionResult> FindSummaryByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<object> studies = 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($"Study-{code}") }))

+ 10 - 10
TEAMModelOS/Controllers/Common/SurveyController.cs

@@ -208,15 +208,15 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try {
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 //开始时间,
                 var stimestamp ="";
-                if (requert.TryGetProperty("stime", out JsonElement stime))
+                if (request.TryGetProperty("stime", out JsonElement stime))
                 {
                     if (long.TryParse($"{stime}",out long data))
                     {
@@ -227,7 +227,7 @@ namespace TEAMModelOS.Controllers
                 };
                 //默认当前时间
                 var etimestamp ="";
-                if (requert.TryGetProperty("etime", out JsonElement etime))
+                if (request.TryGetProperty("etime", out JsonElement etime))
                 {
                     if (long.TryParse($"{etime}",out long data))
                     {
@@ -235,7 +235,7 @@ namespace TEAMModelOS.Controllers
                     };
                 };
                 var progresssql = "";
-                if (requert.TryGetProperty("progress", out JsonElement progress))
+                if (request.TryGetProperty("progress", out JsonElement progress))
                 {
 
                     if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
@@ -246,7 +246,7 @@ namespace TEAMModelOS.Controllers
                 string continuationToken = null;
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (int.TryParse($"{jcount}",out int data))
                     {
@@ -256,7 +256,7 @@ namespace TEAMModelOS.Controllers
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
                 //如果指定了返回大小
-                if (requert.TryGetProperty("continuationToken", out JsonElement continuation))
+                if (request.TryGetProperty("continuationToken", out JsonElement continuation))
                 {
                     //指定了cancellationToken 表示需要进行分页
                     if (!continuation.ValueKind.Equals(JsonValueKind.Null) && !continuation.ValueKind.Equals(JsonValueKind.Undefined))
@@ -330,13 +330,13 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             Survey survey = null;
             //活动id
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             //活动分区
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();

+ 11 - 11
TEAMModelOS/Controllers/Common/VoteController.cs

@@ -200,16 +200,16 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 //开始时间,
                 var stimestamp = "";
-                if (requert.TryGetProperty("stime", out JsonElement stime))
+                if (request.TryGetProperty("stime", out JsonElement stime))
                 {
                     if (long.TryParse($"{stime}", out long data))
                     {
@@ -220,7 +220,7 @@ namespace TEAMModelOS.Controllers
                 };
                 //默认当前时间
                 var etimestamp = "";
-                if (requert.TryGetProperty("etime", out JsonElement etime))
+                if (request.TryGetProperty("etime", out JsonElement etime))
                 {
                     if (long.TryParse($"{etime}", out long data))
                     {
@@ -228,7 +228,7 @@ namespace TEAMModelOS.Controllers
                     };
                 };
                 var progresssql = "";
-                if (requert.TryGetProperty("progress", out JsonElement progress))
+                if (request.TryGetProperty("progress", out JsonElement progress))
                 {
 
                     if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
@@ -239,7 +239,7 @@ namespace TEAMModelOS.Controllers
                 string continuationToken = null;
                 //默认不指定返回大小
                 int? topcout=null;
-                if (requert.TryGetProperty("count", out JsonElement jcount)) {
+                if (request.TryGetProperty("count", out JsonElement jcount)) {
                     if (int.TryParse($"{jcount}", out int data))
                     {
                         topcout = data;
@@ -248,7 +248,7 @@ namespace TEAMModelOS.Controllers
                 //是否需要进行分页查询,默认不分页
                // bool iscontinuation = false;
                 //如果指定了返回大小
-                if (requert.TryGetProperty("continuationToken", out JsonElement continuation))
+                if (request.TryGetProperty("continuationToken", out JsonElement continuation))
                 {
                     //指定了cancellationToken 表示需要进行分页
                     if (!continuation.ValueKind.Equals(JsonValueKind.Null) && !continuation.ValueKind.Equals(JsonValueKind.Undefined))
@@ -306,13 +306,13 @@ namespace TEAMModelOS.Controllers
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student", Permissions = "schoolAc-read,schoolAc-upd")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             Vote vote = null;
             //活动id
-            if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+            if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
             //活动分区
-            if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -330,7 +330,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"OS,{_option.Location},common/vote/find-id()\n{ex.Message}\n{ex.StackTrace}\n\n{requert.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"OS,{_option.Location},common/vote/find-id()\n{ex.Message}\n{ex.StackTrace}\n\n{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                 return Ok(new { vote,status=404 });
             }
 

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

@@ -194,25 +194,25 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,c.startTime,c.endTime,c.allowSupply,c.allowComment from c where (c.status<>404 or IS_DEFINED(c.status) = false ) ";
                 string continuationToken = string.Empty;
                 string token = default;
                 //是否需要进行分页查询,默认不分页
                 bool iscontinuation = false;
-                if (requert.TryGetProperty("token", out JsonElement token_1))
+                if (request.TryGetProperty("token", out JsonElement token_1))
                 {
                     token = token_1.GetString();
                     iscontinuation = true;
                 };
                 //默认不指定返回大小
                 int? topcout = null;
-                if (requert.TryGetProperty("count", out JsonElement jcount))
+                if (request.TryGetProperty("count", out JsonElement jcount))
                 {
                     if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                     {
@@ -253,12 +253,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-summary")]
-        public async Task<IActionResult> FindSummary(JsonElement requert)
+        public async Task<IActionResult> FindSummary(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<Homework> works = new();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryIterator<Homework>(queryText: $"select value(c) from c where (c.status<>404 or IS_DEFINED(c.status) = false ) and  c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))
@@ -282,12 +282,12 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-by-teacher")]
-        public async Task<IActionResult> FindByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var query = $"select c.id,c.name,c.createTime,A0.time from c join A0 in c.teachers where (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}'";
                 List<object> works = new();
@@ -317,13 +317,13 @@ namespace TEAMModelOS.Controllers.Common
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find-summary-by-teacher")]
-        public async Task<IActionResult> FindSummaryByTeacher(JsonElement requert)
+        public async Task<IActionResult> FindSummaryByTeacher(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.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 (c.status<>404 or IS_DEFINED(c.status) = false ) and  A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Homework-{code}") }))

+ 1 - 1
TEAMModelOS/Controllers/OpenApi/Init/OpenApiConfigController.cs

@@ -42,7 +42,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"uuid","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "admin")]

+ 7 - 7
TEAMModelOS/Controllers/School/ClassController.cs

@@ -48,11 +48,11 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("upsert")]
         [Authorize(Roles = "IES")]
-        public async ValueTask<IActionResult> Upsert(JsonElement requert)
+        public async ValueTask<IActionResult> Upsert(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
+                if (!request.TryGetProperty("classroom", out JsonElement room)) return BadRequest();
                 Class classroom = room.ToObject<Class>();
                 var client = _azureCosmos.GetCosmosClient();
                 classroom.code = "Class-" + classroom.school;
@@ -129,12 +129,12 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("upsert-group")]
         [Authorize(Roles = "IES")]
-        public async ValueTask<IActionResult> UpsertGroup(JsonElement requert)
+        public async ValueTask<IActionResult> UpsertGroup(JsonElement request)
         {
             try
             {
                 List<Student> students = new List<Student>();
-                if (!requert.TryGetProperty("students", out JsonElement stus)) return BadRequest();
+                if (!request.TryGetProperty("students", out JsonElement stus)) return BadRequest();
                 students = stus.ToObject<List<Student>>();
                 var client = _azureCosmos.GetCosmosClient();
                 foreach (Student stu in students)
@@ -163,10 +163,10 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             //ResponseBuilder builder = ResponseBuilder.custom();
-            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
@@ -174,7 +174,7 @@ namespace TEAMModelOS.Controllers
                 StringBuilder sql = new StringBuilder();
                 sql.Append("select c.id,c.no,c.point,c.name,c.teacher,c.periodId,c.gradeId,c.sn,c.style,c.scope,c.type,c.code,c.openType,c.x,c.y,ARRAY_LENGTH(c.students) AS studCount from c ");
                 Dictionary<string, object> dict = new Dictionary<string, object>();
-                var emobj = requert.EnumerateObject();
+                var emobj = request.EnumerateObject();
                 while (emobj.MoveNext())
                 {
                     dict[emobj.Current.Name] = emobj.Current.Value;

+ 8 - 8
TEAMModelOS/Controllers/School/CorrectController.cs

@@ -72,7 +72,7 @@ namespace TEAMModelOS.Controllers
         [AuthToken(Roles = "teacher,admin")]
         [HttpPost("find-task")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindTask(JsonElement requert)
+        public async Task<IActionResult> FindTask(JsonElement request)
         {
             List<CorrectTask> tasks = new List<CorrectTask>();
             try
@@ -80,7 +80,7 @@ namespace TEAMModelOS.Controllers
                 var client = _azureCosmos.GetCosmosClient();
 
                 //活动分区
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var (_, _, _, school) = HttpContext.GetAuthTokenInfo();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CorrectTask>(queryText: $"select value(c) from c where c.scode = 'Correct-{school}'",
                 requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"CorrectTask-{code}") }))
@@ -255,15 +255,15 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             try
             {
 
                 //活动id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //活动分区
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 Correct correct = await client.GetContainer(Constant.TEAMModelOS, "Common").ReadItemAsync<Correct>(id.GetString(), new PartitionKey($"Correct-{code}"));
                 return Ok(new { correct });
@@ -284,15 +284,15 @@ namespace TEAMModelOS.Controllers
         [ProducesDefaultResponseType]
         [HttpPost("delete-task")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> delete(JsonElement requert)
+        public async Task<IActionResult> delete(JsonElement request)
         {
             try
             {
 
                 //活动id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //活动分区
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 List<SDK.Models.Cosmos.Common.Scoring> attr = new();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<SDK.Models.Cosmos.Common.Scoring>(

+ 17 - 17
TEAMModelOS/Controllers/School/NoticeController.cs

@@ -128,27 +128,27 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
             try
             {
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
-                if (!requert.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
-                requert.TryGetProperty("admin", out JsonElement admin);
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("scope", out JsonElement scope)) return BadRequest();
+                request.TryGetProperty("admin", out JsonElement admin);
                 string stimestampsql = "";
                 string etimestampsql = "";
                 if (!$"{admin}".Equals("1"))
                 {
                     var stimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                    if (requert.TryGetProperty("stime", out JsonElement stime))
+                    if (request.TryGetProperty("stime", out JsonElement stime))
                     {
                         if (long.TryParse($"{stime}", out long data))
                         {
@@ -158,7 +158,7 @@ namespace TEAMModelOS.Controllers
                     stimestampsql = $" and c.startTime <= {stimestamp} ";
                     //默认当前时间
                     var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                    if (requert.TryGetProperty("etime", out JsonElement etime))
+                    if (request.TryGetProperty("etime", out JsonElement etime))
                     {
                         if (long.TryParse($"{etime}", out long data))
                         {
@@ -169,7 +169,7 @@ namespace TEAMModelOS.Controllers
 
                 }
                 var publishsql = "";
-                if (requert.TryGetProperty("publish", out JsonElement publish))
+                if (request.TryGetProperty("publish", out JsonElement publish))
                 {
 
                     if (!publish.ValueKind.Equals(JsonValueKind.Undefined) && !publish.ValueKind.Equals(JsonValueKind.Null) && publish.ValueKind.Equals(JsonValueKind.Number))
@@ -179,7 +179,7 @@ namespace TEAMModelOS.Controllers
                 }
 
                 var creatorIdSql = "";
-                if (requert.TryGetProperty("creatorId", out JsonElement creatorId))
+                if (request.TryGetProperty("creatorId", out JsonElement creatorId))
                 {
 
                     if (!publish.ValueKind.Equals(JsonValueKind.Undefined) && !publish.ValueKind.Equals(JsonValueKind.Null) && publish.ValueKind.Equals(JsonValueKind.String))
@@ -189,7 +189,7 @@ namespace TEAMModelOS.Controllers
                 }
 
                 var typesql = "";
-                if (requert.TryGetProperty("type", out JsonElement type))
+                if (request.TryGetProperty("type", out JsonElement type))
                 {
 
                     if (!type.ValueKind.Equals(JsonValueKind.Undefined) && !type.ValueKind.Equals(JsonValueKind.Null) && type.ValueKind.Equals(JsonValueKind.String))
@@ -199,7 +199,7 @@ namespace TEAMModelOS.Controllers
                 }
                 string joinSqlClasses = "";
                 string andSqlClasses = "";
-                if (requert.TryGetProperty("classes", out JsonElement _classes))
+                if (request.TryGetProperty("classes", out JsonElement _classes))
                 {
 
                     if (_classes.ValueKind is JsonValueKind.Array)
@@ -247,13 +247,13 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find-by-student")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin,student")]
-        public async Task<IActionResult> FindByStudent(JsonElement requert)
+        public async Task<IActionResult> FindByStudent(JsonElement request)
         {
             try
             {
@@ -261,12 +261,12 @@ namespace TEAMModelOS.Controllers
                 HttpContext?.Items.TryGetValue("Scope", out scope);
                 var (userid, _, _, school) = HttpContext.GetAuthTokenInfo();
                 //必须有学校或者教师编码
-               // if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+               // if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                
                 //string stimestampsql = "";
                 //string etimestampsql = "";
                 //var stimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                //if (requert.TryGetProperty("stime", out JsonElement stime) && stime.ValueKind.Equals(JsonValueKind.Number))
+                //if (request.TryGetProperty("stime", out JsonElement stime) && stime.ValueKind.Equals(JsonValueKind.Number))
                 //{
                 //    if (long.TryParse($"{stime}", out long data))
                 //    {
@@ -276,7 +276,7 @@ namespace TEAMModelOS.Controllers
                 //stimestampsql = $" and c.startTime <= {stimestamp} ";
                 ////默认当前时间
                 //var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
-                //if (requert.TryGetProperty("etime", out JsonElement etime) && stime.ValueKind.Equals(JsonValueKind.Number))
+                //if (request.TryGetProperty("etime", out JsonElement etime) && stime.ValueKind.Equals(JsonValueKind.Number))
                 //{
                 //    if (long.TryParse($"{etime}", out long data))
                 //    {
@@ -287,7 +287,7 @@ namespace TEAMModelOS.Controllers
                 var publishsql = $" and c.publish=1 ";
                 string joinSqlClasses = "";
                 string andSqlClasses = "";
-                if (requert.TryGetProperty("classes", out JsonElement _classes))
+                if (request.TryGetProperty("classes", out JsonElement _classes))
                 {
 
                     if (_classes.ValueKind is JsonValueKind.Array)

+ 9 - 9
TEAMModelOS/Controllers/School/RoomController.cs

@@ -79,7 +79,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "teacher")]
@@ -107,20 +107,20 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"教室id","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("find-id")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> FindById(JsonElement requert)
+        public async Task<IActionResult> FindById(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 //id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 Room room = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<Room>(id.GetString(), new PartitionKey($"Room-{code}"));
                 if (room != null)
                 {
@@ -141,20 +141,20 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"教室id","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("delete")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Delete(JsonElement requert)
+        public async Task<IActionResult> Delete(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 //id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var room= await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemAsync<Room>(id.GetString(), new PartitionKey($"Room-{code}"));
                 return Ok();
             }

+ 2 - 2
TEAMModelOS/Controllers/School/SchoolController.cs

@@ -180,9 +180,9 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("find")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Find(JsonElement requert)
+        public async Task<IActionResult> Find(JsonElement request)
         {
-            if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+            if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
             var client = _azureCosmos.GetCosmosClient();
             List<School> schools = new ();
             var query = $"select c.id,c.pk,c.code, c.name,c.region,c.province,c.city,c.timeZone,c.picture,c.size,c.period,c.campuses from c where c.id ='{school_code}'";

+ 3 - 3
TEAMModelOS/Controllers/Student/StudentController.cs

@@ -585,12 +585,12 @@ namespace TEAMModelOS.Controllers
         //[AuthToken(Roles = "teacher")]
         [HttpPost("get-summary-student")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> getSummary(JsonElement requert)
+        public async Task<IActionResult> getSummary(JsonElement request)
         {
             try
             {
-                requert.TryGetProperty("students", out JsonElement students);
-                requert.TryGetProperty("tmdIds", out JsonElement tmdIds);
+                request.TryGetProperty("students", out JsonElement students);
+                request.TryGetProperty("tmdIds", out JsonElement tmdIds);
 
                 List<TmdInfo> tmdinfos = new List<TmdInfo>();
                 List<object> stus = new List<object>();

+ 6 - 6
TEAMModelOS/Controllers/System/OpenApiController.cs

@@ -40,7 +40,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "admin")]
@@ -171,7 +171,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"uuid","code":"hbcn学校编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         //[AuthToken(Roles = "admin")]
@@ -217,20 +217,20 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"id","code":"hbcn"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("delete-app")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> Delete(JsonElement requert)
+        public async Task<IActionResult> Delete(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
                 //id
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
                 //
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var room = await client.GetContainer(Constant.TEAMModelOS, "School").DeleteItemAsync<OpenApp>(id.GetString(), new PartitionKey($"OpenApp-{code}"));
                 return Ok();
             }

+ 5 - 5
TEAMModelOS/Controllers/Teacher/FavoriteController.cs

@@ -115,7 +115,7 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"code":"教师编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [AuthToken(Roles = "teacher,admin")]
@@ -144,19 +144,19 @@ namespace TEAMModelOS.Controllers
         /// <summary>
         /// {"id":"我的最爱id","code":"教师编码"} 
         /// </summary>
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("delete")]
         [Authorize(Roles = "IES")]
         [AuthToken(Roles = "teacher,admin")]
-        public async Task<IActionResult> Delete(JsonElement requert)
+        public async Task<IActionResult> Delete(JsonElement request)
         {
             try
             {
                 var client = _azureCosmos.GetCosmosClient();
-                if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-                if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+                if (!request.TryGetProperty("id", out JsonElement id)) return BadRequest();
+                if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 Favorite favorite = await client.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemAsync<Favorite>(id.GetString(), new PartitionKey($"Favorite-{code}"));
                 if (favorite.type.Equals("LessonRecord"))
                 {

+ 7 - 7
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -882,21 +882,21 @@ namespace TEAMModelOS.Controllers
         /// 申請或同意邀請加入學校
         /// </summary>
         /// 
-        /// <param name="requert"></param>
+        /// <param name="request"></param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [AuthToken(Roles = "teacher")]
         [HttpPost("join-school")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> JoinSchool(JsonElement requert)
+        public async Task<IActionResult> JoinSchool(JsonElement request)
         {
             try
             {
-                if (!requert.TryGetProperty("grant_type", out JsonElement grant_type)) return BadRequest();  //"invite":學校邀請 "request":老師申請 "join":"成為學校老師",leave 离开,cancel 取消。
-                if (!requert.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
-                if (!requert.TryGetProperty("school_name", out JsonElement school_name)) return BadRequest();
+                if (!request.TryGetProperty("grant_type", out JsonElement grant_type)) return BadRequest();  //"invite":學校邀請 "request":老師申請 "join":"成為學校老師",leave 离开,cancel 取消。
+                if (!request.TryGetProperty("school_code", out JsonElement school_code)) return BadRequest();
+                if (!request.TryGetProperty("school_name", out JsonElement school_name)) return BadRequest();
                 ///当邀请某个老师加入学校则需要知道是谁邀请的
-                //if (!requert.TryGetProperty("school_admin", out JsonElement school_admin)) return BadRequest();
+                //if (!request.TryGetProperty("school_admin", out JsonElement school_admin)) return BadRequest();
                 string authtoken = HttpContext.GetXAuth("AuthToken");
                 if (string.IsNullOrEmpty(authtoken)) return BadRequest();
                 var jwt = new JwtSecurityToken(authtoken);
@@ -1107,7 +1107,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (Exception ex)
             {
-                await _dingDing.SendBotMsg($"TEAMModel,{_option.Location},Init/JoinSchool()\n{ex.Message}\n{ex.StackTrace}\n{requert.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"TEAMModel,{_option.Location},Init/JoinSchool()\n{ex.Message}\n{ex.StackTrace}\n{request.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
                 return BadRequest();
             }
         }

+ 51 - 51
TEAMModelOS/Controllers/Teacher/TeacherCommonController.cs

@@ -39,13 +39,13 @@ namespace TEAMModelOS.Controllers
         [HttpPost("tch-activity-count")]
         [AuthToken(Roles = "admin,teacher")]
         [Authorize(Roles = "IES")]
-        public async Task<IActionResult> TchActivityCount(JsonElement requert)
+        public async Task<IActionResult> TchActivityCount(JsonElement request)
         {
             var (id, _, _, school) = HttpContext.GetAuthTokenInfo();
             var client = _azureCosmos.GetCosmosClient();
             HashSet<string> classes = new HashSet<string>();
             HashSet<string> stulist = new HashSet<string>();
-            //获取学校的名单:
+            //鑾峰彇瀛︽牎鐨勫悕鍗曪細
             List<Schedule> schedules = new List<Schedule>();
             string scheduleSql = $"SELECT   c.schedule  FROM c join scdl in c.schedule where c.pk='Course' and scdl.teacherId='{id}'";
             await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Course>(scheduleSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{school}") }))
@@ -97,7 +97,7 @@ namespace TEAMModelOS.Controllers
                 if (!string.IsNullOrWhiteSpace(school) && classes.ToList().IsNotEmpty())
                 {
                     string querySchool = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime   FROM c {joinSqlClasses}   where   {pksql}    {classesSql}  and    (c.status<>404 or IS_DEFINED(c.status) = false )   ";
-                    //查询数据归属学校的
+                    //查询数据归属学校的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(querySchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{school}") }))
                     {
                         if (item.progress.Equals("going", StringComparison.OrdinalIgnoreCase))
@@ -116,7 +116,7 @@ namespace TEAMModelOS.Controllers
                 if (!string.IsNullOrWhiteSpace(school) && stulist.ToList().IsNotEmpty())
                 {
                     string querySchool = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime   FROM c {joinSqlStulist}   where   {pksql}    {stuListsSql} and   (c.status<>404 or IS_DEFINED(c.status) = false )   ";
-                    //查询数据归属学校的
+                    //查询数据归属学校的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(querySchool, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{school}") }))
                     {
                         if (item.progress.Equals("going", StringComparison.OrdinalIgnoreCase))
@@ -127,7 +127,7 @@ namespace TEAMModelOS.Controllers
                     }
                 }
                 string queryTeacher = $" SELECT distinct c.owner, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime  FROM c   where   {pksql} and   (c.status<>404 or IS_DEFINED(c.status) = false )    ";
-                //查询数据归属个人的
+                //查询数据归属个人的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<MQActivity>(queryTeacher, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{type}-{id}") }))
                 {
                     acount += 1;
@@ -139,7 +139,7 @@ namespace TEAMModelOS.Controllers
                 KeyValuePair<string, int> valuePair = new KeyValuePair<string, int>(type, acount);
                 count.Add(valuePair);
             }
-            //课程统计 个人和学校  分别对应的教学的班级有多少
+            //课程统计 个人和学校  分别对应的教学的班级有多少
             List<CourseCount> privateCourse = new List<CourseCount>();
             string courseSql = $" SELECT a.teacherId,a.classId,  a.stulist,c.id,c.name FROM c  join a in c.schedule where a.teacherId='{id}'  ";
             await foreach(var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<CourseCount>(courseSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Course-{id}") })){
@@ -152,10 +152,10 @@ namespace TEAMModelOS.Controllers
                     schoolCourse.Add(item);
                 }
             }
-            //涉及的课程清单数量(去重),与排课无关,排课涉及周期问题,暂不进行统计
+            //涉及的课程清单数量(去重),与排课无关,排课涉及周期问题,暂不进行统计
             int privateCourseCount= privateCourse.Select(x => x.id).ToHashSet().Count();
             int schoolCourseCount = schoolCourse.Select(x => x.id).ToHashSet().Count();
-            //行政班教学数量,去重。
+            //行政班教学数量,去重。
             HashSet<string> classIds = new HashSet<string>();
             HashSet<string> teachIds = new HashSet<string>();
             HashSet<string> stulists = new HashSet<string>();
@@ -220,31 +220,31 @@ namespace TEAMModelOS.Controllers
             public string name { get; set; }
         }
         /// <summary>
-        /// 教师端,查询活动所有活动类型的列表,班主任,任课教师等
-        /// 执教班级
+        /// 鏁欏笀绔�紝鏌ヨ�娲诲姩鎵€鏈夋椿鍔ㄧ被鍨嬬殑鍒楄〃锛岀彮涓讳换锛屼换璇炬暀甯堢瓑
+        /// 鎵ф暀鐝�骇
         /// </summary>
         /// <param name="request">
-        /// 教师tmdid                          !userid:"1255868536"   
-        ///学校编码                            !school:"hbcn"
-        ///执教的班级信息                      !classes:[{"classid":"S-C-00001","scope":"school"},{"classid":"P-C-00004","scope":"private"}]   TODO  需要排查 对象和班级字符串id设计原因 {"classid":"S-C-00001","scope":"school"}
-        ///执教的科目                          ?subjects:["subjectid1","subjectid2"]
-        ///活动类型                            !"pk":"Vote"/"Exam"/"Homework"/"Learn"/"Survey"" // Vote投票 Survey问卷 Exam评测 Learn学习活动 Homework作业活动
-        ///时间筛选范围开始时间 默认30天之前   ?"stime":1608274766154  
-        ///时间筛选范围结束时间 默认当前时间   ?"etime":1608274766666 
-        ///每页大小     ?"count":10/null/Undefined  
-        ///分页Token    ?"continuationToken":Undefined/null/"[{\"token\":\"+RID:~omxMAP3ipcSEEwAAAAAAAA==#RT:2#TRC:20#ISV:2#IEO:65551#QCF:1#FPC:AYQTAAAAAAAAiRMAAAAAAAA=\",\"range\":{\"min\":\"\",\"max\":\"FF\"}}]"
-        ///当前状态     ?"progress":Undefined/null/"" 表示两种状态都要查询/ "going"/"finish" 表示查询进行中/ 或者已完成 学生端只能查询正在进行或已经结束 going 已发布|finish 已结束  
+        /// 鏁欏笀tmdid                          !userid:"1255868536"   
+        ///瀛︽牎缂栫爜                            !school:"hbcn"
+        ///执教的班级信息                      !classes:[{"classid":"S-C-00001","scope":"school"},{"classid":"P-C-00004","scope":"private"}]   TODO  需要排查 对象和班级字符串id设计原因 {"classid":"S-C-00001","scope":"school"}
+        ///执教的科目                          ?subjects:["subjectid1","subjectid2"]
+        ///娲诲姩绫诲瀷                            !"pk":"Vote"/"Exam"/"Homework"/"Learn"/"Survey"" // Vote鎶曠エ Survey闂�嵎 Exam璇勬祴 Learn瀛︿範娲诲姩 Homework浣滀笟娲诲姩
+        ///时间筛选范围开始时间 默认30天之前   ?"stime":1608274766154  
+        ///时间筛选范围结束时间 默认当前时间   ?"etime":1608274766666 
+        ///姣忛〉澶у皬     ?"count":10/null/Undefined  
+        ///鍒嗛〉Token    ?"continuationToken":Undefined/null/"[{\"token\":\"+RID:~omxMAP3ipcSEEwAAAAAAAA==#RT:2#TRC:20#ISV:2#IEO:65551#QCF:1#FPC:AYQTAAAAAAAAiRMAAAAAAAA=\",\"range\":{\"min\":\"\",\"max\":\"FF\"}}]"
+        ///当前状态     ?"progress":Undefined/null/"" 表示两种状态都要查询/ "going"/"finish" 表示查询进行中/ 或者已完成 学生端只能查询正在进行或已经结束 going 已发布|finish 已结束  
         /// </param>
         /// <returns></returns>
         [ProducesDefaultResponseType]
         [HttpPost("tch-activity")]
         [Authorize(Roles = "IES")]
         //[AuthToken(Roles = "teacher")]
-        public async Task<IActionResult> TchActivity(JsonElement requert)
+        public async Task<IActionResult> TchActivity(JsonElement request)
         {
             string school = "";
             var (id, _, _, _) = HttpContext.GetAuthTokenInfo();
-            if (requert.TryGetProperty("school", out JsonElement schoolcode))
+            if (request.TryGetProperty("school", out JsonElement schoolcode))
             {
                 if (!schoolcode.ValueKind.Equals(JsonValueKind.Undefined) && !schoolcode.ValueKind.Equals(JsonValueKind.Null) && schoolcode.ValueKind.Equals(JsonValueKind.String))
                 {
@@ -253,7 +253,7 @@ namespace TEAMModelOS.Controllers
             }
             if (string.IsNullOrWhiteSpace(id))
             {
-                if (requert.TryGetProperty("userid", out JsonElement userid))
+                if (request.TryGetProperty("userid", out JsonElement userid))
                 {
                     if (!userid.ValueKind.Equals(JsonValueKind.Undefined) && !userid.ValueKind.Equals(JsonValueKind.Null) && userid.ValueKind.Equals(JsonValueKind.String))
                     {
@@ -262,7 +262,7 @@ namespace TEAMModelOS.Controllers
                 }
             }
             //var stimestamp = DateTimeOffset.UtcNow.AddDays(-30).ToUnixTimeMilliseconds();
-            //if (requert.TryGetProperty("stime", out JsonElement stime))
+            //if (request.TryGetProperty("stime", out JsonElement stime))
             //{
             //    if (!stime.ValueKind.Equals(JsonValueKind.Undefined) && !stime.ValueKind.Equals(JsonValueKind.Null) && stime.TryGetInt64(out long data))
             //    {
@@ -273,7 +273,7 @@ namespace TEAMModelOS.Controllers
             //var etimestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
             //string etimesql = $" and c.startTime <= {etimestamp}   ";
             //var progresssql = "";
-            //if (requert.TryGetProperty("progress", out JsonElement progress))
+            //if (request.TryGetProperty("progress", out JsonElement progress))
             //{
             //    if (!progress.ValueKind.Equals(JsonValueKind.Undefined) && !progress.ValueKind.Equals(JsonValueKind.Null) && progress.ValueKind.Equals(JsonValueKind.String))
             //    {
@@ -282,7 +282,7 @@ namespace TEAMModelOS.Controllers
             //}
             var pksql = "";
             string type = null;
-            if (requert.TryGetProperty("pk", out JsonElement pk))
+            if (request.TryGetProperty("pk", out JsonElement pk))
             {
                 if (!pk.ValueKind.Equals(JsonValueKind.Undefined) && !pk.ValueKind.Equals(JsonValueKind.Null) && pk.ValueKind.Equals(JsonValueKind.String))
                 {
@@ -292,52 +292,52 @@ namespace TEAMModelOS.Controllers
             }
             if (string.IsNullOrEmpty(type)) { return BadRequest("type is required!"); }
             string continuationTokenSchool = null;
-            //默认不指定返回大小
+            //默认不指定返回大小
             int? topcout = null;
-            if (requert.TryGetProperty("count", out JsonElement jcount))
+            if (request.TryGetProperty("count", out JsonElement jcount))
             {
                 if (!jcount.ValueKind.Equals(JsonValueKind.Undefined) && !jcount.ValueKind.Equals(JsonValueKind.Null) && jcount.TryGetInt32(out int data))
                 {
                     topcout = data;
                 }
             }
-            //是否需要进行分页查询,默认不分页
+            //是否需要进行分页查询,默认不分页
             bool iscontinuation = false;
             if (topcout != null && topcout.Value > 0)
             {
                 iscontinuation = true;
             }
-            //如果指定了返回大小
-            if (requert.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
+            //如果指定了返回大小
+            if (request.TryGetProperty("continuationTokenSchool", out JsonElement continuationSchool))
             {
-                //指定了cancellationToken continuationSchool
+                //鎸囧畾浜哻ancellationToken continuationSchool
                 if (!continuationSchool.ValueKind.Equals(JsonValueKind.Null) && continuationSchool.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenSchool = continuationSchool.GetString();
 
                 }
             }
-            //班级
+            //鐝�骇
             string joinSqlClasses = "";
             string andSqlClasses = "";
 
             string joinSqlStulist = "";
             string andSqlStulist = "";
             List<string> classes = null;
-            if (requert.TryGetProperty("classes", out JsonElement jclasses))
+            if (request.TryGetProperty("classes", out JsonElement jclasses))
             {
                 if (jclasses.ValueKind is JsonValueKind.Array)
                 {
                     classes = jclasses.ToObject<List<string>>();
                     if (classes.IsNotEmpty())
                     {
-                        //行政班
+                        //行政班
                         joinSqlClasses = " join A1 in c.classes ";
                         List<string> sqlListc = new List<string>();
                         classes.ForEach(x => { sqlListc.Add($" '{x}' "); });
                         string sqlc = string.Join(" , ", sqlListc);
                         andSqlClasses = $"    A1 in ({sqlc}) ";
-                        //教学班
+                        //教学班
                         joinSqlStulist = " join A1 in c.stuLists ";
                         List<string> sqlListl = new List<string>();
                         classes.ForEach(x => { sqlListl.Add($" '{x}' "); });
@@ -360,13 +360,13 @@ namespace TEAMModelOS.Controllers
             }
             List<JsonElement> datas = new List<JsonElement>();
             var client = _azureCosmos.GetCosmosClient();
-            //班主任 ,任课教师只需要查询两种校园活动 和班级活动 ,  不查询私人教室创建的活动。  
+            //班主任 ,任课教师只需要查询两种校园活动 和班级活动 ,  不查询私人教室创建的活动。  
             if (!string.IsNullOrWhiteSpace(school) && classes.IsNotEmpty())
             {
                 //string querySchool = $" SELECT distinct  value c   FROM c {joinSqlClasses} {joinSqlSubjects}  where {stimesql}  {etimesql}  {progresssql}  {typesql}  {andSqlSubjects}  {tgSql}";
                 string querySchoolclss = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime,c.source,c.type " +
                     $"  FROM c {joinSqlClasses}   where   {pksql}    {classesSql}  and   (c.status<>404 or IS_DEFINED(c.status) = false )   ";
-                //查询数据归属学校的
+                //查询数据归属学校的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator(querySchoolclss, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{school}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -376,7 +376,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenSchool = item.GetContinuationToken();
@@ -395,7 +395,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenSchool = item.GetContinuationToken();
@@ -405,10 +405,10 @@ namespace TEAMModelOS.Controllers
                 }
             }
             string continuationTokenTeacher = null;
-            //如果指定了返回大小
-            if (requert.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
+            //如果指定了返回大小
+            if (request.TryGetProperty("continuationTokenTeacher", out JsonElement continuationTeacher))
             {
-                //指定了cancellationToken continuationSchool
+                //鎸囧畾浜哻ancellationToken continuationSchool
                 if (!continuationTeacher.ValueKind.Equals(JsonValueKind.Null) && continuationTeacher.ValueKind.Equals(JsonValueKind.String))
                 {
                     continuationTokenTeacher = continuationTeacher.GetString();
@@ -420,7 +420,7 @@ namespace TEAMModelOS.Controllers
             {
                 string queryTeacherClass = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                     $" FROM c  {joinSqlClasses}    where    {pksql}     {stuListsSql}  and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                //查询数据归属学校的
+                //查询数据归属学校的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                     (queryTeacherClass, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                 {
@@ -431,7 +431,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenTeacher = item.GetContinuationToken();
@@ -442,7 +442,7 @@ namespace TEAMModelOS.Controllers
 
                 string queryTeacherStulist = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                     $" FROM c  {joinSqlStulist}    where    {pksql}     {classesSql}   and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                //查询数据归属学校的
+                //查询数据归属学校的
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                     (queryTeacherStulist, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                 {
@@ -453,7 +453,7 @@ namespace TEAMModelOS.Controllers
                         {
                             datas.Add(obj.ToObject<JsonElement>());
                         }
-                        //如果需要分页则跳出
+                        //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                         if (iscontinuation)
                         {
                             continuationTokenTeacher = item.GetContinuationToken();
@@ -467,7 +467,7 @@ namespace TEAMModelOS.Controllers
                 {
                     string queryTeacher = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                        $" FROM c      where    {pksql} and (c.school='{school}' or c.school=null)  and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                    //查询个人发布的
+                    //查询个人发布的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                         (queryTeacher, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                     {
@@ -478,7 +478,7 @@ namespace TEAMModelOS.Controllers
                             {
                                 datas.Add(obj.ToObject<JsonElement>());
                             }
-                            //如果需要分页则跳出
+                            //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                             if (iscontinuation)
                             {
                                 continuationTokenTeacher = item.GetContinuationToken();
@@ -490,7 +490,7 @@ namespace TEAMModelOS.Controllers
                 else {
                     string queryTeacher = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
                        $" FROM c      where    {pksql}  and c.school=null  and   (c.status<>404 or IS_DEFINED(c.status) = false )     ";
-                    //查询个人发布的
+                    //查询个人发布的
                     await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryStreamIterator
                         (queryTeacher, continuationToken: continuationTokenSchool, requestOptions: new QueryRequestOptions() { MaxItemCount = topcout, PartitionKey = new PartitionKey($"{type}-{id}") }))
                     {
@@ -501,7 +501,7 @@ namespace TEAMModelOS.Controllers
                             {
                                 datas.Add(obj.ToObject<JsonElement>());
                             }
-                            //如果需要分页则跳出
+                            //濡傛灉闇€瑕佸垎椤靛垯璺冲嚭
                             if (iscontinuation)
                             {
                                 continuationTokenTeacher = item.GetContinuationToken();

+ 1 - 1
TEAMModelOS/Startup.cs

@@ -170,7 +170,7 @@ namespace TEAMModelOS
             BlobServiceProperties prop = _azureStorage.GetBlobServiceClient().GetProperties();
             prop.DefaultServiceVersion = "2018-03-28";
             _azureStorage.GetBlobServiceClient().SetProperties(prop);
-            //TODO 目前不使用中間件全局攔截Exception,請在API中,明確處理200成功返回值或錯誤碼,Exception一率返回BadRequert 400,並選擇需要返回釘釘群組回報的API
+            //TODO 目前不使用中間件全局攔截Exception,請在API中,明確處理200成功返回值或錯誤碼,Exception一率返回Badrequest 400,並選擇需要返回釘釘群組回報的API
             //app.UseMiddleware<HttpGlobalExceptionInvoke>();
 
             //以下需要按照順序載入中間件  如果应用调用 UseStaticFiles,请将 UseStaticFiles 置于 UseRouting之前。