浏览代码

修复接口

CrazyIter_Bin 3 年之前
父节点
当前提交
d986dff574
共有 1 个文件被更改,包括 7 次插入8 次删除
  1. 7 8
      TEAMModelOS.SDK/Models/Service/FixDataService.cs

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

@@ -77,17 +77,16 @@ namespace TEAMModelOS.SDK.Models.Service
                     }
                 }
             }
-            if (data.TryGetProperty("name", out JsonElement _name))
-            {
-                List<string> names = _name.ToObject<List<string>>();
-                foreach (string name in names)
-                {
-                    await doFixBlob(client,  _azureStorage, name, "school");
-                }
+            List<School> schools = new List<School>();
+            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<School>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey("Base") })) {
+                schools.Add(item);
+            }
+            foreach (var school in schools) {
+                await doFixBlob(client, _azureStorage, school.id, "school");
             }
         }
         private static async Task doFixBlob(CosmosClient client, AzureStorageFactory _azureStorage,string name,string scope) {
-            List<string> prefixs = new List<string>() { "audio", "doc", "image", "other", "res", "video", "thum" };
+            List<string> prefixs = new List<string>() { "audio", "doc", "image", "other", "res", "video"};
             var ContainerClient = _azureStorage.GetBlobContainerClient($"{name}");
             var tb = "Teacher";
             if (scope != "private")