IESHttpTrigger.cs 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. using Azure.Cosmos;
  2. using Azure.Storage.Blobs.Models;
  3. using Azure.Storage.Sas;
  4. using HTEXLib.COMM.Helpers;
  5. using HTEXLib.Models;
  6. using Microsoft.Azure.Cosmos.Table;
  7. using Microsoft.Azure.Functions.Worker;
  8. using Microsoft.Azure.Functions.Worker.Http;
  9. using OpenXmlPowerTools;
  10. using StackExchange.Redis;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Dynamic;
  14. using System.IO;
  15. using System.Linq;
  16. using System.Net;
  17. using System.Net.Http;
  18. using System.Net.Http.Json;
  19. using System.Reflection;
  20. using System.Security.Policy;
  21. using System.Text;
  22. using System.Text.Json;
  23. using System.Threading.Tasks;
  24. using System.Web;
  25. using TEAMModelOS.SDK;
  26. using TEAMModelOS.SDK.DI;
  27. using TEAMModelOS.SDK.Extension;
  28. using TEAMModelOS.SDK.Models;
  29. using TEAMModelOS.SDK.Models.Table;
  30. using static TEAMModelOS.SDK.Models.Teacher;
  31. namespace TEAMModelOS.FunctionV4.HttpTrigger
  32. {
  33. public class IESHttpTrigger
  34. {
  35. private readonly AzureCosmosFactory _azureCosmos;
  36. private readonly DingDing _dingDing;
  37. private readonly AzureStorageFactory _azureStorage;
  38. private readonly AzureRedisFactory _azureRedis;
  39. private readonly IHttpClientFactory _httpClient;
  40. public IESHttpTrigger(AzureCosmosFactory azureCosmos, DingDing dingDing, AzureStorageFactory azureStorage
  41. , AzureRedisFactory azureRedis, IHttpClientFactory httpClient)
  42. {
  43. _azureCosmos = azureCosmos;
  44. _dingDing = dingDing;
  45. _azureStorage = azureStorage;
  46. _azureRedis = azureRedis;
  47. _httpClient = httpClient;
  48. }
  49. /// <summary>
  50. /// </summary>
  51. /// <param name="req"></param>
  52. /// <param name="log"></param>
  53. /// <returns></returns>
  54. [Function("system-info-function")]
  55. public async Task<HttpResponseData> SystemInfo([HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)] HttpRequestData req)
  56. {
  57. var response = req.CreateResponse(HttpStatusCode.OK);
  58. Type attr = this.GetType();
  59. string currentDirectory = Path.GetDirectoryName(attr.Assembly.Location);
  60. Assembly assembly = Assembly.LoadFrom($"{currentDirectory}\\TEAMModelOS.FunctionV4.dll");
  61. var description = assembly.GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
  62. //var v1 = Assembly.GetEntryAssembly().GetName().Version;
  63. //var v2 = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
  64. // var description = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
  65. var version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
  66. long nowtime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
  67. //Console.WriteLine($"Assembly.GetEntryAssembly().GetName().Version: " +
  68. // $"{Assembly.GetEntryAssembly().GetName().Version}");5.2107.12.1
  69. //Console.WriteLine($"Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version:" +
  70. // $"{Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version}");5.2107.12.1
  71. //Console.WriteLine($"Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion:" +
  72. // $"{Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion}");5.2107.12
  73. await response.WriteAsJsonAsync(new { version, description, nowtime });
  74. return response;
  75. }
  76. /// <summary>
  77. /// 区级艺术评价变更,异步同步已开启数据同步的学校。
  78. /// </summary>
  79. /// <param name="req"></param>
  80. /// <param name="log"></param>
  81. /// <returns></returns>
  82. [Function("area-artsetting-change")]
  83. public async Task<HttpResponseData> AreaArtSettingChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req) {
  84. var response = req.CreateResponse(HttpStatusCode.OK);
  85. try {
  86. string data = await new StreamReader(req.Body).ReadToEndAsync();
  87. var json = JsonDocument.Parse(data).RootElement;
  88. json.TryGetProperty("areaId", out JsonElement _areaId);
  89. string schoolSQL = $"select value c from c where c.areaId='{_areaId}'";
  90. List<School> schools = new List<School>();
  91. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School)
  92. .GetItemQueryIterator<School>(queryText: schoolSQL, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Base") }))
  93. {
  94. schools.Add(item);
  95. }
  96. ArtSetting artSetting = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Normal).ReadItemAsync<ArtSetting>($"{_areaId}", new PartitionKey("ArtSetting"));
  97. foreach (var school in schools)
  98. {
  99. List<Period> periods = new List<Period>();
  100. var hastype_period = school.period.Where(p => !string.IsNullOrWhiteSpace(p.periodType));
  101. if (hastype_period.Any())
  102. {
  103. periods.AddRange(hastype_period);
  104. }
  105. var nottype_period = school.period.Where(p => string.IsNullOrWhiteSpace(p.periodType));
  106. if (nottype_period.Any())
  107. {
  108. foreach (var period in nottype_period)
  109. {
  110. if (period.name.Contains("小学"))
  111. {
  112. period.periodType= "primary";
  113. }
  114. if (period.name.Contains("初中"))
  115. {
  116. period.periodType = "junior";
  117. }
  118. if (period.name.Contains("高中"))
  119. {
  120. period.periodType = "senior";
  121. }
  122. if (string.IsNullOrWhiteSpace(period.periodType) && school.period.Count == 1)
  123. {
  124. if (school.name.Contains("小学"))
  125. {
  126. period.periodType = "primary";
  127. }
  128. if (school.name.Contains("初中"))
  129. {
  130. period.periodType = "junior";
  131. }
  132. if (school.name.Contains("高中"))
  133. {
  134. period.periodType = "senior";
  135. }
  136. }
  137. if (!string.IsNullOrWhiteSpace(period.periodType))
  138. {
  139. periods.Add(period);
  140. }
  141. }
  142. }
  143. foreach (var period in periods)
  144. {
  145. var dimension = artSetting.dimensions.FindAll(x => x.type.Intersect(new List<string> { period.periodType }).Any());
  146. var bindIds = period.subjects.Where(s => !string.IsNullOrWhiteSpace(s.bindId)).Select(x => x.bindId);
  147. //该学段未同步学科的。
  148. var unBindIds = dimension.Where(z => !string.IsNullOrWhiteSpace(z.subjectBind)).Select(x => x.subjectBind).ToHashSet().Except(bindIds);
  149. if (unBindIds.Any())
  150. {
  151. //尝试寻找同名学科且没有设置bindId的
  152. foreach (var unBindId in unBindIds)
  153. {
  154. var subjects = artSetting.dimensions.FindAll(d => !string.IsNullOrWhiteSpace(d.subjectBind) && !string.IsNullOrWhiteSpace(d.subject) && d.subjectBind.Equals(unBindId))?.Select(m => m.subject);
  155. if (subjects != null)
  156. {
  157. foreach (var subject in subjects)
  158. {
  159. //获取同名学科,且没绑定的
  160. var sub = period.subjects.FindAll(sub => sub.name.Contains(subject) && string.IsNullOrWhiteSpace(sub.bindId));
  161. if (sub.IsNotEmpty())
  162. {
  163. sub[0].bindId = unBindId;
  164. }
  165. else
  166. {
  167. period.subjects.Add(new Subject { id = Guid.NewGuid().ToString(), name = subject, bindId = unBindId, type = 1 });
  168. }
  169. break;
  170. }
  171. }
  172. }
  173. }
  174. var period_subjects = period.subjects.Where(s => !string.IsNullOrWhiteSpace(s.bindId));
  175. foreach (var subject in period_subjects)
  176. {
  177. var dim = dimension.Where(x => x.subjectBind.Equals(subject.bindId));
  178. if (dim.Any())
  179. {
  180. Knowledge old = null;
  181. string sql = $"select value(c) from c where c.periodId = '{period.id}'";
  182. string pk = $"Knowledge-{school.id}-{subject.id}";
  183. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").
  184. GetItemQueryIterator<Knowledge>(queryText: sql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(pk) }))
  185. {
  186. old = item;
  187. break;
  188. }
  189. //同步知识块。
  190. if (old != null)
  191. {
  192. bool change = false;
  193. //如果之前的是1 来源于区级,后面因区级删除,应该还原为0。
  194. var oldBlocks = old.blocks.Select(x => x.name).ToHashSet();
  195. var dimBlocks = dim.SelectMany(d => d.blocks);
  196. //增加的
  197. var addBlocks = dimBlocks.Except(oldBlocks);
  198. //减少的
  199. var cutBlocks = oldBlocks.Except(dimBlocks);
  200. foreach (var add in addBlocks)
  201. {
  202. old.blocks.Add(new Block { name = add, source = 1 });
  203. change = true;
  204. }
  205. //减少的还原为0
  206. if (cutBlocks.Any())
  207. {
  208. old.blocks.ForEach(ob => {
  209. if (cutBlocks.Contains(ob.name))
  210. {
  211. ob.source = 0;
  212. change = true;
  213. }
  214. });
  215. }
  216. if (change)
  217. {
  218. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync(old, old.id, new PartitionKey(old.code));
  219. }
  220. var count = new { pcount = old.points != null ? old.points.Count : 0, bcount = old.blocks != null ? old.blocks.Count : 0 };
  221. //处理知识点,知识块计数问题
  222. await _azureRedis.GetRedisClient(8).HashSetAsync($"Knowledge:Count:{old.owner}-{old.subjectId}", old.periodId, count.ToJsonString());
  223. }
  224. else
  225. {
  226. var blocks = dim.SelectMany(x => x.blocks).Select(bs => new Block { name = bs, source = -1 });
  227. if (blocks.Any())
  228. {
  229. var _new = new Knowledge
  230. {
  231. id = Guid.NewGuid().ToString(),
  232. pk = "Knowledge",
  233. code = pk,
  234. owner = school.id,
  235. periodId = period.id,
  236. subjectId = subject.id,
  237. blocks = blocks.ToList()
  238. };
  239. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).CreateItemAsync(_new, new PartitionKey(_new.code));
  240. var count = new { pcount = _new.points != null ? _new.points.Count : 0, bcount = _new.blocks != null ? _new.blocks.Count : 0 };
  241. //处理知识点,知识块计数问题
  242. await _azureRedis.GetRedisClient(8).HashSetAsync($"Knowledge:Count:{_new.owner}-{_new.subjectId}", _new.periodId, count.ToJsonString());
  243. }
  244. }
  245. }
  246. }
  247. }
  248. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync(school, school.id, new PartitionKey(school.code));
  249. }
  250. return response;
  251. } catch (Exception ex) {
  252. await _dingDing.SendBotMsg($"area-artsetting-change,{ex.Message}\n{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
  253. }
  254. return response;
  255. }
  256. /// <summary>
  257. /// 行政班,学生毕业状态变更。
  258. /// </summary>
  259. /// <param name="req"></param>
  260. /// <param name="log"></param>
  261. /// <returns></returns>
  262. [Function("graduate-change")]
  263. public async Task<HttpResponseData> GraduateChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req) {
  264. var response = req.CreateResponse(HttpStatusCode.OK);
  265. dynamic jsondata =new ExpandoObject() ;
  266. try {
  267. string data = await new StreamReader(req.Body).ReadToEndAsync();
  268. var json = JsonDocument.Parse(data).RootElement;
  269. jsondata = json;
  270. //await _dingDing.SendBotMsg( "毕业状态变更:"+json.ToJsonString(), GroupNames.成都开发測試群組);
  271. string schoolId = null;
  272. if (json.TryGetProperty("schoolId", out JsonElement _schoolId))
  273. {
  274. schoolId = $"{_schoolId}";
  275. }
  276. if (string.IsNullOrEmpty(schoolId))
  277. {
  278. return response;
  279. }
  280. //计算毕业的
  281. if (json.TryGetProperty("graduate_classes", out JsonElement _graduate_classes))
  282. {
  283. List<Class> graduate_classes = _graduate_classes.ToObject<List<Class>>();
  284. if (graduate_classes.IsNotEmpty())
  285. {
  286. var ids = graduate_classes.Where(x => !string.IsNullOrWhiteSpace(x.id)).Select(x => $"'{x.id}'");
  287. List<Student> students = new List<Student>();
  288. string sql = $"select value c from c where (c.graduate = 0 or IS_DEFINED(c.graduate) = false) and c.classId in ({string.Join(",", ids)})";
  289. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student)
  290. .GetItemQueryIterator<Student>(queryText: sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
  291. {
  292. item.graduate = 1;
  293. students.Add(item);
  294. }
  295. foreach (var item in students)
  296. {
  297. item.graduate = 1;
  298. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync<Student>(item, item.id, new PartitionKey($"Base-{schoolId}"));
  299. }
  300. foreach (var item in graduate_classes)
  301. {
  302. item.graduate = 1;
  303. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync<Class>(item, item.id, new PartitionKey($"Class-{schoolId}"));
  304. }
  305. }
  306. }
  307. //未毕业的
  308. if (json.TryGetProperty("cancel_graduate_classes", out JsonElement _cancel_graduate_classes))
  309. {
  310. List<Class> cancel_graduate_classes = _cancel_graduate_classes.ToObject<List<Class>>();
  311. if (cancel_graduate_classes.IsNotEmpty())
  312. {
  313. var ids = cancel_graduate_classes.Where(x => !string.IsNullOrWhiteSpace(x.id)).Select(x => $"'{x.id}'");
  314. List<Student> students = new List<Student>();
  315. string sql = $"select value c from c where c.graduate =1 and c.classId in ({string.Join(",", ids)})";
  316. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student)
  317. .GetItemQueryIterator<Student>(queryText: sql, requestOptions: new QueryRequestOptions { PartitionKey = new PartitionKey($"Base-{schoolId}") }))
  318. {
  319. item.graduate = 0;
  320. students.Add(item);
  321. }
  322. foreach (var item in students)
  323. {
  324. item.graduate = 0;
  325. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync<Student>(item, item.id, new PartitionKey($"Base-{schoolId}"));
  326. }
  327. foreach (var item in cancel_graduate_classes)
  328. {
  329. item.graduate = 0;
  330. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.School).ReplaceItemAsync<Class>(item, item.id, new PartitionKey($"Class-{schoolId}"));
  331. }
  332. }
  333. }
  334. } catch (Exception ex) {
  335. await _dingDing.SendBotMsg($"graduate-change,{ex.Message}\n{ex.StackTrace}\n{jsondata.ToJsonString()}",GroupNames.醍摩豆服務運維群組);
  336. }
  337. return response;
  338. }
  339. /// <summary>
  340. /// 数据推送接口
  341. /// </summary>
  342. /// <param name="req"></param>
  343. /// <param name="log"></param>
  344. /// <returns></returns>
  345. [Function("lesson-tag-change")]
  346. public async Task<HttpResponseData> LessonTagChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req) {
  347. var response = req.CreateResponse(HttpStatusCode.OK);
  348. string data = await new StreamReader(req.Body).ReadToEndAsync();
  349. var json = JsonDocument.Parse(data).RootElement;
  350. List<TagOldNew> old_new = null;
  351. string school = null;
  352. if (json.TryGetProperty("school", out JsonElement _school))
  353. {
  354. school = _school.GetString();
  355. }
  356. if (json.TryGetProperty("old_new", out JsonElement _old_new))
  357. {
  358. old_new = _old_new.ToObject<List<TagOldNew>>();
  359. }
  360. if (old_new.IsNotEmpty() && !string.IsNullOrWhiteSpace(school))
  361. {
  362. foreach (var on in old_new)
  363. {
  364. List<LessonRecord> lessonRecords = new List<LessonRecord>();
  365. string sql = $"select value(c) from c where array_contains(c.category,'{on._old}') ";
  366. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<LessonRecord>
  367. (queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"LessonRecord-{_school}") }))
  368. {
  369. lessonRecords.Add(item);
  370. }
  371. lessonRecords.ForEach(item =>
  372. {
  373. //修改标签
  374. if (!string.IsNullOrWhiteSpace(on._new))
  375. {
  376. for (int i = 0; i < item.category.Count; i++)
  377. {
  378. if (item.category[i].Equals(on._old))
  379. {
  380. item.category[i] = on._new;
  381. }
  382. }
  383. }
  384. else
  385. {
  386. //表示删除标签
  387. item.category.RemoveAll(x => x.Equals(on._old));
  388. }
  389. });
  390. foreach (var item in lessonRecords)
  391. {
  392. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(item, item.id, new PartitionKey(item.code));
  393. }
  394. }
  395. }
  396. await response.WriteAsJsonAsync(new { data = json });
  397. return response;
  398. }
  399. /// <summary>
  400. /// 数据推送接口
  401. /// </summary>
  402. /// <param name="req"></param>
  403. /// <param name="log"></param>
  404. /// <returns></returns>
  405. [Function("knowledge-change")]
  406. public async Task<HttpResponseData> KnowledgeChange([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req)
  407. {
  408. var response = req.CreateResponse(HttpStatusCode.OK);
  409. string data = await new StreamReader(req.Body).ReadToEndAsync();
  410. var json = JsonDocument.Parse(data).RootElement;
  411. List<TagOldNew> old_new = null;
  412. string school = null;
  413. if (json.TryGetProperty("school", out JsonElement _school))
  414. {
  415. school = _school.GetString();
  416. }
  417. if (json.TryGetProperty("old_new", out JsonElement _old_new))
  418. {
  419. old_new = _old_new.ToObject<List<TagOldNew>>();
  420. }
  421. if (old_new.IsNotEmpty() && !string.IsNullOrWhiteSpace(school))
  422. {
  423. foreach (var on in old_new)
  424. {
  425. List<ItemInfo> items = new List<ItemInfo>();
  426. string sql = $"select value(c) from c where array_contains(c.knowledge,'{on._old}') ";
  427. await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").GetItemQueryIterator<ItemInfo>
  428. (queryText: sql.ToString(), requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Item-{_school}") }))
  429. {
  430. items.Add(item);
  431. }
  432. items.ForEach(item =>
  433. {
  434. //修改知识点
  435. if (!string.IsNullOrEmpty(on._new))
  436. {
  437. for (int i = 0; i < item.knowledge.Count; i++)
  438. {
  439. if (item.knowledge[i].Equals(on._old))
  440. {
  441. item.knowledge[i] = on._new;
  442. }
  443. }
  444. }
  445. else
  446. {
  447. //表示删除知识点
  448. item.knowledge.RemoveAll(x => x.Equals(on._old));
  449. }
  450. });
  451. foreach (var item in items)
  452. {
  453. ItemBlob itemBlob = null;
  454. try
  455. {
  456. BlobDownloadInfo blobDownloadResult = await _azureStorage.GetBlobContainerClient($"{school}").GetBlobClient($"/item/{item.id}/{item.id}.json").DownloadAsync();
  457. if (blobDownloadResult != null)
  458. {
  459. var blob = JsonDocument.Parse(blobDownloadResult.Content);
  460. itemBlob = blob.RootElement.ToObject<ItemBlob>();
  461. itemBlob.exercise.knowledge = item.knowledge;
  462. await _azureStorage.GetBlobContainerClient($"{school}").UploadFileByContainer(itemBlob.ToJsonString(), "item", $"{item.id}/{item.id}.json", true);
  463. }
  464. }
  465. catch (Exception ex)
  466. {
  467. itemBlob = null;
  468. }
  469. await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync(item, item.id, new PartitionKey(item.code));
  470. }
  471. }
  472. }
  473. await response.WriteAsJsonAsync(new { data = json });
  474. return response;
  475. }
  476. /// <summary>
  477. /// 在线人数记录
  478. /// </summary>
  479. /// <param name="msg"></param>
  480. /// <returns></returns>
  481. [Function("online-record")]
  482. public async Task<HttpResponseData> OnlineRecord([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req)
  483. {
  484. var response = req.CreateResponse(HttpStatusCode.OK);
  485. string data = await new StreamReader(req.Body).ReadToEndAsync();
  486. var json = JsonDocument.Parse(data).RootElement;
  487. try
  488. {
  489. string school = null;
  490. string scope = null;
  491. string id = null;
  492. string ip = null;
  493. int expire = 1;
  494. if (json.TryGetProperty("school", out JsonElement _school))
  495. school = _school.GetString();
  496. if (json.TryGetProperty("scope", out JsonElement _scope))
  497. scope = _scope.GetString();
  498. if (json.TryGetProperty("id", out JsonElement _id))
  499. id = _id.GetString();
  500. if (json.TryGetProperty("ip", out JsonElement _ip))
  501. ip = _ip.GetString();
  502. if (json.TryGetProperty("expire", out JsonElement _expire))
  503. expire = _expire.GetInt32();
  504. var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
  505. var cosmosClient = _azureCosmos.GetCosmosClient();
  506. DateTimeOffset dateTime = DateTimeOffset.UtcNow;
  507. var dateHour = dateTime.ToString("yyyyMMddHH"); //获取当天的小时
  508. var dateDay = dateTime.ToString("yyyyMMdd"); //获取当天的日期
  509. var dateMonth = dateTime.ToString("yyyyMM");//获取当月的日期
  510. var currentHour = dateTime.Hour; //当前小时
  511. var currentDay = dateTime.Day; //当前天
  512. long Expire = dateTime.AddHours(expire).ToUnixTimeMilliseconds(); //token到期时间
  513. long now = dateTime.ToUnixTimeMilliseconds(); //当前时间戳
  514. DateTime hour = DateTime.UtcNow.AddHours(25); //25小时到期
  515. DateTime month = DateTime.UtcNow.AddDays(32); //一个月到期
  516. var delTbHour = dateTime.AddHours(-168).ToString("yyyyMMddHH"); //168小时前
  517. var delTbDay = dateTime.AddDays(-180).ToString("yyyyMMdd"); //180天前
  518. switch (scope)
  519. {
  520. case "teacher":
  521. try
  522. {
  523. Teacher teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemAsync<Teacher>(id, new PartitionKey("Base"));
  524. teacher.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
  525. await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
  526. }
  527. catch { }
  528. break;
  529. case "student":
  530. try
  531. {
  532. Student student = await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReadItemAsync<Student>(id, new PartitionKey($"Base-{school}"));
  533. student.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
  534. await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReplaceItemAsync<Student>(student, student.id, new PartitionKey($"Base-{school}"));
  535. }
  536. catch { }
  537. break;
  538. case "tmduser":
  539. try
  540. {
  541. TmdUser tmdUser = await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReadItemAsync<TmdUser>(id, new PartitionKey("Base"));
  542. tmdUser.loginInfos = new List<LoginInfo>() { new LoginInfo { expire = Expire, ip = ip, time = now } };
  543. await cosmosClient.GetContainer("TEAMModelOS", Constant.Student).ReplaceItemAsync<TmdUser>(tmdUser, tmdUser.id, new PartitionKey("Base"));
  544. }
  545. catch { }
  546. break;
  547. }
  548. //天
  549. SortedSetEntry[] dayCnt = null;
  550. //月
  551. SortedSetEntry[] monthCnt = null;
  552. try
  553. {
  554. await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Login:IES:{scope}:{dateDay}", $"{currentHour}", 1);//一天24小时 小时为单位
  555. await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Login:IES:{scope}:{dateMonth}", $"{currentDay}", 1); //一天的累计 天为单位
  556. var resDay = await _azureRedis.GetRedisClient(8).KeyTimeToLiveAsync($"Login:IES:{scope}:{dateDay}");
  557. if (resDay == null)
  558. await _azureRedis.GetRedisClient(8).KeyExpireAsync($"Login:IES:{scope}:{dateDay}", hour); //设置到期时间
  559. var rspMonth = await _azureRedis.GetRedisClient(8).KeyTimeToLiveAsync($"Login:IES:{scope}:{dateMonth}");
  560. if (rspMonth == null)
  561. await _azureRedis.GetRedisClient(8).KeyExpireAsync($"Login:IES:{scope}:{dateMonth}", month); //设置到期时间
  562. //保存当前小时统计
  563. dayCnt = _azureRedis.GetRedisClient(8).SortedSetRangeByScoreWithScores($"Login:IES:{scope}:{dateDay}");
  564. //保存当前的统计数据
  565. monthCnt = _azureRedis.GetRedisClient(8).SortedSetRangeByScoreWithScores($"Login:IES:{scope}:{dateMonth}");
  566. }
  567. catch { }
  568. if (dayCnt != null && dayCnt.Length > 0)
  569. {
  570. List<HourLogin> hourLogins = new();
  571. foreach (var dCnt in dayCnt)
  572. {
  573. if (((int)dCnt.Element) == currentHour)
  574. {
  575. var tphourLogins = await table.QueryWhereString<HourLogin>($"PartitionKey eq 'HourLogin' and RowKey eq '{dateHour}'");
  576. if (tphourLogins.Count > 0)
  577. {
  578. foreach (var hourLogin in tphourLogins)
  579. {
  580. if (scope.Equals("teacher"))
  581. hourLogin.Teacher = (int)dCnt.Score;
  582. else if (scope.Equals("student"))
  583. hourLogin.Student = (int)dCnt.Score;
  584. else
  585. hourLogin.TmdUser = (int)dCnt.Score;
  586. hourLogins.Add(hourLogin);
  587. }
  588. }
  589. else
  590. {
  591. HourLogin hourLogin = new() { PartitionKey = $"HourLogin", RowKey = dateHour, Hour = currentHour };
  592. if (scope.Equals("teacher"))
  593. {
  594. hourLogin.Teacher = 1;
  595. hourLogin.Student = 0;
  596. hourLogin.TmdUser = 0;
  597. }
  598. else if (scope.Equals("student"))
  599. {
  600. hourLogin.Teacher = 0;
  601. hourLogin.Student = 1;
  602. hourLogin.TmdUser = 0;
  603. }
  604. else
  605. {
  606. hourLogin.Teacher = 0;
  607. hourLogin.Student = 0;
  608. hourLogin.TmdUser = 1;
  609. }
  610. hourLogins.Add(hourLogin);
  611. }
  612. }
  613. }
  614. await table.SaveOrUpdateAll(hourLogins); //保存和更新保存当前小时登录次数
  615. }
  616. if (monthCnt != null && monthCnt.Length > 0)
  617. {
  618. List<DayLogin> dayLogins = new();
  619. foreach (var mCnt in monthCnt)
  620. {
  621. if (((int)mCnt.Element) == currentDay)
  622. {
  623. //保存当天的峰值
  624. var tbDays = await table.QueryWhereString<DayLogin>($"PartitionKey eq 'DayLogin' and RowKey eq '{dateDay}'");
  625. if (tbDays.Count > 0)
  626. {
  627. foreach (var dayLogin in tbDays)
  628. {
  629. if (scope.Equals("teacher"))
  630. dayLogin.Teacher = (int)mCnt.Score;
  631. else if (scope.Equals("student"))
  632. dayLogin.Student = (int)mCnt.Score;
  633. else
  634. dayLogin.TmdUser = (int)mCnt.Score;
  635. dayLogins.Add(dayLogin);
  636. }
  637. }
  638. else
  639. {
  640. //保存当月每天的峰值
  641. DayLogin dayLogin = new() { PartitionKey = $"DayLogin", RowKey = dateDay, Day = currentDay };
  642. if (scope.Equals("teacher"))
  643. {
  644. dayLogin.Teacher = 1;
  645. dayLogin.Student = 0;
  646. dayLogin.TmdUser = 0;
  647. }
  648. else if (scope.Equals("student"))
  649. {
  650. dayLogin.Teacher = 0;
  651. dayLogin.Student = 1;
  652. dayLogin.TmdUser = 0;
  653. }
  654. else
  655. {
  656. dayLogin.Teacher = 0;
  657. dayLogin.Student = 0;
  658. dayLogin.TmdUser = 1;
  659. }
  660. dayLogins.Add(dayLogin);
  661. }
  662. }
  663. }
  664. await table.SaveOrUpdateAll(dayLogins);// 保存当月每天在线数据
  665. }
  666. string tbHourSql = $"PartitionKey eq 'HourLogin' and RowKey le '{delTbHour}'";
  667. string tbDaySql = $"PartitionKey eq 'DayLogin' and RowKey le '{delTbDay}'";
  668. try
  669. {
  670. await table.DeleteStringWhere<HourLogin>(rowKey: tbHourSql); //删除168小时前的数据
  671. await table.DeleteStringWhere<DayLogin>(rowKey: tbDaySql); //删除180天前的数据
  672. }
  673. catch { }
  674. if (!string.IsNullOrWhiteSpace(school))
  675. {
  676. //天
  677. SortedSetEntry[] scDayCnt = null;
  678. //月
  679. SortedSetEntry[] scMonthCnt = null;
  680. try
  681. {
  682. await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Login:School:{school}:{scope}:{dateDay}", $"{currentHour}", 1);//当天当前小时在线人加1
  683. await _azureRedis.GetRedisClient(8).SortedSetIncrementAsync($"Login:School:{school}:{scope}:{dateMonth}", $"{currentDay}", 1); //当天的在线加1
  684. var reScDay = await _azureRedis.GetRedisClient(8).KeyTimeToLiveAsync($"Login:School:{school}:{scope}:{dateDay}");
  685. if (reScDay == null)
  686. await _azureRedis.GetRedisClient(8).KeyExpireAsync($"Login:School:{school}:{scope}:{dateDay}", hour); //设置到期时间
  687. var reScMonth = await _azureRedis.GetRedisClient(8).KeyTimeToLiveAsync($"Login:School:{school}:{scope}:{dateMonth}");
  688. if (reScMonth == null)
  689. await _azureRedis.GetRedisClient(8).KeyExpireAsync($"Login:School:{school}:{scope}:{dateMonth}", month); //设置到期时间
  690. //保存学校当天每小时的
  691. scDayCnt = _azureRedis.GetRedisClient(8).SortedSetRangeByScoreWithScores($"Login:School:{school}:{scope}:{dateDay}");
  692. //学校天峰值
  693. scMonthCnt = _azureRedis.GetRedisClient(8).SortedSetRangeByScoreWithScores($"Login:School:{school}:{scope}:{dateMonth}");
  694. }
  695. catch { }
  696. if (scDayCnt != null && scDayCnt.Length > 0)
  697. {
  698. List<HourLoginSchool> hourLoginSchools = new();
  699. foreach (var scDCnt in scDayCnt)
  700. {
  701. if (((int)scDCnt.Element) == currentHour)
  702. {
  703. var tmpHour = await table.QueryWhereString<HourLoginSchool>($"PartitionKey eq 'HourLogin-{school}' and RowKey eq '{dateHour}'");
  704. if (tmpHour.Count > 0)
  705. {
  706. foreach (var hLoginSc in tmpHour)
  707. {
  708. if (scope.Equals("teacher"))
  709. hLoginSc.Teacher = (int)scDCnt.Score;
  710. else if (scope.Equals("student"))
  711. hLoginSc.Student = (int)scDCnt.Score;
  712. else
  713. hLoginSc.TmdUser = (int)scDCnt.Score;
  714. hourLoginSchools.Add(hLoginSc);
  715. }
  716. }
  717. else
  718. {
  719. //学校小时峰值
  720. HourLoginSchool hourLoginSc = new() { PartitionKey = $"HourLogin-{school}", RowKey = dateHour, Hour = currentHour, School = school };
  721. if (scope.Equals("teacher"))
  722. {
  723. hourLoginSc.Teacher = 1;
  724. hourLoginSc.Student = 0;
  725. hourLoginSc.TmdUser = 0;
  726. }
  727. else if (scope.Equals("student"))
  728. {
  729. hourLoginSc.Teacher = 0;
  730. hourLoginSc.Student = 1;
  731. hourLoginSc.TmdUser = 0;
  732. }
  733. else
  734. {
  735. hourLoginSc.Teacher = 0;
  736. hourLoginSc.Student = 0;
  737. hourLoginSc.TmdUser = 1;
  738. }
  739. hourLoginSchools.Add(hourLoginSc);
  740. }
  741. }
  742. }
  743. await table.SaveOrUpdateAll(hourLoginSchools);
  744. }
  745. if (scMonthCnt != null && scMonthCnt.Length > 0)
  746. {
  747. List<DayLoginSchool> DayLoginSchools = new();
  748. foreach (var scMCnt in scMonthCnt)
  749. {
  750. if (((int)scMCnt.Element) == currentDay)
  751. {
  752. var tempDays = await table.QueryWhereString<DayLoginSchool>($"PartitionKey eq 'DayLogin-{school}' and RowKey eq '{dateDay}'");
  753. if (tempDays.Count > 0)
  754. {
  755. foreach (var dLoginSc in tempDays)
  756. {
  757. if (scope.Equals("teacher"))
  758. dLoginSc.Teacher = (int)scMCnt.Score;
  759. else if (scope.Equals("student"))
  760. dLoginSc.Student = (int)scMCnt.Score;
  761. else
  762. dLoginSc.TmdUser = (int)scMCnt.Score;
  763. DayLoginSchools.Add(dLoginSc);
  764. }
  765. }
  766. else
  767. {
  768. //学校天峰值
  769. DayLoginSchool dayLoginSc = new() { PartitionKey = $"DayLogin-{school}", RowKey = dateDay, Day = currentDay, School = school };
  770. if (scope.Equals("teacher"))
  771. {
  772. dayLoginSc.Teacher = 1;
  773. dayLoginSc.Student = 0;
  774. dayLoginSc.TmdUser = 0;
  775. }
  776. else if (scope.Equals("student"))
  777. {
  778. dayLoginSc.Teacher = 0;
  779. dayLoginSc.Student = 1;
  780. dayLoginSc.TmdUser = 0;
  781. }
  782. else
  783. {
  784. dayLoginSc.Teacher = 0;
  785. dayLoginSc.Student = 0;
  786. dayLoginSc.TmdUser = 1;
  787. }
  788. DayLoginSchools.Add(dayLoginSc);
  789. }
  790. }
  791. }
  792. await table.SaveOrUpdateAll(DayLoginSchools);//保存学校当月在线数据
  793. }
  794. string tbScHourSql = $"PartitionKey eq 'HourLogin-{school}' and RowKey le '{delTbHour}'";
  795. List<HourLogin> scHourLog = await table.QueryWhereString<HourLogin>(tbScHourSql);
  796. if (scHourLog.Count > 0)
  797. try
  798. {
  799. //await table.DeleteStringWhere<HourLogin>(tbScHourSql); //删除学校168小时前的数据
  800. await table.DeleteAll(scHourLog);
  801. }
  802. catch { }
  803. string tbScDaySql = $"PartitionKey eq 'DayLogin-{school}' and RowKey le '{delTbDay}'";
  804. List<DayLogin> scDayLog = await table.QueryWhereString<DayLogin>(tbScDaySql);
  805. if (scDayLog.Count > 0)
  806. try
  807. {
  808. //await table.DeleteStringWhere<DayLogin>(tbScDaySql); //删除学校180天前的数据
  809. await table.DeleteAll(scDayLog);
  810. }
  811. catch { }
  812. }
  813. await response.WriteAsJsonAsync(new { data = json });
  814. return response;
  815. }
  816. catch (Exception ex)
  817. {
  818. await _dingDing.SendBotMsg($"{Environment.GetEnvironmentVariable("Option:Location")}-online-record 人数记录异常{ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  819. await response.WriteAsJsonAsync(new { data = json });
  820. return response;
  821. }
  822. }
  823. /// <summary>
  824. /// 艺术评测报告生成
  825. /// </summary>
  826. /// <param name="msg"></param>
  827. /// <returns></returns>
  828. [Function("gen-art-pdf")]
  829. public async Task<HttpResponseData> GenArtPDF([HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequestData req) {
  830. var response = req.CreateResponse(HttpStatusCode.OK);
  831. try {
  832. string data = await new StreamReader(req.Body).ReadToEndAsync();
  833. var json = JsonDocument.Parse(data).RootElement;
  834. json.TryGetProperty("studentPdfs", out JsonElement _studentPdfs);
  835. json.TryGetProperty("artResults", out JsonElement _artResults);
  836. json.TryGetProperty("schoolCode", out JsonElement _schoolCode);
  837. List<ArtStudentPdf> studentPdfs = _studentPdfs.Deserialize<List<ArtStudentPdf>>();
  838. List<StudentArtResult> artResults = _artResults.Deserialize<List<StudentArtResult>>();
  839. List<Task<string>> uploads = new List<Task<string>>();
  840. studentPdfs.ForEach(x => {
  841. x.blob = $"art/{x.artId}/report/{x.studentId}.json";
  842. uploads.Add(_azureStorage.GetBlobContainerClient($"{_schoolCode}").UploadFileByContainer(x.ToJsonString(), "art", $"{x.artId}/report/{x.studentId}.json", true));
  843. });
  844. var uploadJsonUrls = await Task.WhenAll(uploads);
  845. var list = uploadJsonUrls.ToList();
  846. List<string> urls = new List<string>();
  847. (string uri, string sas) = _azureStorage.GetBlobContainerSAS($"{_schoolCode}", Azure.Storage.Sas.BlobContainerSasPermissions.Read);
  848. studentPdfs.ForEach(x => {
  849. string atrUrl = "https://teammodelos.blob.core.chinacloudapi.cn/0-public/art-report-template/report.html";
  850. var s = _azureStorage.GetBlobSAS($"{_schoolCode}", x.blob, BlobSasPermissions.Read);
  851. s = $"{HttpUtility.UrlEncode($"{s}", Encoding.UTF8)}";
  852. string url = $"{atrUrl}?url={s}&pdfpath={x.artId}/report/{x.studentId}";
  853. urls.Add(url);
  854. //var a = list.Find(l => l.Contains(x.studentId));
  855. //if (a != null) {
  856. // a = $"{HttpUtility.UrlEncode($"{a}?{sas}", Encoding.UTF8)}";
  857. // string url = $"{atrUrl}?url={a}&pdfpath={x.artId}/report/{x.studentId}";
  858. // urls.Add(url);
  859. //}
  860. });
  861. string env = "release";
  862. if (Environment.GetEnvironmentVariable("Option:Location").Contains("Test", StringComparison.CurrentCultureIgnoreCase) ||
  863. Environment.GetEnvironmentVariable("Option:Location").Contains("Dep", StringComparison.CurrentCultureIgnoreCase))
  864. {
  865. env = "develop";
  866. }
  867. int psize = 20;
  868. List<string> resUrls = new List<string>();
  869. if (urls.Count <= psize)
  870. {
  871. var screenshot = new ScreenshotDto
  872. {
  873. width = 1080,
  874. height = 1920,
  875. urls = urls,
  876. fileNameKey = "pdfpath",
  877. cnt = $"{_schoolCode}",
  878. root = "art",
  879. pagesize = 5,
  880. env = env
  881. };
  882. var st = screenshot.ToJsonString();
  883. await _dingDing.SendBotMsg($"艺术评测报告生成中:\n{st}", GroupNames.成都开发測試群組);
  884. var httpResponse = await _httpClient.CreateClient().PostAsJsonAsync("http://cdhabook.teammodel.cn:8805/screen/screenshot-pdf",
  885. screenshot
  886. );
  887. if (httpResponse.StatusCode == HttpStatusCode.OK)
  888. {
  889. JsonElement json_res = await httpResponse.Content.ReadFromJsonAsync<JsonElement>();
  890. resUrls = json_res.GetProperty("urls").Deserialize<List<string>>();
  891. await UpdatePdfBlob(artResults, resUrls);
  892. }
  893. }
  894. else {
  895. int pages = (urls.Count + psize) / psize;
  896. for (int i = 0; i < pages; i++) {
  897. var lists = urls.Skip((i) * psize).Take(psize).ToList();
  898. var screenshot = new ScreenshotDto
  899. {
  900. width = 1080,
  901. height = 1920,
  902. urls = lists,
  903. fileNameKey = "pdfpath",
  904. cnt = $"{_schoolCode}",
  905. root = "art",
  906. pagesize = 5,
  907. env = env
  908. };
  909. var st = screenshot.ToJsonString();
  910. // await _dingDing.SendBotMsg($"艺术评测报告生成中:\n{st}", GroupNames.成都开发測試群組);
  911. var httpResponse = await _httpClient.CreateClient().PostAsJsonAsync("http://cdhabook.teammodel.cn:8805/screen/screenshot-pdf",
  912. screenshot
  913. );
  914. if (httpResponse.StatusCode == HttpStatusCode.OK)
  915. {
  916. JsonElement json_res = await httpResponse.Content.ReadFromJsonAsync<JsonElement>();
  917. resUrls = json_res.GetProperty("urls").Deserialize<List<string>>();
  918. await UpdatePdfBlob(artResults, resUrls);
  919. }
  920. }
  921. }
  922. await response.WriteAsJsonAsync(new { data = new { count = studentPdfs.Count, resUrls } });
  923. } catch (Exception ex) {
  924. await _dingDing.SendBotMsg($"{ex.Message}{ex.StackTrace}", GroupNames.成都开发測試群組);
  925. }
  926. return response;
  927. }
  928. //https://teammodeltest.blob.core.chinacloudapi.cn/hbcn/art/e864a924-e644-42dc-87c4-e970e6185065/report/202201001.pdf
  929. private async Task UpdatePdfBlob(List<StudentArtResult> studentArts ,List<string> urls)
  930. {
  931. List<Task<ItemResponse<StudentArtResult>>> artResults =new List<Task<ItemResponse<StudentArtResult>>>();
  932. urls.ForEach(z => {
  933. var res = studentArts.FindAll(x => z.Contains(x.artId) && z.Contains($"{x.studentId}"));
  934. if (res.Any()) {
  935. if (string.IsNullOrWhiteSpace(res[0].blob)) {
  936. res[0].blob = $"art/{res[0].artId}/report/{res[0].studentId}.pdf";
  937. artResults.Add(_azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Student).ReplaceItemAsync(res[0], res[0].id, new PartitionKey(res[0].code)));
  938. }
  939. }
  940. });
  941. if (artResults.Any())
  942. {
  943. await Task.WhenAll(artResults);
  944. }
  945. }
  946. public class ScreenshotDto
  947. {
  948. public int width { get; set; } = 1920;
  949. public int height { get; set; } = 1080;
  950. public string? url { get; set; }
  951. /// <summary>
  952. /// 批量地址
  953. /// </summary>
  954. public List<string> urls { get; set; } = new List<string>();
  955. /// <summary>
  956. /// 提取参数的唯一id作为文件名
  957. /// </summary>
  958. public string? fileNameKey { get; set; }
  959. /// <summary>
  960. /// 存在哪个容器里
  961. /// </summary>
  962. public string? cnt { get; set; }
  963. public int delay { get; set; }
  964. public int pagesize { get; set; } = 5;
  965. public string? root { get; set; }
  966. public string? env { get; set; } = "release";
  967. public string? msgId { get; set; }
  968. }
  969. }
  970. }