ActivityHttpTrigger.cs 27 KB

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