|
@@ -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")
|