|
@@ -31,6 +31,12 @@ using TEAMModelOS.Models;
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
using TEAMModelOS.SDK.Services;
|
|
using TEAMModelOS.SDK.Services;
|
|
using Azure.Messaging.ServiceBus;
|
|
using Azure.Messaging.ServiceBus;
|
|
|
|
+using TEAMModelOS.SDK.Models.Cosmos.BI;
|
|
|
|
+using static ICSharpCode.SharpZipLib.Zip.ZipEntryFactory;
|
|
|
|
+using Azure.Storage.Sas;
|
|
|
|
+using DocumentFormat.OpenXml.Drawing.Diagrams;
|
|
|
|
+using TEAMModelOS.SDK.Models.Dtos;
|
|
|
|
+using DocumentFormat.OpenXml.Bibliography;
|
|
|
|
|
|
namespace TEAMModelOS.Controllers
|
|
namespace TEAMModelOS.Controllers
|
|
{
|
|
{
|
|
@@ -2966,5 +2972,380 @@ namespace TEAMModelOS.Controllers
|
|
return BadRequest(ex.StackTrace);
|
|
return BadRequest(ex.StackTrace);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 修复研修平台账号重复的问题
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="jsonElement"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ [HttpPost("fix-training")]
|
|
|
|
+ public async Task<IActionResult> RepairTraining(JsonElement jsonElement)
|
|
|
|
+ {
|
|
|
|
+ if (!jsonElement.TryGetProperty("ids", out JsonElement ids)) return BadRequest();
|
|
|
|
+ List<TrainingId> trainingIds = ids.ToObject<List<TrainingId>>();
|
|
|
|
+
|
|
|
|
+ var table = _azureStorage.GetCloudTableClient().GetTableReference("ScYxpt");
|
|
|
|
+ var cosmosClient = _azureCosmos.GetCosmosClient();
|
|
|
|
+
|
|
|
|
+ foreach (var item in trainingIds)
|
|
|
|
+ {
|
|
|
|
+ List<ScTeacher> scTeachers = await table.FindListByDict<ScTeacher>(new Dictionary<string, object>() { { "PartitionKey", "ScTeacher" }, { "tmdid", $"{item.oldId}" } });
|
|
|
|
+ if (scTeachers.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ scTeachers.ForEach(sct => sct.tmdid = item.newId);
|
|
|
|
+ ////保存和更新研修信息 最后统一解除注释
|
|
|
|
+ //await table.SaveOrUpdateAll(scTeachers);
|
|
|
|
+ }
|
|
|
|
+ string defaultSc = null;
|
|
|
|
+
|
|
|
|
+ //教师基础信息
|
|
|
|
+ Teacher teacher = new();
|
|
|
|
+ var resTchBase = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{item.oldId}", new PartitionKey("Base"));
|
|
|
|
+ if (resTchBase.Status == 200)
|
|
|
|
+ {
|
|
|
|
+ using var json = await JsonDocument.ParseAsync(resTchBase.ContentStream);
|
|
|
|
+ teacher = json.ToObject<Teacher>();
|
|
|
|
+ defaultSc = teacher.defaultSchool;
|
|
|
|
+ if (string.IsNullOrEmpty(teacher.defaultSchool))
|
|
|
|
+ defaultSc = teacher.schools[0].schoolId;
|
|
|
|
+
|
|
|
|
+ teacher.id = $"{item.newId}";
|
|
|
|
+ ////教师基础信息
|
|
|
|
+ //teacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey(teacher.code));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //教师研修文件
|
|
|
|
+ TeacherFile teacherFile = new();
|
|
|
|
+ var resTchFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{item.oldId}", new PartitionKey($"TeacherFile-{defaultSc}"));
|
|
|
|
+ if (resTchFile.Status == 200)
|
|
|
|
+ {
|
|
|
|
+ using var json = await JsonDocument.ParseAsync(resTchFile.ContentStream);
|
|
|
|
+ teacherFile = json.ToObject<TeacherFile>();
|
|
|
|
+ teacherFile.id = $"{item.newId}";
|
|
|
|
+ ////创建新的教师研修文件
|
|
|
|
+ //teacherFile = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<TeacherFile>(teacherFile, new PartitionKey(teacherFile.code));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //研修统计
|
|
|
|
+ TeacherTrain teacherTrain = new();
|
|
|
|
+ var resTchTrain = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{item.oldId}", new PartitionKey($"TeacherTrain-{defaultSc}"));
|
|
|
|
+ if (resTchTrain.Status == 200)
|
|
|
|
+ {
|
|
|
|
+ using var json = await JsonDocument.ParseAsync(resTchTrain.ContentStream);
|
|
|
|
+ teacherTrain = json.ToObject<TeacherTrain>();
|
|
|
|
+ teacherTrain.tmdid = $"{item.newId}";
|
|
|
|
+ teacherTrain.id = $"{item.newId}";
|
|
|
|
+ //研修报告路径
|
|
|
|
+ if (!string.IsNullOrEmpty($"{teacherTrain.offlineUrl}"))
|
|
|
|
+ {
|
|
|
|
+ teacherTrain.offlineUrl = teacherTrain.offlineUrl.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ /**
|
|
|
|
+ * 复制操作没写 写完逻辑后补充
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ await BatchCopyFileService.SingleCopyFile(_azureStorage, "teammodelos", teacherTrain.offlineUrl, item.oldId, item.newId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (teacherTrain.offlineRecords.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var off in teacherTrain.offlineRecords)
|
|
|
|
+ {
|
|
|
|
+ off.url = off.url.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ /**
|
|
|
|
+ * 复制操作没写 写完逻辑后补充
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ foreach (var offOther in off.other)
|
|
|
|
+ {
|
|
|
|
+ /**
|
|
|
|
+ * 复制操作没写 写完逻辑后补充
|
|
|
|
+ */
|
|
|
|
+ offOther.url = offOther.url.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ offOther.blob = offOther.blob.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //课堂实录
|
|
|
|
+ foreach (var tchClass in teacherTrain.teacherClasses)
|
|
|
|
+ {
|
|
|
|
+ /**
|
|
|
|
+ * 复制操作没写 写完逻辑后补充
|
|
|
|
+ */
|
|
|
|
+ tchClass.url = tchClass.url.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ teacherTrain.id = item.newId;
|
|
|
|
+ ////创建新的教师研修统计
|
|
|
|
+ //teacherTrain = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<TeacherTrain>(teacherTrain, new PartitionKey(teacherTrain.code));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ClassVideo classVideo = new();
|
|
|
|
+ var respCalsVideo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReadItemStreamAsync($"{item.oldId}", new PartitionKey($"ClassVideo-{defaultSc}"));
|
|
|
|
+ if (respCalsVideo.Status == 200)
|
|
|
|
+ {
|
|
|
|
+ using var json = await JsonDocument.ParseAsync(respCalsVideo.ContentStream);
|
|
|
|
+ classVideo = json.ToObject<ClassVideo>();
|
|
|
|
+ classVideo.creatorId = $"{item.newId}";
|
|
|
|
+ if (classVideo.files.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var cv in classVideo.files)
|
|
|
|
+ {
|
|
|
|
+ cv.url = cv.url.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ /**
|
|
|
|
+ * 复制操作没写 写完逻辑后补充
|
|
|
|
+ */
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ classVideo.id = $"{item.newId}";
|
|
|
|
+ ////创建新的教师课堂实录
|
|
|
|
+ //classVideo = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<ClassVideo>(classVideo, new PartitionKey(classVideo.code));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //订阅记录和学习记录
|
|
|
|
+ List<Task<ItemResponse<AbilitySub>>> abilitySubs =new();
|
|
|
|
+ await foreach (var abilitySub in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<AbilitySub>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"AbilitySub-{defaultSc}-{item.oldId}") }))
|
|
|
|
+ {
|
|
|
|
+ abilitySub.creatorId = item.newId;
|
|
|
|
+ if (abilitySub.uploads.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var asup in abilitySub.uploads)
|
|
|
|
+ {
|
|
|
|
+ if (asup.urls.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var asupurl in asup.urls)
|
|
|
|
+ {
|
|
|
|
+ asupurl.url = asupurl.url.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ /**
|
|
|
|
+ * 复制操作没写 写完逻辑后补充
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ abilitySub.code = abilitySub.code.Replace($"-{item.oldId}", $"-{item.oldId}");
|
|
|
|
+ abilitySubs.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<AbilitySub>(abilitySub, new PartitionKey($"AbilitySub-{defaultSc}-{item.newId}")));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (abilitySubs.Count < 256)
|
|
|
|
+ // await Task.WhenAll(abilitySubs);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (abilitySubs.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<AbilitySub>>> exAbilitySub = abilitySubs.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(exAbilitySub);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ //教师所在学校的基础信息
|
|
|
|
+ SchoolTeacher schoolTeacher = new();
|
|
|
|
+ var resScTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync($"{item.oldId}", new PartitionKey($"Teacher-{defaultSc}"));
|
|
|
|
+ if (resScTeacher.Status == 200)
|
|
|
|
+ {
|
|
|
|
+ using var json = await JsonDocument.ParseAsync(resScTeacher.ContentStream);
|
|
|
|
+ schoolTeacher = json.ToObject<SchoolTeacher>();
|
|
|
|
+ schoolTeacher.id = item.newId;
|
|
|
|
+
|
|
|
|
+ ////创建新的教师在学校的基础信息
|
|
|
|
+ //schoolTeacher = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<SchoolTeacher>(schoolTeacher, new PartitionKey(schoolTeacher.code));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //名单信息
|
|
|
|
+ List<Task<ItemResponse<GroupList>>> groupLists = new();
|
|
|
|
+ await foreach (var grups in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<GroupList>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"GroupList-{defaultSc}") }))
|
|
|
|
+ {
|
|
|
|
+ bool isReplace = false;
|
|
|
|
+ if (grups.members.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var griupm in grups.members)
|
|
|
|
+ {
|
|
|
|
+ if (griupm.id.Equals(item.oldId))
|
|
|
|
+ {
|
|
|
|
+ griupm.id = item.newId;
|
|
|
|
+ isReplace = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (grups.creatorId.Equals(item.oldId))
|
|
|
|
+ {
|
|
|
|
+ grups.creatorId = item.newId;
|
|
|
|
+ isReplace = true;
|
|
|
|
+ }
|
|
|
|
+ if (isReplace == true)
|
|
|
|
+ {
|
|
|
|
+ //groupLists.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "School").CreateItemAsync<GroupList>(grups, new PartitionKey(grups.code)));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (groupLists.Count < 256)
|
|
|
|
+ // await Task.WhenAll(groupLists);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (groupLists.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<GroupList>>> tempGroups = groupLists.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(tempGroups);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ //教研活动
|
|
|
|
+ List<Task<ItemResponse<Study>>> studys = new();
|
|
|
|
+ await foreach (var study in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<Study>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{defaultSc}") }))
|
|
|
|
+ {
|
|
|
|
+ if (study.teacIds.Contains(item.oldId) == true)
|
|
|
|
+ {
|
|
|
|
+ study.teacIds = study.teacIds.Select(x => x.Replace($"{item.oldId}", $"{item.oldId}")).ToList();
|
|
|
|
+ studys.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<Study>(study, study.id, new PartitionKey($"Study-{defaultSc}")));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (studys.Count < 256)
|
|
|
|
+ // await Task.WhenAll(studys);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (studys.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<Study>>> tempStudys = studys.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(tempStudys);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ //教研测验活动
|
|
|
|
+ List<Task<ItemResponse<ExamLite>>> examLites = new();
|
|
|
|
+ await foreach (var examl in cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<ExamLite>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamLite-{defaultSc}") }))
|
|
|
|
+ {
|
|
|
|
+ bool isReplace = false;
|
|
|
|
+ if (examl.teachers.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var examTch in examl.teachers)
|
|
|
|
+ {
|
|
|
|
+ if (examTch.id.Equals(item.oldId))
|
|
|
|
+ {
|
|
|
|
+ examTch.id = item.newId;
|
|
|
|
+ isReplace =true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (isReplace == true)
|
|
|
|
+ {
|
|
|
|
+ examLites.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Common").ReplaceItemAsync<ExamLite>(examl, examl.id, new PartitionKey($"ExamLite-{defaultSc}")));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (examLites.Count < 256)
|
|
|
|
+ // await Task.WhenAll(examLites);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (examLites.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<ExamLite>>> tempExam = examLites.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(tempExam);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ List<Task<ItemResponse<HomeworkRecord>>> homeworkRecord = new();
|
|
|
|
+ await foreach (var homerec in cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").GetItemQueryIterator<HomeworkRecord>(queryText: $"select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"HomeworkRecord-{item.oldId}") }))
|
|
|
|
+ {
|
|
|
|
+ bool isReplace = false;
|
|
|
|
+ if (homerec.content.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var hrCon in homerec.content)
|
|
|
|
+ {
|
|
|
|
+ if (hrCon.url.Contains($"/{item.oldId}/"))
|
|
|
|
+ {
|
|
|
|
+ hrCon.url = hrCon.url.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ hrCon.blob = hrCon.blob.Replace($"/{item.oldId}/", $"/{item.newId}/");
|
|
|
|
+ isReplace = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (isReplace == true)
|
|
|
|
+ {
|
|
|
|
+ homerec.code = homerec.code.Replace($"-{item.oldId}", $"-{item.oldId}");
|
|
|
|
+ homeworkRecord.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").ReplaceItemAsync<HomeworkRecord>(homerec, homerec.id, new PartitionKey()));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (homeworkRecord.Count < 256)
|
|
|
|
+ // await Task.WhenAll(homeworkRecord);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (homeworkRecord.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<HomeworkRecord>>> tempHomeR = homeworkRecord.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(tempHomeR);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ //视频点评
|
|
|
|
+ List<Task<ItemResponse<Appraise>>> appraises = new();
|
|
|
|
+ await foreach (var appra in cosmosClient.GetContainer(Constant.TEAMModelOS,"Teacher").GetItemQueryIterator<Appraise>(queryText:"select value(c) from c", requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey($"Appraise-{item.oldId}") }))
|
|
|
|
+ {
|
|
|
|
+ appra.code = appra.code.Replace($"-{item.oldId}", $"-{item.newId}");
|
|
|
|
+ appraises.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Appraise>(appra, new PartitionKey(appra.code)));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (appraises.Count < 256)
|
|
|
|
+ // await Task.WhenAll(appraises);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (appraises.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<Appraise>>> tempAppra = appraises.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(tempAppra);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+
|
|
|
|
+ List<Task<ItemResponse<Debate>>> debates = new();
|
|
|
|
+ await foreach (var debate in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<Debate>(queryText: "select value(c) from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Debate-{defaultSc}") }))
|
|
|
|
+ {
|
|
|
|
+ bool isReplace = false;
|
|
|
|
+ if (debate.replies.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ foreach (var deRep in debate.replies)
|
|
|
|
+ {
|
|
|
|
+ if (deRep.tmdid.Equals(item.oldId))
|
|
|
|
+ {
|
|
|
|
+ deRep.tmdid = item.newId;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (isReplace == true)
|
|
|
|
+ {
|
|
|
|
+ debates.Add(cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<Debate>(debate, debate.id, new PartitionKey(debate.code)));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //if (debates.Count < 256)
|
|
|
|
+ // await Task.WhenAll(debates);
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // int pages = (debates.Count + 255) / 256;
|
|
|
|
+ // for (int i = 0; i < pages; i++)
|
|
|
|
+ // {
|
|
|
|
+ // List<Task<ItemResponse<Debate>>> tempDebates = debates.Skip((i) * 256).Take(256).ToList();
|
|
|
|
+ // await Task.WhenAll(tempDebates);
|
|
|
|
+ // }
|
|
|
|
+ //}
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return Ok(new { state = 200 });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public record TrainingId
|
|
|
|
+ {
|
|
|
|
+ public string oldId { get; set; }
|
|
|
|
+
|
|
|
|
+ public string newId { get; set; }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|