ActivityHttpTrigger.cs 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. using System;
  2. using System.IO;
  3. using System.Threading.Tasks;
  4. using Microsoft.AspNetCore.Mvc;
  5. using Microsoft.Azure.WebJobs;
  6. using Microsoft.Azure.WebJobs.Extensions.Http;
  7. using Microsoft.AspNetCore.Http;
  8. using Microsoft.Extensions.Logging;
  9. using TEAMModelOS.SDK.DI;
  10. using Azure.Cosmos;
  11. using System.Text.Json;
  12. using System.Collections.Generic;
  13. using TEAMModelOS.SDK.Models;
  14. using TEAMModelOS.SDK.Extension;
  15. using TEAMModelOS.SDK;
  16. using TEAMModelOS.SDK.Models.Cosmos;
  17. using TEAMModelOS.SDK.Models.Cosmos.Common;
  18. using System.Linq;
  19. using TEAMModelOS.Services.Common;
  20. using TEAMModelOS.SDK.Models.Service;
  21. namespace TEAMModelFunction
  22. {
  23. public class ActivityHttpTrigger
  24. {
  25. private readonly AzureCosmosFactory _azureCosmos;
  26. private readonly DingDing _dingDing;
  27. private readonly AzureStorageFactory _azureStorage;
  28. private readonly AzureRedisFactory _azureRedis;
  29. public ActivityHttpTrigger(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage
  30. , AzureRedisFactory azureRedis)
  31. {
  32. _azureCosmos = azureCosmos;
  33. _dingDing = dingDing;
  34. _azureStorage = azureStorage;
  35. _azureRedis = azureRedis;
  36. }
  37. /// <summary>
  38. /// 修复已存在的课程且未初始化学生课程列表的业务。
  39. /// </summary>
  40. /// <param name="req"></param>
  41. /// <param name="log"></param>
  42. /// <returns></returns>
  43. [FunctionName("fix-stu-course")]
  44. public async Task<IActionResult> StuCourse([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log)
  45. {
  46. log.LogInformation("fix-stu-course...");
  47. string originCode = await new StreamReader(req.Body).ReadToEndAsync();
  48. List<Course> courses = new List<Course>();
  49. var client = _azureCosmos.GetCosmosClient();
  50. var query = $"select * from c ";
  51. await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<Course>(queryText: query,
  52. requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{originCode}") }))
  53. {
  54. courses.Add(item);
  55. }
  56. await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Course>(queryText: query,
  57. requestOptions: new QueryRequestOptions() { PartitionKey = new Azure.Cosmos.PartitionKey($"Course-{originCode}") }))
  58. {
  59. courses.Add(item);
  60. }
  61. //2.获取课程的id 并尝试添加或移除对应的学生课程记录StuCourse。
  62. foreach (var course in courses)
  63. {
  64. if (course.schedule.IsNotEmpty())
  65. {
  66. foreach (var sc in course.schedule)
  67. {
  68. if (!string.IsNullOrEmpty(sc.stulist))
  69. {
  70. (List<TmdInfo> tmdids, List<StuInfo> students, List<ClassListInfo> classLists) = await TriggerStuActivity.GetStuList(client, _dingDing, new List<string>() { sc.stulist }, course.school);
  71. foreach (var addStu in students)
  72. {
  73. var stuCourse = new StuCourse
  74. {
  75. id = course.id,
  76. scode = course.code,
  77. name = course.name,
  78. code = $"StuCourse-{course.school}-{addStu.id}",
  79. scope = course.scope,
  80. school = course.school,
  81. creatorId = course.creatorId,
  82. pk = "StuCourse"
  83. };
  84. await client.GetContainer("TEAMModelOS", "Student").UpsertItemAsync(stuCourse, new PartitionKey(stuCourse.code));
  85. }
  86. foreach (var addTmd in tmdids)
  87. {
  88. var tmdCourse = new StuCourse
  89. {
  90. id = course.id,
  91. scode = course.code,
  92. name = course.name,
  93. code = $"StuCourse-{addTmd}",
  94. scope = course.scope,
  95. //school = courseChange.school,
  96. creatorId = course.creatorId,
  97. pk = "StuCourse"
  98. };
  99. await client.GetContainer("TEAMModelOS", "Teacher").UpsertItemAsync(tmdCourse, new PartitionKey(tmdCourse.code));
  100. }
  101. }
  102. }
  103. }
  104. }
  105. return new OkObjectResult(new { });
  106. }
  107. /// <summary>
  108. /// 设置评测未初始化学生列表的
  109. /// </summary>
  110. /// <param name="req"></param>
  111. /// <param name="log"></param>
  112. /// <returns></returns>
  113. [FunctionName("fix-exam-activity")]
  114. public async Task<IActionResult> ExamActivity([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req,ILogger log)
  115. {
  116. log.LogInformation("fix-exam-activity...");
  117. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  118. List<string> datas = JsonSerializer.Deserialize<List<string>>(requestBody);
  119. var client = _azureCosmos.GetCosmosClient();
  120. var query = $"select * from c ";
  121. foreach (string data in datas) {
  122. List<ExamInfo> exams = new List<ExamInfo>();
  123. await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
  124. queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{data}") }))
  125. {
  126. using var json = await JsonDocument.ParseAsync(item.ContentStream);
  127. if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
  128. {
  129. foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
  130. {
  131. exams.Add(obj.ToObject<ExamInfo>());
  132. }
  133. }
  134. }
  135. log.LogInformation($"{exams.ToJsonString()}");
  136. foreach (var info in exams)
  137. {
  138. List<string> classes = ExamService.getClasses(info.classes,info.stuLists);
  139. if (!classes.IsNotEmpty())
  140. {
  141. continue;
  142. }
  143. List<string> sub = new List<string>();
  144. foreach (ExamSubject subject in info.subjects)
  145. {
  146. sub.Add(subject.id);
  147. }
  148. (List<TmdInfo> tmdids, List<StuInfo> studentss, List<ClassListInfo> classLists) = await TriggerStuActivity.GetStuList(client, _dingDing, classes, info.school);
  149. List<StuActivity> stuActivities = new List<StuActivity>();
  150. List<StuActivity> tmdActivities = new List<StuActivity>();
  151. if (tmdids.IsNotEmpty())
  152. {
  153. tmdids.ForEach(x => {
  154. tmdActivities.Add(new StuActivity
  155. {
  156. pk = "Activity",
  157. id = info.id,
  158. code = $"Activity-{x.id}",
  159. type = "exam",
  160. name = info.name,
  161. startTime = info.startTime,
  162. endTime = info.endTime,
  163. scode = info.code,
  164. scope = info.scope,
  165. school = info.school,
  166. creatorId = info.creatorId,
  167. subjects = sub,
  168. blob = null,
  169. owner = info.owner
  170. });
  171. });
  172. }
  173. if (studentss.IsNotEmpty())
  174. {
  175. studentss.ForEach(x => {
  176. stuActivities.Add(new StuActivity
  177. {
  178. pk = "Activity",
  179. id = info.id,
  180. code = $"Activity-{info.school}-{x.id}",
  181. type = "exam",
  182. name = info.name,
  183. startTime = info.startTime,
  184. endTime = info.endTime,
  185. scode = info.code,
  186. scope = info.scope,
  187. school = info.school,
  188. creatorId = info.creatorId,
  189. subjects = sub,
  190. blob=null,
  191. owner = info.owner
  192. });
  193. });
  194. }
  195. await TriggerStuActivity.SaveStuActivity(client, _dingDing, stuActivities, tmdActivities);
  196. }
  197. }
  198. return new OkObjectResult(new { });
  199. }
  200. /// <summary>
  201. /// 设置投票未初始化学生列表的业务
  202. /// </summary>
  203. /// <param name="req"></param>
  204. /// <param name="log"></param>
  205. /// <returns></returns>
  206. [FunctionName("fix-vote-activity")]
  207. public async Task<IActionResult> VoteActivity(
  208. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  209. ILogger log)
  210. {
  211. log.LogInformation("fix-vote-activity...");
  212. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  213. List<string> datas = JsonSerializer.Deserialize<List<string>>(requestBody);
  214. var client = _azureCosmos.GetCosmosClient();
  215. var query = $"select * from c ";
  216. foreach (string data in datas)
  217. {
  218. List<Vote> votes = new List<Vote>();
  219. await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
  220. queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Vote-{data}") }))
  221. {
  222. using var json = await JsonDocument.ParseAsync(item.ContentStream);
  223. if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
  224. {
  225. foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
  226. {
  227. votes.Add(obj.ToObject<Vote>());
  228. }
  229. }
  230. }
  231. log.LogInformation($"{votes.ToJsonString()}");
  232. foreach (var info in votes)
  233. {
  234. List<string> classes = ExamService.getClasses(info.classes, info.stuLists);
  235. if (classes.IsNotEmpty())
  236. {
  237. continue;
  238. }
  239. (List<TmdInfo> tmdids, List<StuInfo> studentss, List<ClassListInfo> classLists) = await TriggerStuActivity.GetStuList(client, _dingDing, classes, info.school);
  240. List<StuActivity> stuActivities = new List<StuActivity>();
  241. List<StuActivity> tmdActivities = new List<StuActivity>();
  242. if (tmdids.IsNotEmpty())
  243. {
  244. tmdids.ForEach(x => {
  245. tmdActivities.Add(new StuActivity
  246. {
  247. pk = "Activity",
  248. id = info.id,
  249. code = $"Activity-{x.id}",
  250. type = "vote",
  251. name = info.name,
  252. startTime = info.startTime,
  253. endTime = info.endTime,
  254. scode = info.code,
  255. scope = info.scope,
  256. school = info.school,
  257. creatorId = info.creatorId,
  258. subjects = new List<string>() { "" },
  259. blob = null,
  260. owner = info.owner
  261. });
  262. });
  263. }
  264. if (studentss.IsNotEmpty())
  265. {
  266. studentss.ForEach(x => {
  267. stuActivities.Add(new StuActivity
  268. {
  269. pk = "Activity",
  270. id = info.id,
  271. code = $"Activity-{info.school}-{x.id}",
  272. type = "vote",
  273. name = info.name,
  274. startTime = info.startTime,
  275. endTime = info.endTime,
  276. scode = info.code,
  277. scope = info.scope,
  278. school = info.school,
  279. creatorId = info.creatorId,
  280. subjects = new List<string>() { "" },
  281. blob = null,
  282. owner = info.owner
  283. });
  284. });
  285. }
  286. await TriggerStuActivity.SaveStuActivity(client, _dingDing, stuActivities, tmdActivities);
  287. }
  288. }
  289. return new OkObjectResult(new { });
  290. }
  291. /// <summary>
  292. /// 设置问卷调查未初始化学生列表的业务
  293. /// </summary>
  294. /// <param name="req"></param>
  295. /// <param name="log"></param>
  296. /// <returns></returns>
  297. [FunctionName("fix-survey-activity")]
  298. public async Task<IActionResult> SurveyActivity(
  299. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  300. ILogger log)
  301. {
  302. log.LogInformation("fix-survey-activity...");
  303. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  304. List<string> datas = JsonSerializer.Deserialize<List<string>>(requestBody);
  305. var client = _azureCosmos.GetCosmosClient();
  306. var query = $"select * from c ";
  307. foreach (string data in datas)
  308. {
  309. List<Survey> surveys = new List<Survey>();
  310. await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
  311. queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Survey-{data}") }))
  312. {
  313. using var json = await JsonDocument.ParseAsync(item.ContentStream);
  314. if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
  315. {
  316. foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
  317. {
  318. surveys.Add(obj.ToObject<Survey>());
  319. }
  320. }
  321. }
  322. log.LogInformation($"{surveys.ToJsonString()}");
  323. foreach (var info in surveys)
  324. {
  325. List<string> classes = ExamService.getClasses(info.classes, info.stuLists);
  326. if (!classes.IsNotEmpty())
  327. {
  328. continue;
  329. }
  330. (List<TmdInfo> tmdids, List<StuInfo> studentss, List<ClassListInfo> classLists) = await TriggerStuActivity.GetStuList(client, _dingDing, classes, info.school);
  331. List<StuActivity> stuActivities = new List<StuActivity>();
  332. List<StuActivity> tmdActivities = new List<StuActivity>();
  333. if (tmdids.IsNotEmpty())
  334. {
  335. tmdids.ForEach(x => {
  336. tmdActivities.Add(new StuActivity
  337. {
  338. pk = "Activity",
  339. id = info.id,
  340. code = $"Activity-{x.id}",
  341. type = "survey",
  342. name = info.name,
  343. startTime = info.startTime,
  344. endTime = info.endTime,
  345. scode = info.code,
  346. scope = info.scope,
  347. school = info.school,
  348. creatorId = info.creatorId,
  349. subjects = new List<string>() { "" },
  350. blob = info.blob,
  351. owner=info.owner
  352. });
  353. });
  354. }
  355. if (studentss.IsNotEmpty())
  356. {
  357. studentss.ForEach(x => {
  358. stuActivities.Add(new StuActivity
  359. {
  360. pk = "Activity",
  361. id = info.id,
  362. code = $"Activity-{info.school}-{x.id}",
  363. type = "survey",
  364. name = info.name,
  365. startTime = info.startTime,
  366. endTime = info.endTime,
  367. scode = info.code,
  368. scope = info.scope,
  369. school = info.school,
  370. creatorId = info.creatorId,
  371. subjects = new List<string>() { "" },
  372. blob=info.blob,
  373. owner = info.owner
  374. });
  375. });
  376. }
  377. await TriggerStuActivity.SaveStuActivity(client, _dingDing, stuActivities, tmdActivities);
  378. }
  379. }
  380. return new OkObjectResult(new { });
  381. }
  382. /// <summary>
  383. //获取题目摘要信息
  384. /// </summary>
  385. /// <param name="request"></param>
  386. /// <returns></returns>
  387. [ProducesDefaultResponseType]
  388. //[AuthToken(Roles = "teacher")]
  389. [FunctionName("fix-itemcond")]
  390. public async Task<IActionResult> FixItemCond(
  391. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  392. ILogger log)
  393. {
  394. try {
  395. var client = _azureCosmos.GetCosmosClient();
  396. List<ItemInfo> items = new List<ItemInfo>();
  397. var queryslt = $"SELECT value(c) FROM c where c.pid = null ";
  398. await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<ItemInfo>(queryText: queryslt, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-hbcn") }))
  399. {
  400. items.Add(item);
  401. }
  402. List<ItemCond> itemConds = new List<ItemCond>();
  403. items.GroupBy(x => x.periodId).Select(y=>new {key= y.Key,list=y.ToList() }).ToList().ForEach(z => {
  404. ItemCond cond = new ItemCond() { id = z.key, code = $"ItemCond-hbcn", pk = "ItemCond", ttl = -1, count = 0, grades = new List<GradeCount>(), subjects = new List<SubjectCount>() };
  405. z.list.ForEach(y => {
  406. ItemService.CountItemCond(y, null, cond);
  407. });
  408. itemConds.Add(cond);
  409. });
  410. itemConds.ForEach(async cond =>
  411. {
  412. await client.GetContainer("TEAMModelOS", "School").UpsertItemAsync<ItemCond>(cond, new PartitionKey(cond.code));
  413. });
  414. return new OkObjectResult(new { itemConds });
  415. } catch (Exception ex) { await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,fix-itemcond()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組); }
  416. return new OkObjectResult(new { });
  417. }
  418. /// <summary>
  419. /// 设置问卷调查未初始化学生列表的业务
  420. /// </summary>
  421. /// <param name="req"></param>
  422. /// <param name="log"></param>
  423. /// <returns></returns>
  424. [FunctionName("refresh-stu-activity")]
  425. public async Task<IActionResult> RefreshStuActivity(
  426. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  427. ILogger log)
  428. {
  429. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  430. dynamic json = JsonSerializer.Deserialize<dynamic>(requestBody);
  431. string id = json.id;
  432. string code = json.code;
  433. if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(code)) {
  434. return new BadRequestResult();
  435. }
  436. var client = _azureCosmos.GetCosmosClient();
  437. await TriggerStuActivity.RefreshStuActivity(client, _dingDing, id, code);
  438. return new OkObjectResult(new {code=200 });
  439. }
  440. /// <summary>
  441. ///获取单个目录的大小,用于获取评测,试题,试卷,问卷,投票等 文件层级超过两层的文件。
  442. ///例如 /exam/uuid/xxx /item/uuid/xxx /paper/uuid/xxx /vote/uuid/xxx /suervy/uuid/xxx
  443. /// {"name":"hbcn","/item/uuid/xxx"}
  444. /// </summary>
  445. /// <param name="req"></param>
  446. /// <param name="log"></param>
  447. /// <returns></returns>
  448. [FunctionName("get-prefixsize")]
  449. public async Task<IActionResult> GetPrefixsize(
  450. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  451. ILogger log)
  452. {
  453. try {
  454. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  455. var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
  456. if (data.TryGetProperty("name", out JsonElement name) && data.TryGetProperty("root", out JsonElement root))
  457. {
  458. var size = await _azureStorage.GetBlobContainerClient($"{name}").GetBlobsSize($"{root}");
  459. return new OkObjectResult(new { size = size });
  460. }
  461. else
  462. {
  463. return new BadRequestResult();
  464. }
  465. } catch (Exception ex) {
  466. await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,get-prefixsize()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
  467. return new BadRequestResult();
  468. }
  469. }
  470. /// <summary>
  471. ///获取多个blob路径的文件大小
  472. /// {"name":"hbcn","blobs":["/paper/uuid/xxx.json","/paper/uuid/aaa.json"]}
  473. /// </summary>
  474. /// <param name="req"></param>
  475. /// <param name="log"></param>
  476. /// <returns></returns>
  477. [FunctionName("get-blobsize")]
  478. public async Task<IActionResult> GetBlobsize(
  479. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  480. ILogger log)
  481. {
  482. try {
  483. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  484. var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
  485. if (data.TryGetProperty("name", out JsonElement name) && data.TryGetProperty("blobs", out JsonElement blob))
  486. {
  487. List<string> blobs = JsonSerializer.Deserialize<List<string>>(blob.ToJsonString());
  488. var size= await _azureStorage.GetBlobContainerClient($"{name}").GetBlobsSize(blobs);
  489. return new OkObjectResult(new { size = size });
  490. }
  491. else {
  492. return new BadRequestResult();
  493. }
  494. } catch (Exception ex)
  495. {
  496. await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,get-blobsize()\n{ex.Message}", GroupNames.醍摩豆服務運維群組);
  497. return new BadRequestResult();
  498. }
  499. }
  500. /// <summary>
  501. /// 修复容器的内容显示
  502. /// </summary>
  503. /// <param name="req"></param>
  504. /// <param name="log"></param>
  505. /// <returns></returns>
  506. [FunctionName("fix-blob-content")]
  507. public async Task<IActionResult> FixBlobContent(
  508. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  509. ILogger log)
  510. {
  511. try
  512. {
  513. var client = _azureCosmos.GetCosmosClient();
  514. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  515. var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
  516. await FixDataService.FixBlobContent(client, _dingDing, _azureStorage, data);
  517. return new OkObjectResult(new { });
  518. }
  519. catch (Exception ex)
  520. {
  521. await _dingDing.SendBotMsg($"TEAMModelFunction,ActivityHttpTrigger,fix-blob-content()\n{ex.Message}{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
  522. return new BadRequestResult();
  523. }
  524. }
  525. /// <summary>
  526. /// 修复容器的内容显示
  527. /// </summary>
  528. /// <param name="req"></param>
  529. /// <param name="log"></param>
  530. /// <returns></returns>
  531. [FunctionName("fix-student-info")]
  532. public async Task<IActionResult> FixStudentInfo(
  533. [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
  534. ILogger log)
  535. {
  536. var client = _azureCosmos.GetCosmosClient();
  537. string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
  538. var data = System.Text.Json.JsonSerializer.Deserialize<JsonElement>(requestBody);
  539. await FixDataService.FixStudentInfo(client, _dingDing, _azureStorage, data);
  540. return new OkObjectResult(new { });
  541. }
  542. }
  543. }