CrazyIter_Bin 11 tháng trước cách đây
mục cha
commit
0a70017e81
65 tập tin đã thay đổi với 180 bổ sung177 xóa
  1. 1 2
      TEAMModelOS.SDK/DI/AzureRedis/AzureRedisExtensions.cs
  2. 1 1
      TEAMModelOS.SDK/DI/AzureRedis/AzureRedisFactory.cs
  3. 2 2
      TEAMModelOS.SDK/DI/AzureStorage/AzureStorageBlobExtensions.cs
  4. 3 2
      TEAMModelOS.SDK/DI/AzureStorage/AzureStorageTableExtensions.cs
  5. 1 1
      TEAMModelOS.SDK/DI/AzureStorage/Inner/AzureBlobModel.cs
  6. 1 1
      TEAMModelOS.SDK/Models/Cosmos/BI/AreaQuoteRecord.cs
  7. 1 1
      TEAMModelOS.SDK/Models/Cosmos/BI/BICommon/Notice.cs
  8. 1 1
      TEAMModelOS.SDK/Models/Cosmos/BI/BITable/LessStats.cs
  9. 1 1
      TEAMModelOS.SDK/Models/Cosmos/BI/Company.cs
  10. 1 1
      TEAMModelOS.SDK/Models/Cosmos/BI/DingDingUserInfo.cs
  11. 13 12
      TEAMModelOS.SDK/Models/Service/BI/BIStats.cs
  12. 1 1
      TEAMModelOS.SDK/Models/Service/OpenApiService.cs
  13. 26 26
      TEAMModelOS.SDK/Models/Service/StudentService.cs
  14. 1 1
      TEAMModelOS.SDK/Models/Service/Third/Sc/ScYxptModel.cs
  15. 1 1
      TEAMModelOS.SDK/Models/Service/Third/Xkw/XkwOAuthModel.cs
  16. 1 1
      TEAMModelOS.SDK/Models/Table/BIOptLog.cs
  17. 1 1
      TEAMModelOS.SDK/Models/Table/ChangeRecord.cs
  18. 1 1
      TEAMModelOS.SDK/Models/Table/IESLogin.cs
  19. 1 1
      TEAMModelOS.SDK/Models/Table/Lesson.cs
  20. 1 1
      TEAMModelOS.SDK/Models/Table/OpenApi.cs
  21. 3 1
      TEAMModelOS.SDK/Models/Table/OptLog.cs
  22. 1 1
      TEAMModelOS.SDK/Models/Table/SchoolSetting.cs
  23. 1 1
      TEAMModelOS.SDK/Models/Table/SchoolYear.cs
  24. 1 1
      TEAMModelOS.SDK/Models/Table/ShortUrl.cs
  25. 1 1
      TEAMModelOS.SDK/TEAMModelOS.SDK.csproj
  26. 4 4
      TEAMModelOS/Controllers/Client/HiTeachController.cs
  27. 4 4
      TEAMModelOS/Controllers/Common/ExamController.cs
  28. 3 3
      TEAMModelOS/Controllers/Common/ExamLiteController.cs
  29. 5 5
      TEAMModelOS/Controllers/Common/HomeworkController.cs
  30. 6 6
      TEAMModelOS/Controllers/Common/StudyController.cs
  31. 1 1
      TEAMModelOS/Controllers/Common/SurveyController.cs
  32. 1 1
      TEAMModelOS/Controllers/Common/VoteController.cs
  33. 1 1
      TEAMModelOS/Controllers/Normal/AbilityController.cs
  34. 5 5
      TEAMModelOS/Controllers/Normal/AbilitySubController.cs
  35. 1 1
      TEAMModelOS/Controllers/Normal/AbilityTaskController.cs
  36. 3 3
      TEAMModelOS/Controllers/Normal/AppraiseController.cs
  37. 2 2
      TEAMModelOS/Controllers/Normal/AreaSettingController.cs
  38. 5 4
      TEAMModelOS/Controllers/Normal/ArtSettingController.cs
  39. 2 2
      TEAMModelOS/Controllers/OpenApi/Business/BizSSOController.cs
  40. 1 1
      TEAMModelOS/Controllers/OpenApi/Init/BizUsersController.cs
  41. 1 1
      TEAMModelOS/Controllers/School/ArtReviewController.cs
  42. 2 2
      TEAMModelOS/Controllers/School/CorrectController.cs
  43. 1 1
      TEAMModelOS/Controllers/School/DebateController.cs
  44. 2 4
      TEAMModelOS/Controllers/School/ImportExamController.cs
  45. 2 1
      TEAMModelOS/Controllers/School/SchoolController.cs
  46. 1 1
      TEAMModelOS/Controllers/School/SchoolSettingController.cs
  47. 2 0
      TEAMModelOS/Controllers/School/SchoolTeacherController.cs
  48. 1 1
      TEAMModelOS/Controllers/Student/StudentCommonController.cs
  49. 2 6
      TEAMModelOS/Controllers/Student/StudentController.cs
  50. 1 1
      TEAMModelOS/Controllers/Student/TmdUserController.cs
  51. 4 3
      TEAMModelOS/Controllers/System/BlobController.cs
  52. 8 8
      TEAMModelOS/Controllers/System/CoreController.cs
  53. 3 3
      TEAMModelOS/Controllers/Teacher/ClassVideoController.cs
  54. 4 3
      TEAMModelOS/Controllers/Teacher/InitController.cs
  55. 5 3
      TEAMModelOS/Controllers/Third/LePei/LePeiController.cs
  56. 1 1
      TEAMModelOS/Controllers/Third/Moofen/MoofenController.cs
  57. 1 1
      TEAMModelOS/Controllers/Third/OAuth2Controller.cs
  58. 5 3
      TEAMModelOS/Controllers/Third/Sc/ScController.cs
  59. 1 1
      TEAMModelOS/Controllers/Third/Sc/ScDataInitController.cs
  60. 4 7
      TEAMModelOS/Controllers/Third/Sc/ScDataPushController.cs
  61. 0 1
      TEAMModelOS/Controllers/Third/Xkw/XkwOAuth2Controller.cs
  62. 3 3
      TEAMModelOS/Controllers/XTest/BusinessController.cs
  63. 2 2
      TEAMModelOS/Controllers/XTest/DataMigrationController.cs
  64. 2 2
      TEAMModelOS/Controllers/XTest/FixDataController.cs
  65. 11 11
      TEAMModelOS/Controllers/XTest/TestController.cs

+ 1 - 2
TEAMModelOS.SDK/DI/AzureRedis/AzureRedisExtensions.cs

@@ -1,5 +1,4 @@
-using Microsoft.Table;
-using Microsoft.Table.Queryable;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections;
 using System.Collections.Generic;

+ 1 - 1
TEAMModelOS.SDK/DI/AzureRedis/AzureRedisFactory.cs

@@ -1,5 +1,5 @@
 
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Logging;
 using System;

+ 2 - 2
TEAMModelOS.SDK/DI/AzureStorage/AzureStorageBlobExtensions.cs

@@ -161,7 +161,7 @@ namespace TEAMModelOS.SDK.DI
                 BlobContainerClient bcc = client.GetBlobContainerClient(blobContainerName.ToLower());
                 BlobBatchClient bbc = client.GetBlobBatchClient();
                 List<Uri> blobs = new List<Uri>();
-                List<Task<ResponseMessage<bool>>> list = new List<Task<Response<bool>>>();
+                List<Task<Azure.Response<bool>>> list = new List<Task<Azure.Response<bool>>>();
                 foreach (var prefix in prefixs) {
                     string px = prefix;
                     if (prefix.StartsWith("/")) {
@@ -213,7 +213,7 @@ namespace TEAMModelOS.SDK.DI
                         int pages = (list.Count + 255) / 256; //256是批量操作最大值,pages = (total + max -1) / max;
                         for (int i = 0; i < pages; i++)
                         {
-                            List<Task<ResponseMessage<bool>>> lists = list.Skip((i) * 256).Take(256).ToList();
+                            List<Task<Azure.Response<bool>>> lists = list.Skip((i) * 256).Take(256).ToList();
                             await Task.WhenAll(lists);
                         }
                     }

+ 3 - 2
TEAMModelOS.SDK/DI/AzureStorage/AzureStorageTableExtensions.cs

@@ -1,5 +1,6 @@
-using Microsoft.Table;
-using Microsoft.Table.Queryable;
+
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections;
 using System.Collections.Generic;

+ 1 - 1
TEAMModelOS.SDK/DI/AzureStorage/Inner/AzureBlobModel.cs

@@ -1,6 +1,6 @@
 
 using Microsoft.AspNetCore.Http;
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.ComponentModel.DataAnnotations;
 using System.IO;

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/AreaQuoteRecord.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/BICommon/Notice.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/BITable/LessStats.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/Company.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;

+ 1 - 1
TEAMModelOS.SDK/Models/Cosmos/BI/DingDingUserInfo.cs

@@ -1,7 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Text;
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 
 namespace TEAMModelOS.SDK.Models.Cosmos.BI

+ 13 - 12
TEAMModelOS.SDK/Models/Service/BI/BIStats.cs

@@ -1,7 +1,7 @@
 using Microsoft.Azure.Cosmos;
 using Azure.Storage.Blobs;
 using MathNet.Numerics.LinearAlgebra.Double;
-using Microsoft.Table;
+using TEAMModelOS.SDK.Models.Table;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -13,6 +13,7 @@ using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models.Cosmos.BI;
 using TEAMModelOS.SDK.Models.Cosmos.BI.BISchool;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelOS.SDK.Models.Service.BI
 {
@@ -67,7 +68,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                 StatsInfo statsInfo = null;
 
                 var resStsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{dateOff.Year}-{scId}", new PartitionKey("Statistics"));
-                if (resStsInfo.Status == 200)
+                if (resStsInfo.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(resStsInfo.Content);
                     statsInfo = fileJson.ToObject<StatsInfo>();
@@ -79,7 +80,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                 else
                 {
                     var resLastStsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{dateOff.Year - 1}-{scId}", new PartitionKey("Statistics"));
-                    if (resLastStsInfo.Status == 200)
+                    if (resLastStsInfo.StatusCode == System.Net.HttpStatusCode.OK)
                     {
                         using var fileJson = await JsonDocument.ParseAsync(resLastStsInfo.Content);
                         statsInfo = fileJson.ToObject<StatsInfo>();
@@ -148,7 +149,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
 
                         StatsInfo lastStats = null;
                         var resLastStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{dateOff.Year - 1}-{scId}", new PartitionKey("Statistics"));
-                        if (resLastStats.Status == 200)
+                        if (resLastStats.StatusCode == System.Net.HttpStatusCode.OK)
                         {
                             using var fileJson = await JsonDocument.ParseAsync(resLastStats.Content);
                             lastStats = fileJson.ToObject<StatsInfo>();
@@ -186,7 +187,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                         statsInfo.lesson.week = ((int)lessList.SubMatrix(weekDayS.DayOfYear - 1, (dateOff.DayOfYear - weekDayS.DayOfYear + 1), 0, lessList.ColumnCount).ColumnSums().Sum());
 
                         //var resLast = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{lTermDayS.Year}-{scId}", new PartitionKey("Statistics"));
-                        //if (resLast.Status == 200)
+                        //if (resLast.StatusCode == System.Net.HttpStatusCode.OK)
                         //{
                         //    using var fileJson = await JsonDocument.ParseAsync(resLast.Content);
                         //    lastStats = fileJson.ToObject<StatsInfo>();
@@ -329,7 +330,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                             DenseMatrix lastAct = null;
                             StatsInfo lastStats = null;
                             var resLastStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{dateOff.Year - 1}-{scId}", new PartitionKey("Statistics"));
-                            if (resLastStats.Status == 200)
+                            if (resLastStats.StatusCode == System.Net.HttpStatusCode.OK)
                             {
                                 using var fileJson = await JsonDocument.ParseAsync(resLastStats.Content);
                                 lastStats = fileJson.ToObject<StatsInfo>();
@@ -431,7 +432,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                         }
                     }
                 }
-                if (resStsInfo.Status == 200)
+                if (resStsInfo.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     statsInfo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<StatsInfo>(statsInfo, statsInfo.id, new PartitionKey("Statistics"));
                 }
@@ -459,7 +460,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                 DateTimeOffset dateOff = DateTimeOffset.UtcNow;
                 StatsInfo statsInfo = new();
                 var resStats = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{dateOff.Year}-{school.id}", new PartitionKey("Statistics"));
-                if (resStats.Status == 200)
+                if (resStats.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(resStats.Content);
                     statsInfo = fileJson.ToObject<StatsInfo>();
@@ -489,7 +490,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                 statsInfo.areaId = school.areaId;
                 statsInfo.upTime = dateOff.ToUnixTimeMilliseconds();
 
-                if (resStats.Status == 200)
+                if (resStats.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<StatsInfo>(statsInfo, statsInfo.id, new PartitionKey("Statistics"));
                 }
@@ -520,7 +521,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                 string type = "";
                 BIRelation bIRelation = new();
                 var resBiRel = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(school.id, new PartitionKey("BIRel"));
-                if (resBiRel.Status == 200)
+                if (resBiRel.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     using var fileJson = await JsonDocument.ParseAsync(resBiRel.Content);
                     bIRelation = fileJson.ToObject<BIRelation>();
@@ -549,7 +550,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                 bIRelation.areaName = aName;
                 bIRelation.edition = school.edition;
 
-                if (resBiRel.Status == 200)
+                if (resBiRel.StatusCode == System.Net.HttpStatusCode.OK)
                 {
                     await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<BIRelation>(bIRelation, bIRelation.id, new PartitionKey("BIRel"));
                     type = "update";
@@ -634,7 +635,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
                             DenseMatrix lastInter = null;
                             DenseMatrix lastAct = null;
                             var lastSts = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReadItemStreamAsync($"{dateOff.Year - 1}-{item.schoolId}", new PartitionKey("Statistics"));
-                            if (lastSts.Status == 200)
+                            if (lastSts.StatusCode == System.Net.HttpStatusCode.OK)
                             {
                                 using var fileJson = await JsonDocument.ParseAsync(lastSts.Content);
                                 lastStatsInfo = fileJson.ToObject<StatsInfo>();

+ 1 - 1
TEAMModelOS.SDK/Models/Service/OpenApiService.cs

@@ -1,6 +1,6 @@
 using Azure;
 using Microsoft.Azure.Cosmos;
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.IO;

+ 26 - 26
TEAMModelOS.SDK/Models/Service/StudentService.cs

@@ -1211,7 +1211,7 @@ namespace TEAMModelOS.SDK
                 List<object> retStuds = new List<object>();
 
 
-                CosmosContainer cosmosContainer = _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student");
+               Container cosmosContainer = _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student");
 
                 long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 //並行處理
@@ -1331,12 +1331,12 @@ namespace TEAMModelOS.SDK
                     }
                     var response = await cosmosContainer.CreateItemStreamAsync(memoryStream, new PartitionKey($"Base-{schoolId}"));
 
-                    if (response.Status == (int)HttpStatusCode.Created)
+                    if (response.StatusCode == HttpStatusCode.Created)
                     {
                         //如果是Created則啥都不做,讓他去下面進行資料的彙整。
                     }
                     //查到已存在的id,則進行基本資料更新。
-                    else if (response.Status == (int)HttpStatusCode.Conflict)
+                    else if (response.StatusCode == HttpStatusCode.Conflict)
                     {
                         try
                         {
@@ -1489,7 +1489,7 @@ namespace TEAMModelOS.SDK
         /// keep 保持现状,导入时
         /// delete 因学生被删除,强制删除电子学生证。</param>
         /// <returns></returns>
-        public static async Task upsertImei(string stuid, string imeiid, string schoolId, string grand_type, CosmosContainer cosmosContainer)
+        public static async Task upsertImei(string stuid, string imeiid, string schoolId, string grand_type, Container cosmosContainer)
         {
             List<Imei> imeis = new List<Imei>();
             string sql = $"select value c from c where c.stuid='{stuid}'  and c.school='{schoolId}' ";
@@ -1535,7 +1535,7 @@ namespace TEAMModelOS.SDK
                     if (notin && !string.IsNullOrWhiteSpace(imeiid))
                     {
                         var imeiResponse = await cosmosContainer.ReadItemStreamAsync(imeiid, new PartitionKey("Imei"));
-                        if (imeiResponse.Status == 200)
+                        if (imeiResponse.StatusCode == HttpStatusCode.OK)
                         {
                             Imei imeiDb = JsonDocument.Parse(imeiResponse.Content).RootElement.Deserialize<Imei>();
                             imeiDb.stuid = stuid;
@@ -1682,11 +1682,11 @@ namespace TEAMModelOS.SDK
                 await upsertImei(studCreateInfo.id, studCreateInfo.imei, schoolId, "keep", _azureCosmos
                                .GetCosmosClient()
                                .GetContainer(Constant.TEAMModelOS, "Student"));
-                if (response.Status == (int)HttpStatusCode.Created || response.Status == (int)HttpStatusCode.OK) return true;
-                if (response.Status == (int)HttpStatusCode.Conflict) return false;
+                if (response.StatusCode == HttpStatusCode.Created || response.StatusCode == HttpStatusCode.OK) return true;
+                if (response.StatusCode == HttpStatusCode.Conflict) return false;
                 else
                 {
-                    await _dingDing.SendBotMsg($"IES5,{_option.Location},StudentController/createStudent()\nCosmosDB Create response status = {response.Status}\nID:{studCreateInfo.id}", GroupNames.醍摩豆服務運維群組);
+                    await _dingDing.SendBotMsg($"IES5,{_option.Location},StudentController/createStudent()\nCosmosDB Create response status = {response.StatusCode}\nID:{studCreateInfo.id}", GroupNames.醍摩豆服務運維群組);
                     return false;
                 }
 
@@ -1754,9 +1754,9 @@ namespace TEAMModelOS.SDK
                 writer.Flush();
 
                 var ret = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").CreateItemStreamAsync(memoryStream, new PartitionKey($"Class-{schoolId}"));
-                if (ret.Status != (int)HttpStatusCode.Created)
+                if (ret.StatusCode !=HttpStatusCode.Created)
                 {
-                    await _dingDing.SendBotMsg($"IES5,{_option.Location},StudentController/createClassInfo()\nStatus:{ret.Status}\nSchoolId:{schoolId},ClassId:{classId}", GroupNames.醍摩豆服務運維群組);
+                    await _dingDing.SendBotMsg($"IES5,{_option.Location},StudentController/createClassInfo()\nStatus:{ret.StatusCode}\nSchoolId:{schoolId},ClassId:{classId}", GroupNames.醍摩豆服務運維群組);
                 }
                 return (cId, classNo, className, periodId, gradeId, classYear);
             }
@@ -1832,7 +1832,7 @@ namespace TEAMModelOS.SDK
                        requestOptions: new QueryRequestOptions()
                        { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
                 {
-                    continuationToken = item.GetContinuationToken();
+                    continuationToken = item.ContinuationToken;
                     using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
@@ -1851,7 +1851,7 @@ namespace TEAMModelOS.SDK
                 List<object> ret = new List<object>();
                 //查教室資訊,使用上面的學生id並透過子查詢查詢。
                 queryText = $"SELECT c.id, c.name, c.gradeId, c.students FROM c JOIN (SELECT VALUE t FROM t IN c.students WHERE t.id IN ({string.Join(",", listStudent.Select(o => $"'{o.id}'"))}))";
-                await foreach (Response item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School")
+                await foreach (var  item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School")
                    .GetItemQueryStreamIteratorSql(
                    queryText: queryText,
                    //continuationToken: token,
@@ -1987,7 +1987,7 @@ namespace TEAMModelOS.SDK
                        requestOptions: new QueryRequestOptions()
                        { PartitionKey = new PartitionKey($"Base-{schoolId}"), MaxItemCount = -1 }))
                 {
-                    continuationToken = item.GetContinuationToken();
+                    continuationToken = item.ContinuationToken;
                     using var json = await JsonDocument.ParseAsync(item.Content);
                     if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
                     {
@@ -2197,7 +2197,7 @@ namespace TEAMModelOS.SDK
                 //if (!string.IsNullOrWhiteSpace(classId)) queryText += $" AND c.id = '{classId}'";
                 Dictionary<string, JsonElement> listStudent = new Dictionary<string, JsonElement>();
 
-                await foreach (Response item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School")
+                await foreach (var  item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School")
                     .GetItemQueryStreamIteratorSql(queryText: queryText, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{schoolId}") }))
                 {
                     using var json = await JsonDocument.ParseAsync(item.Content);
@@ -2247,7 +2247,7 @@ namespace TEAMModelOS.SDK
                         id = student.GetProperty("id").GetString();
                         var ret = await container.DeleteItemStreamAsync(id, new PartitionKey($"Base-{schoolId}"));
                         await upsertImei(id, null, schoolId, "delete", container);
-                        if (ret.Status == (int)HttpStatusCode.NoContent) sucIds.Add(id);
+                        if (ret.StatusCode == HttpStatusCode.NoContent) sucIds.Add(id);
                         await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<GroupList>(queryText: $"select value(c) from c join A0 in c.members where A0.id = '{id}' and A0.code='{schoolId}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"GroupList-{schoolId}") }))
                         {
                             scGroupLists.Add(item);
@@ -2340,7 +2340,7 @@ namespace TEAMModelOS.SDK
             if (impStuds.Count == 0) return (null, null, null);
 
             string queryText = $"SELECT VALUE c FROM c WHERE c.id IN ({string.Join(",", impStuds.Select(o => $"'{o}'"))})";
-            await foreach (Response item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
+            await foreach (var  item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
                             .GetItemQueryStreamIteratorSql(
                                 queryText: queryText,
                                 requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
@@ -2395,7 +2395,7 @@ namespace TEAMModelOS.SDK
                                   .GetContainer(Constant.TEAMModelOS, "Student")
                                   .ReplaceItemStreamAsync(stream, id, new PartitionKey($"Base-{schoolId}"));
 
-                        if (ret.Status == (int)HttpStatusCode.OK)
+                        if (ret.StatusCode == HttpStatusCode.OK)
                         {
                             sucStuds.Add(id);
                         }
@@ -2404,7 +2404,7 @@ namespace TEAMModelOS.SDK
                             impStuds.Remove(id);
                             errorIds.Add(id);
                             await _dingDing.SendBotMsg(
-                                $"IES5,{_option.Location},StudentController/removeStudentClassInfo(),CosmosDB response:{ret.Status}\nBase-{schoolId},id:{id}",
+                                $"IES5,{_option.Location},StudentController/removeStudentClassInfo(),CosmosDB response:{ret.StatusCode}\nBase-{schoolId},id:{id}",
                                 GroupNames.醍摩豆服務運維群組);
                         }
                     }
@@ -2430,7 +2430,7 @@ namespace TEAMModelOS.SDK
 
                     Dictionary<string, JsonElement> dicClassInfo = new Dictionary<string, JsonElement>();
 
-                    await foreach (Response item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School")
+                    await foreach (var  item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School")
                         .GetItemQueryStreamIteratorSql(queryText: queryText, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{schoolId}") }))
                     {
                         using var json = await JsonDocument.ParseAsync(item.Content);
@@ -2562,7 +2562,7 @@ namespace TEAMModelOS.SDK
                             if (student.TryGetProperty("pw", out var tmpPw) && !"******".Equals($"{tmpPw}"))
                             {
                                 var response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync(id.GetString(), new PartitionKey($"Base-{schoolId}"));
-                                if (response.Status == 200)
+                                if (response.StatusCode == HttpStatusCode.OK)
                                 {
                                     var rjson = await JsonDocument.ParseAsync(response.Content);
                                     rjson.RootElement.TryGetProperty("salt", out JsonElement _salt);
@@ -2646,7 +2646,7 @@ namespace TEAMModelOS.SDK
                 var classInfo = await getClassInfoUseId(_azureCosmos, _dingDing, _option, schoolId, classStuds.Keys.ToList());
 
                 //準備查詢db資料
-                CosmosContainer cosmosContainer = _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student");
+                Container cosmosContainer = _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student");
 
                 //查要移除教室或是沒加入教室的學生
 
@@ -2691,7 +2691,7 @@ namespace TEAMModelOS.SDK
 
                         List<JsonElement> listStudent = new List<JsonElement>();
 
-                        await foreach (Response responseItem in cosmosContainer
+                        await foreach (var  responseItem in cosmosContainer
                             .GetItemQueryStreamIteratorSql(
                                 queryText: queryText,
                                 requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
@@ -2989,7 +2989,7 @@ namespace TEAMModelOS.SDK
                                     {
                                         var ret = await cosmosContainer.ReplaceItemStreamAsync(memoryStream, id, new PartitionKey($"Base-{schoolId}"));
                                         //將更新完的id從字典內移除,保留沒查到的。
-                                        if (ret.Status == (int)HttpStatusCode.OK)
+                                        if (ret.StatusCode ==HttpStatusCode.OK)
                                         {
                                             nonexistentIds.Remove(id);
                                             retStuds.Add(new { id, tmpData.gender, tmpData.mail, tmpData.imei, tmpData.mobile, tmpData.name, tmpData.picture, tmpData.year, tmpData.no, classId, classNo, className, gradeId, periodId, tmpData.irs });
@@ -3049,7 +3049,7 @@ namespace TEAMModelOS.SDK
                     }
                     catch (CosmosException ex)
                     {
-                        if (ex.Status == (int)HttpStatusCode.Conflict) existId.Add(item.id);
+                        if (ex.StatusCode ==  HttpStatusCode.Conflict) existId.Add(item.id);
                         else exceptions.Add(ex);
                     }
                     catch (Exception ex)
@@ -3085,7 +3085,7 @@ namespace TEAMModelOS.SDK
 
             string queryText = $"SELECT c.id, c.no FROM c WHERE c.classId = '{classId}' AND c.code = 'Base-{schoolId}'";
             if (nos != null) queryText += $"AND c.no IN ({string.Join(",", nos.Select(o => $"'{o}'"))})";
-            await foreach (Response item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
+            await foreach (var  item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Student")
                 .GetItemQueryStreamIteratorSql(queryText: queryText, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
             {
                 using var json = await JsonDocument.ParseAsync(item.Content);
@@ -3121,7 +3121,7 @@ namespace TEAMModelOS.SDK
                     .GetContainer(Constant.TEAMModelOS, "School")
                     .ReadItemStreamAsync(schoolId, new PartitionKey("Base"));
 
-                if (response.Status != (int)HttpStatusCode.OK) return null;
+                if (response.StatusCode != HttpStatusCode.OK) return null;
 
                 using Stream stream = response.Content;
                 var jsonDoc = await JsonDocument.ParseAsync(stream);

+ 1 - 1
TEAMModelOS.SDK/Models/Service/Third/Sc/ScYxptModel.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;

+ 1 - 1
TEAMModelOS.SDK/Models/Service/Third/Xkw/XkwOAuthModel.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/BIOptLog.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/ChangeRecord.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Text;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/IESLogin.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Linq;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/Lesson.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using Newtonsoft.Json;
 using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/OpenApi.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Text;

+ 3 - 1
TEAMModelOS.SDK/Models/Table/OptLog.cs

@@ -2,7 +2,9 @@
 using System.Collections.Generic;
 using System.Text;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
-using Microsoft.Table;
+
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelOS.SDK.Models.Table
 {    

+ 1 - 1
TEAMModelOS.SDK/Models/Table/SchoolSetting.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using Newtonsoft.Json;
 using System.Text.Json.Serialization;
 using TEAMModelOS.SDK.Context.Attributes.Azure;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/SchoolYear.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Text;

+ 1 - 1
TEAMModelOS.SDK/Models/Table/ShortUrl.cs

@@ -1,4 +1,4 @@
-using Microsoft.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System;
 using System.Collections.Generic;
 using System.Text;

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

@@ -36,7 +36,7 @@
 		<PackageReference Include="PinYinConverterCore" Version="1.0.2" />
 		<PackageReference Include="StackExchange.Redis" Version="2.8.0" />
 		<!--<PackageReference Include="SvgNet" Version="3.3.6" />-->
-		<PackageReference Include="Microsoft.Table" Version="2.0.0-preview" />
+		<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="2.0.0-preview" />
 		<!--<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />-->
 		<PackageReference Include="NPinyin.Core" Version="3.0.0" />
 		<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />

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

@@ -3966,10 +3966,10 @@ namespace TEAMModelOS.Controllers.Client
             {
                 return BadRequest(cex.Message);
             }
-            catch (StorageException bex)
-            {
-                return BadRequest(bex.Message);
-            }
+            //catch (StorageException bex)
+            //{
+            //    return BadRequest(bex.Message);
+            //}
             catch (Exception ex)
             {
                 return BadRequest(ex.Message);

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

@@ -825,7 +825,7 @@ namespace TEAMModelOS.Controllers
                     }
                     if (iscontinuation)
                     {
-                        token = item.GetContinuationToken();
+                        token = item.ContinuationToken ;
                         break;
                     }
 
@@ -2971,7 +2971,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    return Ok(new { status = response.Status });
+                    return Ok(new { status = response.StatusCode });
                 }
 
             }
@@ -3944,7 +3944,7 @@ namespace TEAMModelOS.Controllers
                     }
                     if (iscontinuation)
                     {
-                        token = item.GetContinuationToken();
+                        token = item.ContinuationToken;
                         break;
                     }
                 }
@@ -4322,7 +4322,7 @@ namespace TEAMModelOS.Controllers
                 }
                 else
                 {
-                    return Ok(new { status = response.Status });
+                    return Ok(new { status = response.StatusCode });
                 }
 
             }

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

@@ -118,7 +118,7 @@ namespace TEAMModelOS.Controllers.Common
                 List<List<string>> answer = ans.ToObject<List<List<string>>>();
                 long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 var response = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"ExamLite-{code}"));
-                if (response.Status == (int)HttpStatusCode.OK)
+                if (response.StatusCode ==  HttpStatusCode.OK)
                 {
                     var json = await JsonDocument.ParseAsync(response.Content);
                     ExamLite trExam = json.ToObject<ExamLite>();
@@ -177,7 +177,7 @@ namespace TEAMModelOS.Controllers.Common
                 if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var response = await client.GetContainer("TEAMModelOS", "Common").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"ExamLite-{code}"));
-                return Ok(new { id, code = response.Status });
+                return Ok(new { id, code = response.StatusCode });
 
 
 
@@ -235,7 +235,7 @@ namespace TEAMModelOS.Controllers.Common
                     }
                     if (iscontinuation)
                     {
-                        continuationToken = item.GetContinuationToken();
+                        continuationToken = item.ContinuationToken;
                         break;
                     }
 

+ 5 - 5
TEAMModelOS/Controllers/Common/HomeworkController.cs

@@ -200,7 +200,7 @@ namespace TEAMModelOS.Controllers.Learn
                 }
                 return Ok(new { homework });
             } catch (CosmosException ex) {
-                return Ok(new { error = ex.Status });
+                return Ok(new { error = ex.StatusCode });
             }
             catch (Exception ex)
             {
@@ -325,7 +325,7 @@ namespace TEAMModelOS.Controllers.Learn
                     }
                     if (iscontinuation)
                     {
-                        token = item.GetContinuationToken();
+                        token = item.ContinuationToken;
                         break;
                     }
 
@@ -336,7 +336,7 @@ namespace TEAMModelOS.Controllers.Learn
             }
             catch (CosmosException ex)
             {
-                return Ok(new { error = ex.Status });
+                return Ok(new { error = ex.StatusCode });
             }
             catch (Exception ex) {
                 return Ok(new { error = 400 });
@@ -547,7 +547,7 @@ namespace TEAMModelOS.Controllers.Learn
                                         }
                                         catch (CosmosException ex)
                                         {
-                                            if (ex.Status == 404)
+                                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                                             {
                                                 HomeworkRecord record = new HomeworkRecord
                                                 {
@@ -623,7 +623,7 @@ namespace TEAMModelOS.Controllers.Learn
                                 }
                                 catch (CosmosException ex)
                                 {
-                                    if (ex.Status == 404)
+                                    if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                                     {
                                         HomeworkRecord record = new HomeworkRecord
                                         {

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

@@ -215,11 +215,11 @@ namespace TEAMModelOS.Controllers.Common
                 long now = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
                 var response = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(id.ToString(), new PartitionKey($"StudyRecord-{tmdid}"));
                 var sresponse = await client.GetContainer("TEAMModelOS", "Common").ReadItemStreamAsync(id.ToString(), new PartitionKey($"Study-{code}"));
-                if (sresponse.Status == (int)HttpStatusCode.OK)
+                if (sresponse.StatusCode ==  HttpStatusCode.OK)
                 {
                     var sJson = await JsonDocument.ParseAsync(sresponse.Content);
                     Study study = sJson.ToObject<Study>();
-                    if (response.Status == (int)HttpStatusCode.OK)
+                    if (response.StatusCode == HttpStatusCode.OK)
                     {
                         var json = await JsonDocument.ParseAsync(response.Content);
                         StudyRecord record = json.ToObject<StudyRecord>();
@@ -255,7 +255,7 @@ namespace TEAMModelOS.Controllers.Common
                     return Ok(new { code = HttpStatusCode.NotFound });
                 }
                 var srecord = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(id.ToString(), new PartitionKey($"StudyRecord-{tmdid}"));
-                if (srecord.Status == (int)HttpStatusCode.OK)
+                if (srecord.StatusCode ==  HttpStatusCode.OK)
                 {
                     return Ok();
                 }
@@ -495,7 +495,7 @@ namespace TEAMModelOS.Controllers.Common
                     }
                     if (iscontinuation)
                     {
-                        continuationToken = item.GetContinuationToken();
+                        continuationToken = item.ContinuationToken;
                         break;
                     }
 
@@ -530,7 +530,7 @@ namespace TEAMModelOS.Controllers.Common
                     foreach (var member in tchList)
                     {
                         var response = await client.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync(id.ToString(), new PartitionKey($"StudyRecord-{member.id}"));
-                        if (response.Status == (int)HttpStatusCode.OK)
+                        if (response.StatusCode == HttpStatusCode.OK)
                         {
                             var json = await JsonDocument.ParseAsync(response.Content);
                             StudyRecord record = json.ToObject<StudyRecord>();
@@ -582,7 +582,7 @@ namespace TEAMModelOS.Controllers.Common
                     return Ok(new { study, status = 404 });
                 }
             }
-            catch (CosmosException ex) when (ex.Status == 404)
+            catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
             {
                 return Ok(new { status = 404 });
             }

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

@@ -311,7 +311,7 @@ namespace TEAMModelOS.Controllers
                     }
                     if (iscontinuation)
                     {
-                        token = item.GetContinuationToken();
+                        token = item.ContinuationToken;
                         break;
                     }
                 }

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

@@ -299,7 +299,7 @@ namespace TEAMModelOS.Controllers
                     }
                     if (iscontinuation)
                     {
-                        token = item.GetContinuationToken();
+                        token = item.ContinuationToken;
                         break;
                     }
                 }

+ 1 - 1
TEAMModelOS/Controllers/Normal/AbilityController.cs

@@ -136,7 +136,7 @@ namespace TEAMModelOS.Controllers
                 {
                     var sresponse = await client.GetContainer("TEAMModelOS", "Normal").DeleteItemsStreamAsync(syllabus.Select(x => x.id).ToList(), $"AbilityTask-{standard}");
                 }
-                return Ok(new { code = response.Status });
+                return Ok(new { code = response.StatusCode });
             }
             catch (Exception ex)
             {

+ 5 - 5
TEAMModelOS/Controllers/Normal/AbilitySubController.cs

@@ -99,7 +99,7 @@ namespace TEAMModelOS.Controllers
                         }
                         catch (CosmosException ex)
                         {
-                            if (ex.Status == 404)
+                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                             {
                                 AbilitySub abilitySub = new AbilitySub
                                 {
@@ -249,7 +249,7 @@ namespace TEAMModelOS.Controllers
                         {
                             await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(abilitySub, new PartitionKey(abilitySub.code));
                         }
-                        catch (CosmosException ex) when (ex.Status == 409)
+                        catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.Conflict)
                         {
                             continue;
                         }
@@ -286,7 +286,7 @@ namespace TEAMModelOS.Controllers
                             {
                                 await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(abilitySub, new PartitionKey(abilitySub.code));
                             }
-                            catch (CosmosException ex) when (ex.Status == 409) {
+                            catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.Conflict) { 
                                 continue;
                             }
                         }
@@ -613,7 +613,7 @@ namespace TEAMModelOS.Controllers
                                 }
                                 catch (CosmosException ex)
                                 {
-                                    if (ex.Status == 404)
+                                    if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                                     {
                                         Debate debate = new Debate
                                         {
@@ -1092,7 +1092,7 @@ namespace TEAMModelOS.Controllers
         private async IAsyncEnumerable<(RMember, JsonElement)> GetSubsAsyn(List<RMember> tmdids,string _tmdid ,string _abilityId,string _school) {
             foreach (var tmdid in tmdids)
             {
-                Response  subs = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{_abilityId}", new PartitionKey($"AbilitySub-{_school}-{tmdid.id}"));
+                var  subs = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{_abilityId}", new PartitionKey($"AbilitySub-{_school}-{tmdid.id}"));
                 if (subs.StatusCode==System.Net.HttpStatusCode.OK) {
                     var json = await JsonDocument.ParseAsync(subs.Content);
                     JsonElement element =json.RootElement;

+ 1 - 1
TEAMModelOS/Controllers/Normal/AbilityTaskController.cs

@@ -311,7 +311,7 @@ namespace TEAMModelOS.Controllers
                 //if (!request.TryGetProperty("code", out JsonElement code)) return BadRequest();
                 var client = _azureCosmos.GetCosmosClient();
                 var response = await client.GetContainer("TEAMModelOS", "Normal").DeleteItemStreamAsync(id.ToString(), new PartitionKey($"AbilityTask-{standard}"));
-                return Ok(new { code = response.Status });
+                return Ok(new { code = response.StatusCode });
             }
             catch
             {

+ 3 - 3
TEAMModelOS/Controllers/Normal/AppraiseController.cs

@@ -78,7 +78,7 @@ namespace TEAMModelOS.Controllers
                         }
                         catch (CosmosException ex)
                         {
-                            if (ex.Status == 404)
+                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                             {
                                 isnew = true;
                                 appraise = new Appraise { id = $"{_videoId}", pk = "Appraise", code = code, ttl = -1, roles = new List<AppraiseRole> { new AppraiseRole { commentTmdid=$"{_scoreTmdid}", roleType = $"{_roleType}" } } };
@@ -155,7 +155,7 @@ namespace TEAMModelOS.Controllers
                         }
                         catch (CosmosException ex)
                         {
-                            if (ex.Status == 404)
+                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                             {
                                 debate = new Debate
                                 {
@@ -198,7 +198,7 @@ namespace TEAMModelOS.Controllers
                         }
                         catch (CosmosException ex)
                         {
-                            if (ex.Status == 404)
+                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                             {
                                 isnewComment = true;
                                 appraiseComment = new Appraise { id = $"{_videoId}", pk = "Appraise", code = code, ttl = -1, roles = new List<AppraiseRole> { new AppraiseRole {commentTmdid=$"{_commentTmdid}", roleType = $"{_roleTypeComment}" } } };

+ 2 - 2
TEAMModelOS/Controllers/Normal/AreaSettingController.cs

@@ -68,7 +68,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (CosmosException ex)
             {
-                return Ok(new { setting, error = ex.Status });
+                return Ok(new { setting, error = ex.StatusCode });
             }
         }
         /// <summary>
@@ -93,7 +93,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (CosmosException ex)
             {
-                return Ok(new { error = ex.Status });
+                return Ok(new { error = ex.StatusCode });
             }
         }
     }

+ 5 - 4
TEAMModelOS/Controllers/Normal/ArtSettingController.cs

@@ -5,7 +5,7 @@ using Azure.Storage.Sas;
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.Table;
+ 
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Options;
 using System;
@@ -25,6 +25,7 @@ using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.Common;
 
 using TEAMModelOS.SDK.Models.Service;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelOS.Controllers
 {
@@ -181,7 +182,7 @@ namespace TEAMModelOS.Controllers
                 setting = await client.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemAsync<ArtSetting>($"{_areaId}", partitionKey: new PartitionKey("ArtSetting"));
                 return Ok(new { setting });
             }
-            catch (CosmosException ex) when (ex.Status == 404)
+            catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
             {
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOAuth");
                 string tbqurey = $"PartitionKey {QueryComparisons.Equal} 'OAuthShow' and Domain {QueryComparisons.Equal} '{OAuthShow_domain}'and Type {QueryComparisons.Equal} 'art' and  Code  {QueryComparisons.Equal} '{_areaId}' ";
@@ -240,7 +241,7 @@ namespace TEAMModelOS.Controllers
             {
                 setting = await client.GetContainer(Constant.TEAMModelOS, Constant.Normal).ReadItemAsync<ArtSetting>($"{_areaId}", new PartitionKey($"ArtSetting"));
             }
-            catch (CosmosException ex) when (ex.Status == 404)
+            catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
             {
                 var table = _azureStorage.GetCloudTableClient().GetTableReference("IESOAuth");
                 string tbqurey = $"PartitionKey {QueryComparisons.Equal} 'OAuthShow' and Domain {QueryComparisons.Equal} '{OAuthShow_domain}'and Type {QueryComparisons.Equal} 'art' and  Code  {QueryComparisons.Equal} '{_areaId}' ";
@@ -322,7 +323,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (CosmosException ex)
             {
-                return Ok(new { error = ex.Status });
+                return Ok(new { error = ex.StatusCode });
             }
         }
     }

+ 2 - 2
TEAMModelOS/Controllers/OpenApi/Business/BizSSOController.cs

@@ -28,7 +28,7 @@ using System.Web;
 using static TEAMModelOS.Controllers.FixDataController;
 using static TEAMModelOS.SDK.SchoolService;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.Table;
+ 
 using System.Net.Http;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using System.Security.Cryptography.Xml;
@@ -482,7 +482,7 @@ namespace TEAMModelOS.Controllers
             }
             await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).UpsertItemAsync(teacher, new PartitionKey(teacher.code));
             ResponseMessage responseSchoolTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemStreamAsync(tmdid, new PartitionKey($"Teacher-{school.id}"));
-            if (responseSchoolTeacher.Status != 200)
+            if (responseSchoolTeacher.StatusCode != System.Net.HttpStatusCode.OK)
             {
                 SchoolTeacher schoolTeacher = new SchoolTeacher
                 {

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

@@ -225,7 +225,7 @@ namespace TEAMModelOS.Controllers
 
                 Business business = new();
                 var response = await cosmosClient.GetContainer("TEAMModelOS", "Normal").ReadItemStreamAsync($"{id}", new PartitionKey("BizConfig"));
-                if (response.Status == RespondCode.Ok)
+                if (response.StatusCode == HttpStatusCode.OK)
                 {
                     using var json = await JsonDocument.ParseAsync(response.Content);
                     business = json.ToObject<Business>();

+ 1 - 1
TEAMModelOS/Controllers/School/ArtReviewController.cs

@@ -371,7 +371,7 @@ namespace TEAMModelOS.Controllers
                                             results.Add(student);
                                         }
                                     }
-                                    continuationToken = item.GetContinuationToken();
+                                    continuationToken = item.ContinuationToken;
                                     break;
                                 }
                                 if (subjects.IsNotEmpty())

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

@@ -275,7 +275,7 @@ namespace TEAMModelOS.Controllers
             catch (CosmosException ex)
             {
                 Correct correct = null;
-                return Ok(new { correct, status = ex.Status });
+                return Ok(new { correct, status = ex.StatusCode });
             }
             catch (Exception ex)
             {
@@ -357,7 +357,7 @@ namespace TEAMModelOS.Controllers
             catch (CosmosException ex)
             {
                 Correct correct = null;
-                return Ok(new { correct, status = ex.Status });
+                return Ok(new { correct, status = ex.StatusCode });
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS/Controllers/School/DebateController.cs

@@ -397,7 +397,7 @@ namespace TEAMModelOS.Controllers
                     await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").ReplaceItemAsync(debate, debate.id, new PartitionKey(debate.code));
                 }
                 catch (CosmosException ex) {
-                    if (ex.Status == 404) {
+                    if (ex.StatusCode == System.Net.HttpStatusCode.NotFound) {
                         await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").CreateItemAsync(debate,  new PartitionKey(debate.code));
                     }
                 }

+ 2 - 4
TEAMModelOS/Controllers/School/ImportExamController.cs

@@ -17,7 +17,7 @@ using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension; 
 using TEAMModelOS.SDK.Models;
 using TEAMModelOS.SDK.Models.Cosmos.School;
-
+using Microsoft.Azure.Cosmos;
 namespace TEAMModelOS.Controllers
 {
     [ProducesResponseType(StatusCodes.Status200OK)]
@@ -231,13 +231,11 @@ namespace TEAMModelOS.Controllers
                 }
                 if (changeDataQuotaImports.Any())
                 {
-                    double ru = 0;
+                     
                     //196条数据产生RU:2341.739999999998 
                     foreach (var quotaImport in changeDataQuotaImports)
                     {
                         ItemResponse<QuotaImport> a = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).UpsertItemAsync<QuotaImport>(quotaImport, new PartitionKey(quotaImport.code));
-                        a.GetRawResponse().Headers.TryGetValue("x-ms-request-charge", out var value);
-                        ru = ru + Convert.ToDouble(value);
                     }
                 }
             }

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

@@ -33,7 +33,8 @@ using TEAMModelOS.SDK.Models.Cosmos.BI;
 using TEAMModelOS.SDK.Models.Cosmos.School;
 using TEAMModelOS.SDK.Models.Service.BI;
 using static TEAMModelOS.SDK.Models.Teacher;
-
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 namespace TEAMModelOS.Controllers
 {
     [ProducesResponseType(StatusCodes.Status200OK)]

+ 1 - 1
TEAMModelOS/Controllers/School/SchoolSettingController.cs

@@ -121,7 +121,7 @@ namespace TEAMModelOS.Controllers
             {
                 setting = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<SchoolSetting>($"{_school}", new PartitionKey($"SchoolSetting"));
             }
-            catch (CosmosException ex) when (ex.Status == 404)
+            catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
             {
                 setting = new SchoolSetting();
                 setting.id = $"{_school}";

+ 2 - 0
TEAMModelOS/Controllers/School/SchoolTeacherController.cs

@@ -26,6 +26,8 @@ using static TEAMModelOS.Controllers.FixDataController;
 using Microsoft.Extensions.Hosting;
 using Microsoft.AspNetCore.Hosting;
 
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 using TEAMModelOS.SDK.Models.Dtos;
 using static TEAMModelOS.Controllers.SchoolTeacherController;
 

+ 1 - 1
TEAMModelOS/Controllers/Student/StudentCommonController.cs

@@ -467,7 +467,7 @@ namespace TEAMModelOS.Controllers
                     }
                     if (iscontinuation)
                     {
-                        token = item.GetContinuationToken();
+                        token = item.ContinuationToken;
                         break;
                     }
                 }

+ 2 - 6
TEAMModelOS/Controllers/Student/StudentController.cs

@@ -16,7 +16,6 @@ using Azure;
 using Microsoft.Azure.Cosmos;
 using Azure.Messaging.ServiceBus;
 using Azure.Storage.Sas;
- 
 using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Cryptography.KeyDerivation;
 using Microsoft.AspNetCore.Hosting;
@@ -35,10 +34,7 @@ using TEAMModelOS.SDK;
 using TEAMModelOS.SDK.DI;
 using TEAMModelOS.SDK.Extension;
 using TEAMModelOS.SDK.Models;
-using TEAMModelOS.SDK.Models.Cosmos;
-using TEAMModelOS.SDK.Models.Cosmos.Common;
 using TEAMModelOS.SDK.Models.Service;
-using static TEAMModelOS.SDK.Services.BlobService;
 using static TEAMModelOS.SDK.StudentService;
 
 namespace TEAMModelOS.Controllers
@@ -590,7 +586,7 @@ namespace TEAMModelOS.Controllers
                 return BadRequest();
             }
         }
-        private async Task<(string auth_token, string blob_uri, string blob_sas, object classinfo, List<object> courses, AuthenticationResult token)> StudentCheck(School schoolBase,string id, string classId, string school_code, string picture, string name, CosmosContainer schoolClient, CosmosContainer teacherClient, string areaId,string ip,CosmosClient cosmosClient,Student student)
+        private async Task<(string auth_token, string blob_uri, string blob_sas, object classinfo, List<object> courses, AuthenticationResult token)> StudentCheck(School schoolBase,string id, string classId, string school_code, string picture, string name, Container schoolClient, Container teacherClient, string areaId,string ip,CosmosClient cosmosClient,Student student)
         {
             //班級課程
             object classinfo = null;
@@ -1444,7 +1440,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (CosmosException ex)
             {
-                return Ok(new { status = ex.Status }); ;
+                return Ok(new { status = ex.StatusCode }); ;
             }
             catch (Exception ex)
             {

+ 1 - 1
TEAMModelOS/Controllers/Student/TmdUserController.cs

@@ -138,7 +138,7 @@ namespace TEAMModelOS.Controllers
                 }
                 catch (CosmosException ex)
                 {
-                    if (ex.Status == 404)
+                    if (ex.StatusCode ==    System.Net.HttpStatusCode.NotFound)
                     {
                         //如果沒有,則初始化Teacher基本資料到Cosmos
                         TmdUser teacher = new TmdUser

+ 4 - 3
TEAMModelOS/Controllers/System/BlobController.cs

@@ -37,7 +37,8 @@ using Azure.Storage.Blobs.Specialized;
 
 using Microsoft.AspNetCore.Cors;
 using TEAMModelOS.Controllers.Third.LePei;
-using Microsoft.Table;
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelOS.Controllers
 {
@@ -550,7 +551,7 @@ namespace TEAMModelOS.Controllers
                         queryDefinition.WithParameter("@url", url);
                         if (scope.GetString().Equals("school"))
                         {
-                            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorSql<Bloblog>(queryDefinition: queryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
+                            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIteratorQuery<Bloblog>(queryDefinition: queryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
                             {
                                 item.time = now;
                                 item.size = size != null && size.HasValue ? size.Value : 0;
@@ -564,7 +565,7 @@ namespace TEAMModelOS.Controllers
                         }
                         else if (scope.GetString().Equals("private"))
                         {
-                            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Bloblog>(queryDefinition: queryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
+                            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorQuery<Bloblog>(queryDefinition: queryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Bloblog-{name}") }))
                             {
                                 item.time = now;
                                 item.size = size != null && size.HasValue ? size.Value : 0;

+ 8 - 8
TEAMModelOS/Controllers/System/CoreController.cs

@@ -169,7 +169,7 @@ namespace TEAMModelOS.Controllers
                                     {
                                         ResponseMessage schoolTeacherResponse = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School)
                                                .ReadItemStreamAsync($"{_tmdid}", new PartitionKey($"Teacher-{_schoolId}"));
-                                        if (teacherResponse.Status == 200 && schoolTeacherResponse.StatusCode==System.Net.HttpStatusCode.OK)
+                                        if (teacherResponse.StatusCode == HttpStatusCode.OK && schoolTeacherResponse.StatusCode==System.Net.HttpStatusCode.OK)
                                         {
                                             var teacher = JsonDocument.Parse(teacherResponse.Content).RootElement.Deserialize<Teacher>();
                                             var schoolTeacher = JsonDocument.Parse(schoolTeacherResponse.Content).RootElement.Deserialize<SchoolTeacher>();
@@ -185,7 +185,7 @@ namespace TEAMModelOS.Controllers
                                                     _coreAPIHttpService.PushNotify(new List<IdNameCode> { new IdNameCode {id= teacher.id,name= teacher.name,code= teacher.lang } }, $"quited_school", Constant.NotifyType_IES5_Management,
                                                     new Dictionary<string, object> {   { "schoolName", qschool.name }, { "schoolId", $"{_schoolId}" } }, _option.Location, _configuration, _dingDing, _environment.ContentRootPath);
                                                 }
-                                                catch (CosmosException ex) when (ex.Status == 404)
+                                                catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
                                                 {
 
                                                 }
@@ -236,7 +236,7 @@ namespace TEAMModelOS.Controllers
                                       
                                         ResponseMessage schoolTeacherResponse = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School)
                                                .ReadItemStreamAsync($"{_tmdid}", new PartitionKey($"Teacher-{_schoolId}"));
-                                        if (teacherResponse.Status == 200 && schoolTeacherResponse.StatusCode==System.Net.HttpStatusCode.OK)
+                                        if (teacherResponse.StatusCode == HttpStatusCode.OK && schoolTeacherResponse.StatusCode==System.Net.HttpStatusCode.OK)
                                         {
                                             var teacher = JsonDocument.Parse(teacherResponse.Content).RootElement.Deserialize<Teacher>();
                                             var schoolTeacher = JsonDocument.Parse(schoolTeacherResponse.Content).RootElement.Deserialize<SchoolTeacher>();
@@ -254,7 +254,7 @@ namespace TEAMModelOS.Controllers
                                                 try {
                                                     await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync(schoolTeacher, schoolTeacher.id, new PartitionKey(schoolTeacher.code));
                                                     await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync(teacher, teacher.id, new PartitionKey(teacher.code));
-                                                } catch (CosmosException ex) when (ex.Status == 404) {
+                                                } catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound) {
                                                     
                                                 }
                                                 code = 2;
@@ -275,7 +275,7 @@ namespace TEAMModelOS.Controllers
                                                         await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).DeleteItemStreamAsync($"{opttmdid}", new PartitionKey($"Teacher-{_schoolId}"));
                                                         await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync(teacher, teacher.id, new PartitionKey(teacher.code));
                                                     }
-                                                    catch (CosmosException ex) when (ex.Status == 404)
+                                                    catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
                                                     {
                                                     }
                                                     code = 2;
@@ -319,7 +319,7 @@ namespace TEAMModelOS.Controllers
                                        .ReadItemStreamAsync($"{opttmdid}", new PartitionKey($"Teacher-{_schoolId}"));
                                 ResponseMessage optTeacherResponse = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher)
                                       .ReadItemStreamAsync($"{opttmdid}", new PartitionKey($"Base"));
-                                if (optTeacherResponse.Status == 200 && schoolTeacherResponse.StatusCode==System.Net.HttpStatusCode.OK)
+                                if (optTeacherResponse.StatusCode == HttpStatusCode.OK && schoolTeacherResponse.StatusCode==System.Net.HttpStatusCode.OK)
                                 {
                                     var teacher = JsonDocument.Parse(optTeacherResponse.Content).RootElement.Deserialize<Teacher>();
                                     var schoolTeacher = JsonDocument.Parse(schoolTeacherResponse.Content).RootElement.Deserialize<SchoolTeacher>();
@@ -339,7 +339,7 @@ namespace TEAMModelOS.Controllers
                                         await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync(schoolTeacher, schoolTeacher.id, new PartitionKey(schoolTeacher.code));
                                         await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync(teacher, teacher.id, new PartitionKey(teacher.code));
                                         }
-                                        catch (CosmosException ex) when (ex.Status == 404)
+                                        catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
                                         {
                                         }
                                         code = 2;
@@ -359,7 +359,7 @@ namespace TEAMModelOS.Controllers
                                             await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).DeleteItemStreamAsync($"{opttmdid}", new PartitionKey($"Teacher-{_schoolId}"));
                                             await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).ReplaceItemAsync(teacher, teacher.id, new PartitionKey(teacher.code));
                                             }
-                                            catch (CosmosException ex) when (ex.Status == 404)
+                                            catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound)
                                             {
                                             }
                                             code = 2;

+ 3 - 3
TEAMModelOS/Controllers/Teacher/ClassVideoController.cs

@@ -324,7 +324,7 @@ namespace TEAMModelOS.Controllers
                         }
                         catch (CosmosException ex)
                         {
-                            if (ex.Status == 404)
+                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                             {
                                 return Ok(new { status = 0 });
                             }
@@ -364,7 +364,7 @@ namespace TEAMModelOS.Controllers
                             }
                             catch (CosmosException ex)
                             {
-                                if (ex.Status == 404) {
+                                if (ex.StatusCode ==System.Net.HttpStatusCode.NotFound) {
                                     classVideo = new ClassVideo { id = $"{_tmdid}", pk = "ClassVideo", code = code, school = $"{_school}", creatorId = $"{_tmdid}", files = files };
                                     await client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync<ClassVideo>(classVideo, new PartitionKey(code));
                                 }
@@ -407,7 +407,7 @@ namespace TEAMModelOS.Controllers
                         }
                         catch (CosmosException ex)
                         {
-                            if (ex.Status == 404)
+                            if (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
                             {
                                // await client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync<ClassVideo>(video, new PartitionKey(code));
                                 return Ok(new { classVideo= video });

+ 4 - 3
TEAMModelOS/Controllers/Teacher/InitController.cs

@@ -29,7 +29,8 @@ using Microsoft.AspNetCore.Authorization;
 using System.Diagnostics;
 using Microsoft.Extensions.Logging;
 using System.Text;
-using Microsoft.Table;
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 using Microsoft.AspNetCore.Hosting;
 
 
@@ -771,7 +772,7 @@ namespace TEAMModelOS.Controllers
                         {
                             await client.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<ItemCond>(itemCond, new PartitionKey($"ItemCond-{school_code}"));
                         }
-                        catch (CosmosException ex) when (ex.Status == 409)
+                        catch (CosmosException ex) when (ex.StatusCode == System.Net.HttpStatusCode.Conflict)
                         {
                             continue;
                         }
@@ -1031,7 +1032,7 @@ namespace TEAMModelOS.Controllers
                 HttpContext.Request.Headers.TryGetValue("sec-ch-ua-platform", out var platform);
                 HttpContext.Request.Headers.TryGetValue("user-agent", out var useragent);
                 await _dingDing.SendBotMsg($"IES5,{_option.Location},Teacher/init/get-school-info()\n{ex.Message}\n{ex.StackTrace}\n{request.ToJsonString()}\nreferer:{referer}\nsec-ch-ua:{chua}\nsec-ch-ua-platform:{platform}\nuser-agent:{useragent}", GroupNames.醍摩豆服務運維群組);
-                return BadRequest(new { status = ex.Status });
+                return BadRequest(new { status = ex.StatusCode });
             }
             catch (Exception ex)
             {

+ 5 - 3
TEAMModelOS/Controllers/Third/LePei/LePeiController.cs

@@ -29,7 +29,9 @@ using System.Web;
 using static TEAMModelOS.Controllers.FixDataController;
 using static TEAMModelOS.SDK.SchoolService;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.Table;
+
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 using System.Net.Http;
 using TEAMModelOS.SDK.Context.Attributes.Azure;
 using System.Security.Cryptography.Xml;
@@ -381,7 +383,7 @@ namespace TEAMModelOS.Controllers.Third.LePei
         private async void JoinSchool(string tmdid,string name ,string picture, School  school  )
         {
             Teacher teacher = null;
-            Azure .Response responseTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync(tmdid, new PartitionKey("Base"));
+            ResponseMessage responseTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync(tmdid, new PartitionKey("Base"));
             if (responseTeacher.StatusCode==System.Net.HttpStatusCode.OK)
             {
                 teacher = JsonDocument.Parse(responseTeacher.Content).RootElement.ToObject<Teacher>();
@@ -420,7 +422,7 @@ namespace TEAMModelOS.Controllers.Third.LePei
             }
             await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Teacher).UpsertItemAsync(teacher, new PartitionKey(teacher.code));
             ResponseMessage responseSchoolTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReadItemStreamAsync(tmdid, new PartitionKey($"Teacher-{school.id}"));
-            if (responseSchoolTeacher.Status != 200)
+            if (responseSchoolTeacher.StatusCode != System.Net.HttpStatusCode.OK)
             {
                 SchoolTeacher schoolTeacher = new SchoolTeacher
                 {

+ 1 - 1
TEAMModelOS/Controllers/Third/Moofen/MoofenController.cs

@@ -20,7 +20,7 @@ using System.Linq;
 using System.Net.Http;
 using System.Net;
 using System.Net.Http.Headers;
- 
+using Microsoft.Azure.Cosmos;
 using TEAMModelOS.SDK.DI;
 
 

+ 1 - 1
TEAMModelOS/Controllers/Third/OAuth2Controller.cs

@@ -33,7 +33,7 @@ using TEAMModelOS.Filter;
 using TEAMModelOS.Controllers.Third.Xkw;
 using Microsoft.Extensions.Primitives;
 using System.Net.Http;
-using Microsoft.Table;
+ 
 using Flurl.Http.Configuration;
 using System.Runtime.Intrinsics.X86;
 using FastJSON;

+ 5 - 3
TEAMModelOS/Controllers/Third/Sc/ScController.cs

@@ -29,7 +29,9 @@ using System.Web;
 using static TEAMModelOS.Controllers.FixDataController;
 using static TEAMModelOS.SDK.SchoolService;
 using Microsoft.AspNetCore.Hosting;
-using Microsoft.Table;
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
+using Microsoft.Azure.Cosmos;
 using System.Net.Http;
 
 namespace TEAMModelOS.Controllers
@@ -218,7 +220,7 @@ namespace TEAMModelOS.Controllers
                                 }
                             }
                             ResponseMessage response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(teacher.id, new PartitionKey($"Teacher-{school.schoolId}"));
-                            if (response.Status != 200)
+                            if (response.StatusCode != System.Net.HttpStatusCode.OK)
                             {
                                 SchoolTeacher schoolTeacher = new SchoolTeacher
                                 {
@@ -426,7 +428,7 @@ namespace TEAMModelOS.Controllers
                         }
                     }
                 }
-                catch (CosmosException ex) when (ex.Status ==404)
+                catch (CosmosException ex) when (ex.StatusCode ==System.Net.HttpStatusCode.NotFound)
                 {
                     teacher = new Teacher
                     {

+ 1 - 1
TEAMModelOS/Controllers/Third/Sc/ScDataInitController.cs

@@ -864,7 +864,7 @@ namespace TEAMModelOS.Controllers.Third
                 }
                 catch (CosmosException ex)
                 {
-                    failedmsg.Add($"{school.ToJsonString()}\n \n{ex.Status}{ex.Message}\n ");
+                    failedmsg.Add($"{school.ToJsonString()}\n \n{ex.StatusCode}{ex.Message}\n ");
                     schoolsfailed.Add(school);
                 }
                 catch (Exception ex)

+ 4 - 7
TEAMModelOS/Controllers/Third/Sc/ScDataPushController.cs

@@ -14,12 +14,7 @@ using Microsoft.Azure.Cosmos;
 using System.Text;
 using Microsoft.Extensions.Options;
 using Microsoft.Extensions.Configuration;
- 
-using System.Threading;
-using Microsoft.Table;
-using DinkToPdf;
 using DinkToPdf.Contracts;
-using System.IO;
 using Microsoft.AspNetCore.Authorization;
 using TEAMModelOS.Filter;
 using System.Net.Http;
@@ -29,8 +24,10 @@ using System.Security.Policy;
 using TEAMModelOS.Controllers.Third.LePei;
 
 using System.Text.RegularExpressions;
-using Microsoft.Linq;
-using Flurl;
+
+
+using TEAMModelOS.SDK.Models.Table;
+using Microsoft.Azure.Cosmos.Table;
 
 namespace TEAMModelOS.Controllers
 {

+ 0 - 1
TEAMModelOS/Controllers/Third/Xkw/XkwOAuth2Controller.cs

@@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Http;
 using TEAMModelOS.SDK.Extension;
 using Microsoft.Azure.Cosmos;
 using System.Text;
-using TEAMModelOS.SDK.DI;
 using Microsoft.Extensions.Options;
 using Azure.Messaging.ServiceBus;
 using Microsoft.Extensions.Configuration;

+ 3 - 3
TEAMModelOS/Controllers/XTest/BusinessController.cs

@@ -123,7 +123,7 @@ namespace TEAMModelOS.Controllers.XTest
             }
             catch (CosmosException ex)
             {
-                return Ok(new { status = ex.Status });
+                return Ok(new { status = ex.StatusCode });
 
             }
             catch (Exception _) {
@@ -150,7 +150,7 @@ namespace TEAMModelOS.Controllers.XTest
             }
             catch (CosmosException ex)
             {
-                return Ok(new { status = ex.Status });
+                return Ok(new { status = ex.StatusCode });
 
             }
             catch (Exception _)
@@ -211,7 +211,7 @@ namespace TEAMModelOS.Controllers.XTest
             }
             catch (CosmosException ex)
             {
-                return Ok(new { status = ex.Status });
+                return Ok(new { status = ex.StatusCode });
 
             }
             catch (Exception _)

+ 2 - 2
TEAMModelOS/Controllers/XTest/DataMigrationController.cs

@@ -1191,7 +1191,7 @@ namespace TEAMModelOS.Controllers
         {
             var client = _azureCosmos.GetCosmosClient();
             List<TmdUser> users = new List<TmdUser>();
-            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Teacher>(requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
+            await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIteratorSql<Teacher>(queryText:"select value c from c ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
             {
                 ///修复历史数据
                 if (item.size > 0)
@@ -1215,7 +1215,7 @@ namespace TEAMModelOS.Controllers
                     }
                     catch (CosmosException ex)
                     {
-                        if (ex.Status == 404)
+                        if (ex.StatusCode == HttpStatusCode.NotFound)
                         {
                             TmdUser user = item.ToJsonString().ToObject<TmdUser>();
                             await client.GetContainer(Constant.TEAMModelOS, "Student").CreateItemAsync<TmdUser>(user, partitionKey: new PartitionKey("Base"));

+ 2 - 2
TEAMModelOS/Controllers/XTest/FixDataController.cs

@@ -4069,7 +4069,7 @@ namespace TEAMModelOS.Controllers
                             byte[] bytes = Encoding.UTF8.GetBytes(jsonElm.GetRawText());
                             var memoryStream = new MemoryStream(bytes);
                             var resp = await cosmosClient.GetContainer(Constant.TEAMModelOS, itemC).CreateItemStreamAsync(memoryStream, new PartitionKey($"{code}"));
-                            if (resp.Status != 201)
+                            if (resp.StatusCode != HttpStatusCode.Created)
                                 noFail.Add(new { container = itemC, id = oldId, code = oldCode });
                         }
                     }
@@ -4089,7 +4089,7 @@ namespace TEAMModelOS.Controllers
                         byte[] bytes = Encoding.UTF8.GetBytes(jsonElm.GetRawText());
                         var memoryStream = new MemoryStream(bytes);
                         var resp = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemStreamAsync(memoryStream, $"{id}", new PartitionKey($"Base"));
-                        if(resp.Status != 200)
+                        if(resp.StatusCode != HttpStatusCode.OK)
                           noFail.Add(new { container = "Teacher", id = id, code = code });
                     }
                 }

+ 11 - 11
TEAMModelOS/Controllers/XTest/TestController.cs

@@ -562,7 +562,7 @@ namespace TEAMModelOS.Controllers
                             }
                             else {
                                 ResponseMessage response = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).ReadItemStreamAsync(oid, new PartitionKey(ocode));
-                                if (response.Status != 200)
+                                if (response.StatusCode != HttpStatusCode.OK)
                                 {
                                     overallEducation = new OverallEducation
                                     {
@@ -1139,7 +1139,7 @@ namespace TEAMModelOS.Controllers
             byte[] bytes = Encoding.UTF8.GetBytes(json.GetRawText());
             var memoryStream = new MemoryStream(bytes);
             ResponseMessage res = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).CreateItemStreamAsync(memoryStream, new PartitionKey("Base12"));
-            if (res.Status == 201)
+            if (res.StatusCode == HttpStatusCode.Created)
             {
                 return Ok(201);
             }
@@ -1421,7 +1421,7 @@ namespace TEAMModelOS.Controllers
             }
             catch (CosmosException ex)
             {
-                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-研修数据变更,重新统计-TeacherTrainChange\n{msg}\n{ex.Message}\n{ex.StackTrace}\nCosmosException{ex.Status}", GroupNames.醍摩豆服務運維群組);
+                await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-研修数据变更,重新统计-TeacherTrainChange\n{msg}\n{ex.Message}\n{ex.StackTrace}\nCosmosException{ex.StatusCode}", GroupNames.醍摩豆服務運維群組);
             }
             catch (Exception ex)
             {
@@ -1607,11 +1607,11 @@ namespace TEAMModelOS.Controllers
             try
             {
                 ItemResponse<Student> a = await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemAsync<Student>("1111111", new PartitionKey($"Course-111111"));
-                Ok(a.GetRawResponse().Status);
+                Ok(a.StatusCode);
             }
             catch (CosmosException ex)
             {
-                if (ex.Response.Status == 404)
+                if (ex.StatusCode ==HttpStatusCode.NotFound)
                 {
                     aaa = "404";
                 }
@@ -1620,11 +1620,11 @@ namespace TEAMModelOS.Controllers
             try
             {
                 ItemResponse<Student> a = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemAsync<Student>("1111111", new PartitionKey($"Course-111111"));
-                Ok(a.GetRawResponse().Status);
+                Ok(a.StatusCode);
             }
             catch (CosmosException ex)
             {
-                if (ex.Response.Status == 404)
+                if (ex.StatusCode == HttpStatusCode.NotFound)
                 {
                     aaa = aaa + " 404";
                 }
@@ -1632,11 +1632,11 @@ namespace TEAMModelOS.Controllers
             try
             {
                 var a = await client.GetContainer(Constant.TEAMModelOS, "Student").DeleteItemStreamAsync("1111111", new PartitionKey($"Course-111111"));
-                Ok(a.Status);
+                Ok(a.StatusCode);
             }
             catch (CosmosException ex)
             {
-                if (ex.Response.Status == 404)
+                if (ex.StatusCode == HttpStatusCode.NotFound)
                 {
                     aaa = "404";
                 }
@@ -1645,11 +1645,11 @@ namespace TEAMModelOS.Controllers
             try
             {
                 var a = await client.GetContainer(Constant.TEAMModelOS, "Student").ReadItemStreamAsync("1111111", new PartitionKey($"Course-111111"));
-                Ok(a.Status);
+                Ok(a.StatusCode);
             }
             catch (CosmosException ex)
             {
-                if (ex.Response.Status == 404)
+                if (ex.StatusCode == HttpStatusCode.NotFound)
                 {
                     aaa = aaa + " 404";
                 }