AzureStorageBlobExtensions.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. using System.Threading.Tasks;
  2. using Azure.Storage;
  3. using Azure.Storage.Blobs;
  4. using Azure.Storage.Blobs.Models;
  5. using System;
  6. using System.IO;
  7. using Azure.Storage.Blobs.Specialized;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using Azure.Core;
  12. using Azure;
  13. using TEAMModelOS.SDK;
  14. using TEAMModelOS.SDK.Extension;
  15. using System.Text.Encodings.Web;
  16. using TEAMModelOS.SDK.Models.Table;
  17. using Microsoft.AspNetCore.Http;
  18. using TEAMModelOS.Models;
  19. using Microsoft.Table;
  20. using static TEAMModelOS.SDK.CoreAPIHttpService;
  21. namespace TEAMModelOS.SDK.DI
  22. {
  23. public static class AzureStorageBlobExtensions
  24. {
  25. /// <summary>
  26. /// 取得指定前置詞的 Blob 名稱的總大小(Bytes),例如指定目錄名稱為前置詞
  27. /// </summary>
  28. /// <param name="prefix">篩選開頭名稱,Null代表容器總大小</param>
  29. /// <returns>總大小(Bytes),如果為Null代表查無前置詞或者發生錯誤</returns>
  30. public static async Task<long?> GetBlobsSize(this BlobContainerClient client, string prefix = null)
  31. {
  32. long? size = 0;
  33. try
  34. {
  35. await foreach (BlobItem item in client.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix))
  36. {
  37. if (item.Name.StartsWith("res/", StringComparison.OrdinalIgnoreCase) && item.Name.EndsWith(".htex", StringComparison.OrdinalIgnoreCase))
  38. { continue; }
  39. if (!prefix.Equals(item.Name))
  40. {
  41. //避免操作(1111) /1111/1111.json /1111111/11111.json
  42. if (!prefix.EndsWith("/"))
  43. {
  44. if (item.Name.StartsWith(prefix + "/"))
  45. {
  46. size += item.Properties.ContentLength;
  47. }
  48. }
  49. }
  50. else
  51. {
  52. size += item.Properties.ContentLength;
  53. }
  54. };
  55. return size;
  56. }
  57. catch
  58. {
  59. return size;
  60. }
  61. }
  62. public static async Task<List<string>> List(this BlobContainerClient client, string prefix = null) {
  63. try
  64. {
  65. List<string> items = new List<string>();
  66. await foreach (BlobItem item in client.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix)) {
  67. items.Add(item.Name);
  68. }
  69. return items;
  70. }
  71. catch
  72. {
  73. return null;
  74. }
  75. }
  76. /// <summary>
  77. /// 取得指定前置詞的 Blob 名稱的總大小(Bytes),例如指定目錄名稱為前置詞
  78. /// </summary>
  79. /// <param name="prefix">篩選開頭名稱,Null代表容器總大小</param>
  80. /// <returns>總大小(Bytes),如果為Null代表查無前置詞或者發生錯誤</returns>
  81. public static async Task<(long?, Dictionary<string, double?>)> GetBlobsCatalogSize(this BlobContainerClient client, string prefix = null)
  82. {
  83. long? size = 0;
  84. Dictionary<string, double?> dict = new Dictionary<string, double?>();
  85. try
  86. {
  87. List<KeyValuePair<string, double?>> foderSize = new List<KeyValuePair<string, double?>>();
  88. await foreach (BlobItem item in client.GetBlobsAsync(BlobTraits.None, BlobStates.None, prefix))
  89. {
  90. var len = item.Properties.ContentLength;
  91. foderSize.Add(new KeyValuePair<string, double?>(item.Name.Split("/")[0], len));
  92. size += item.Properties.ContentLength;
  93. };
  94. foderSize.Select(x => new { x.Key, x.Value }).GroupBy(y=>y.Key).ToList().ForEach(g=> {
  95. var gpsize = g.Select(m => m.Value).Sum();
  96. dict[g.Key] = gpsize;
  97. });
  98. return (size, dict);
  99. }
  100. catch
  101. {
  102. return (size, dict);
  103. }
  104. }
  105. public class OptUrl
  106. {
  107. public string url { get; set; }
  108. public long size { get; set; }
  109. }
  110. /// <summary>
  111. /// 取得指定前置詞的 Blob 名稱的總大小(Bytes),例如指定目錄名稱為前置詞
  112. /// </summary>
  113. /// <param name="urls">多个文件的连接/param>
  114. /// <returns>總大小(Bytes),如果為Null代表查無前置詞或者發生錯誤</returns>
  115. public static async Task<List<OptUrl>> GetBlobsSize(this BlobContainerClient client, List<string> urls)
  116. {
  117. List<OptUrl> optUrls = new List<OptUrl>();
  118. try
  119. {
  120. if (urls != null) {
  121. foreach (var url in urls)
  122. {
  123. OptUrl optUrl = new OptUrl { url = url, size = 0 };
  124. var eurl = System.Web.HttpUtility.UrlDecode(url, Encoding.UTF8);
  125. var blob = client.GetBlobClient(eurl);
  126. if (blob.Exists())
  127. {
  128. var props = await blob.GetPropertiesAsync();
  129. var size = props.Value.ContentLength;
  130. optUrl.size = size;
  131. }
  132. optUrls.Add(optUrl);
  133. }
  134. }
  135. return optUrls;
  136. }
  137. catch
  138. {
  139. return optUrls;
  140. }
  141. }
  142. /// <summary>
  143. ///prefixs多个文件或文件夹路径删除
  144. ///prefixs 或者按前缀文件夹删除
  145. ///
  146. /// </summary>
  147. /// <param name="prefix">篩選開頭名稱,Null代表容器</param>
  148. public static async Task<bool> DeleteBlobs(this BlobServiceClient client,DingDing _dingDing, string blobContainerName, List<string> prefixs )
  149. {
  150. if (!prefixs.IsNotEmpty()) return false;
  151. try
  152. {
  153. BlobContainerClient bcc = client.GetBlobContainerClient(blobContainerName.ToLower());
  154. BlobBatchClient bbc = client.GetBlobBatchClient();
  155. List<Uri> blobs = new List<Uri>();
  156. List<Task<ResponseMessage<bool>>> list = new List<Task<Response<bool>>>();
  157. foreach (var prefix in prefixs) {
  158. string px = prefix;
  159. if (prefix.StartsWith("/")) {
  160. px= prefix.Substring(1);
  161. }
  162. //目录必须有两层以上,避免删除根目录所有的。
  163. var pxlen= px.Split("/");
  164. if (pxlen.Length >=2) {
  165. var items = bcc.GetBlobsAsync(BlobTraits.None, BlobStates.None, px);
  166. await foreach (var item in items)
  167. {
  168. var urib = new UriBuilder(bcc.Uri);
  169. if (!prefix.Equals(item.Name))
  170. {
  171. //避免操作(1111) /1111/1111.json /1111111/11111.json
  172. if (!prefix.EndsWith("/"))
  173. {
  174. if (item.Name.StartsWith(prefix + "/"))
  175. {
  176. string path = $"{urib.Uri.AbsoluteUri}/{item.Name}";
  177. list.Add(bcc.GetBlobClient(item.Name).DeleteIfExistsAsync());
  178. if (item.Name.StartsWith("res/") && item.Name.EndsWith("/index.json"))
  179. {
  180. list.Add(bcc.GetBlobClient($"{prefix}.htex").DeleteIfExistsAsync());
  181. list.Add(bcc.GetBlobClient($"{prefix}.HTEX").DeleteIfExistsAsync());
  182. }
  183. blobs.Add(new Uri(path));
  184. }
  185. }
  186. }
  187. else
  188. {
  189. string path = $"{urib.Uri.AbsoluteUri}/{item.Name}";
  190. list.Add(bcc.GetBlobClient(item.Name).DeleteIfExistsAsync());
  191. blobs.Add(new Uri(path));
  192. }
  193. };
  194. }
  195. }
  196. if (list.Count > 0) {
  197. if (list.Count <= 256)
  198. {
  199. await Task.WhenAll(list);
  200. }
  201. else
  202. {
  203. int pages = (list.Count + 255) / 256; //256是批量操作最大值,pages = (total + max -1) / max;
  204. for (int i = 0; i < pages; i++)
  205. {
  206. List<Task<ResponseMessage<bool>>> lists = list.Skip((i) * 256).Take(256).ToList();
  207. await Task.WhenAll(lists);
  208. }
  209. }
  210. }
  211. return true;
  212. /*
  213. if (blobs.Count <= 256)
  214. {
  215. if (blobs.Count > 0) {
  216. try {
  217. ResponseMessage[] ass = await bbc.DeleteBlobsAsync(blobs);
  218. }
  219. catch (AggregateException ex)
  220. {
  221. //删除多个时会,如果其中一个文件不存在 或者其中一个删除失败会引发该异常
  222. return true;
  223. }
  224. catch (RequestFailedException ex)
  225. {
  226. await _dingDing.SendBotMsg($"/{ex.Message}\n{ex.StackTrace}", GroupNames.醍摩豆服務運維群組);
  227. return true;
  228. }
  229. catch (Exception ex)
  230. {
  231. return true;
  232. }
  233. }
  234. return true;
  235. }
  236. else
  237. {
  238. int pages = (blobs.Count + 255) / 256; //256是批量操作最大值,pages = (total + max -1) / max;
  239. for (int i = 0; i < pages; i++)
  240. {
  241. List<Uri> lists = blobs.Skip((i) * 256).Take(256).ToList();
  242. try { ResponseMessage[] ass = await bbc.DeleteBlobsAsync(lists); }
  243. catch (AggregateException ex)
  244. {
  245. //删除多个时会,如果其中一个文件不存在 或者其中一个删除失败会引发该异常
  246. return true;
  247. }
  248. catch (RequestFailedException ex)
  249. {
  250. return true;
  251. }
  252. catch (Exception ex)
  253. {
  254. return true;
  255. }
  256. }
  257. return true;
  258. }
  259. */
  260. }
  261. catch(Exception ex )
  262. {
  263. await _dingDing.SendBotMsg($"文件删除异常{ex.Message}\n{ex.StackTrace}{prefixs.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
  264. return false;
  265. }
  266. }
  267. /// <summary>
  268. /// 保存操作记录
  269. /// </summary>
  270. /// <param name="azureStorage"></param>
  271. /// <param name="type"></param>
  272. /// <param name="msg"></param>
  273. /// <param name="dingDing"></param>
  274. /// <param name="scope"></param>
  275. /// <param name="bizId"></param>
  276. /// <param name="option"></param>
  277. /// <param name="httpContext"></param>
  278. /// <returns></returns>
  279. public static async Task SaveLog(this AzureStorageFactory azureStorage, string type, string msg,DingDing dingDing, string scope = null, string bizId = null, Option option = null, HttpContext httpContext = null)
  280. {
  281. var table = azureStorage.GetCloudTableClient().GetTableReference("IESOptLog");
  282. OptLog log = new() { RowKey = Guid.NewGuid().ToString() };
  283. try
  284. {
  285. object id = null, school = null, name = null, website = null ;
  286. httpContext?.Items.TryGetValue("ID", out id);
  287. httpContext?.Items.TryGetValue("School", out school);
  288. httpContext?.Items.TryGetValue("Name", out name);
  289. httpContext?.Items.TryGetValue("Website", out website);
  290. log.tmdId = id != null ? $"{id}" : log.tmdId;
  291. log.name = name != null ? $"{name}" : log.name;
  292. string host = httpContext?.Request?.Host.Value;
  293. log.school = school != null ? $"{school}" : log.school;
  294. log.PartitionKey = type != null ? $"Log-{type}" : "Log-Default";
  295. log.RowKey = bizId != null ? bizId : log.RowKey;
  296. log.platform = website!=null? $"{website}" : "Default";
  297. log.msg = msg;
  298. log.type = type;
  299. log.scope = scope;
  300. host = !string.IsNullOrWhiteSpace($"{host}") ? $"{host}" : option?.Location != null ? $"{host}" : "Default";
  301. log.url =$"{host}{httpContext?.Request.Path}" ;
  302. if (!string.IsNullOrWhiteSpace(msg) && msg.Length > 256)
  303. {
  304. log.saveMod = 1;
  305. log.jsonfile = $"/0-public/optlog/{log.RowKey}-{log.PartitionKey}.json";
  306. await azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(log.ToJsonString(), "optlog", $"{log.RowKey}-{log.PartitionKey}.json");
  307. log.msg = null;
  308. await table.SaveOrUpdate<OptLog>(log);
  309. }
  310. else {
  311. await table.SaveOrUpdate<OptLog>(log);
  312. }
  313. }
  314. catch (Exception ex)
  315. {
  316. _ = dingDing.SendBotMsg($"日志保存失败:{ex.Message}\n{ex.StackTrace},,{log.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
  317. }
  318. }
  319. /// <summary>
  320. /// 保存日志文件
  321. /// </summary>
  322. /// <param name="azureStorage"></param>
  323. /// <param name="type"></param>
  324. /// <param name="rootPath"></param>
  325. /// <param name="replaceData"></param>
  326. /// <param name="dingDing"></param>
  327. /// <param name="scope"></param>
  328. /// <param name="bizId"></param>
  329. /// <param name="option"></param>
  330. /// <param name="httpContext"></param>
  331. /// <returns></returns>
  332. public static async Task SaveLogLang(this AzureStorageFactory azureStorage, string type,string rootPath, Dictionary<string, object> replaceData, DingDing dingDing, string scope = null, string bizId = null, Option option = null, HttpContext httpContext = null)
  333. {
  334. string msg = FileWay.FileValue(rootPath, "zh-cn", type, replaceData);
  335. var table = azureStorage.GetCloudTableClient().GetTableReference("IESOptLog");
  336. OptLog log = new() { RowKey = Guid.NewGuid().ToString() };
  337. try
  338. {
  339. object id = null, school = null, name = null, website = null;
  340. httpContext?.Items.TryGetValue("ID", out id);
  341. httpContext?.Items.TryGetValue("School", out school);
  342. httpContext?.Items.TryGetValue("Name", out name);
  343. httpContext?.Items.TryGetValue("Website", out website);
  344. log.tmdId = id != null ? $"{id}" : log.tmdId;
  345. log.name = name != null ? $"{name}" : log.name;
  346. string host = httpContext?.Request?.Host.Value;
  347. log.school = school != null ? $"{school}" : log.school;
  348. log.PartitionKey = type != null ? $"Log-{type}" : "Log-Default";
  349. log.RowKey = bizId != null ? bizId : log.RowKey;
  350. log.platform = website != null ? $"{website}" : "Default";
  351. log.msg = msg;
  352. log.tmsg = FileWay.FileValue(rootPath, "zh-tw", type, replaceData);
  353. log.emsg = FileWay.FileValue(rootPath, "en-us", type, replaceData);
  354. log.type = type;
  355. log.scope = scope;
  356. host = !string.IsNullOrWhiteSpace($"{host}") ? $"{host}" : option?.Location != null ? $"{host}" : "Default";
  357. log.url = $"{host}{httpContext?.Request.Path}";
  358. if (!string.IsNullOrWhiteSpace(msg) && msg.Length > 256)
  359. {
  360. log.saveMod = 1;
  361. log.jsonfile = $"/0-public/optlog/{log.RowKey}-{log.PartitionKey}.json";
  362. await azureStorage.GetBlobContainerClient("0-public").UploadFileByContainer(log.ToJsonString(), "optlog", $"{log.RowKey}-{log.PartitionKey}.json");
  363. log.msg = null;
  364. await table.SaveOrUpdate<OptLog>(log);
  365. }
  366. else
  367. {
  368. await table.SaveOrUpdate<OptLog>(log);
  369. }
  370. }
  371. catch (Exception ex)
  372. {
  373. _ = dingDing.SendBotMsg($"日志保存失败:{ex.Message}\n{ex.StackTrace},,{log.ToJsonString()}", GroupNames.醍摩豆服務運維群組);
  374. }
  375. }
  376. /// <summary>
  377. /// 系统管理员 资源,题目关联,htex关联,学习活动学生上传文件关联,基本信息关联,教室平面图关联,评测冷数据关联
  378. /// "system": [ "res", "item", "htex", "task", "info", "room", "exam" ],
  379. /// 资源,题目关联,htex关联,学习活动学生上传文件关联,基本信息关联,教室平面图关联,评测冷数据关联
  380. /// "school": [ "res", "item", "htex", "task", "info", "room", "exam" ],
  381. /// 资源,题目关联,htex关联,学习活动关联,教师基本信息关联
  382. /// "teacher": [ "res", "item", "htex", "task", "info" ],
  383. /// 答案及学习活动上传的文件,学生基本信息关联
  384. ///"student": [ "stu/{studentId}/ans", "stu/{studentId}/task" ]
  385. /// </summary>
  386. /// <param name="name">容器名称</param>
  387. /// <param name="json">文件内容的流</param>
  388. /// <param name="folder">业务文件夹</param>
  389. /// <param name="fileName">文件名</param>
  390. /// <param name="contentTypeDefault">是否存放文件后缀对应的contentType</param>
  391. /// <returns></returns>
  392. public static async Task<string> UploadFileByContainer(this BlobContainerClient blobContainer, string json, string root, string blobpath, bool contentTypeDefault = true)
  393. {
  394. // string groupName =folder;
  395. //BlobContainerClient blobContainer = azureStorage.GetBlobContainerClient(name.ToLower().Replace("#", "")); //blobClient.GetContainerReference(groupName);
  396. var blockBlob = blobContainer.GetBlobClient($"{root}/{blobpath}");
  397. string content_type = "application/octet-stream";
  398. if (!contentTypeDefault)
  399. {
  400. string fileext = blobpath.Substring(blobpath.LastIndexOf(".") > 0 ? blobpath.LastIndexOf(".") : 0);
  401. ContentTypeDict.dict.TryGetValue(fileext, out string contenttype);
  402. if (!string.IsNullOrEmpty(contenttype))
  403. {
  404. content_type = contenttype;
  405. }
  406. }
  407. byte[] bytes = System.Text.Encoding.Default.GetBytes(json);
  408. Stream streamBlob = new MemoryStream(bytes);
  409. await blockBlob.UploadAsync(streamBlob, true);
  410. blockBlob.SetHttpHeaders(new BlobHttpHeaders { ContentType = content_type });
  411. return blockBlob.Uri.ToString();
  412. }
  413. /// <summary>
  414. /// 系统管理员 资源,题目关联,htex关联,学习活动学生上传文件关联,基本信息关联,教室平面图关联,评测冷数据关联
  415. /// "system": [ "res", "item", "htex", "task", "info", "room", "exam" ],
  416. /// 资源,题目关联,htex关联,学习活动学生上传文件关联,基本信息关联,教室平面图关联,评测冷数据关联
  417. /// "school": [ "res", "item", "htex", "task", "info", "room", "exam" ],
  418. /// 资源,题目关联,htex关联,学习活动关联,教师基本信息关联
  419. /// "teacher": [ "res", "item", "htex", "task", "info" ],
  420. /// 答案及学习活动上传的文件,学生基本信息关联
  421. ///"student": [ "stu/{studentId}/ans", "stu/{studentId}/task" ]
  422. /// </summary>
  423. /// <param name="name">容器名称</param>
  424. /// <param name="stream">文件内容的流</param>
  425. /// <param name="folder">业务文件夹</param>
  426. /// <param name="fileName">文件名</param>
  427. /// <param name="contentTypeDefault">是否存放文件后缀对应的contentType</param>
  428. /// <returns></returns>
  429. public static async Task<string> UploadFileByContainer(this BlobContainerClient blobContainer, Stream stream, string root, string blobpath, bool contentTypeDefault = true)
  430. {
  431. //BlobContainerClient blobContainer = azureStorage.GetBlobContainerClient(name.ToLower().Replace("#", "")); //blobClient.GetContainerReference(groupName);
  432. Uri url = blobContainer.Uri;
  433. var blockBlob = blobContainer.GetBlobClient($"{root}/{blobpath}");
  434. string content_type = "application/octet-stream";
  435. if (!contentTypeDefault)
  436. {
  437. string fileext = blobpath.Substring(blobpath.LastIndexOf(".") > 0 ? blobpath.LastIndexOf(".") : 0);
  438. ContentTypeDict.dict.TryGetValue(fileext, out string contenttype);
  439. if (!string.IsNullOrEmpty(contenttype))
  440. {
  441. content_type = contenttype;
  442. }
  443. }
  444. await blockBlob.UploadAsync(stream, true);
  445. blockBlob.SetHttpHeaders(new BlobHttpHeaders { ContentType = content_type });
  446. return blockBlob.Uri.ToString();
  447. }
  448. /// <summary>
  449. /// BI保存操作记录
  450. /// </summary>
  451. /// <param name="azureStorage"></param>
  452. /// <param name="type"></param>
  453. /// <param name="msg"></param>
  454. /// <param name="dingDing"></param>
  455. /// <param name="scope"></param>
  456. /// <param name="option"></param>
  457. /// <param name="httpContext"></param>
  458. /// <returns></returns>
  459. public static async Task SaveBILog(BlobContainerClient blobContainer, CloudTableClient tableClient, string type, string msg, DingDing dingDing, string tid = null, string tname = null, string twebsite = null, string scope = null, Option option = null, HttpContext httpContext = null)
  460. {
  461. var table = tableClient.GetTableReference("BIOptLog");
  462. BIOptLog biLog = new() { RowKey = Guid.NewGuid().ToString() };
  463. try
  464. {
  465. object id = null, name = null, ddid = null, ddname = null, website = null;
  466. httpContext?.Items.TryGetValue("ID", out id);
  467. httpContext?.Items.TryGetValue("Name", out name);
  468. httpContext?.Items.TryGetValue("DDId", out ddid);
  469. httpContext?.Items.TryGetValue("DDName", out ddname);
  470. httpContext?.Items.TryGetValue("Website", out website);
  471. string site = twebsite != null ? twebsite : $"{website}";
  472. biLog.tmdId = id != null ? $"{id}" : tid;
  473. biLog.name = name != null ? $"{name}" : tname;
  474. biLog.PartitionKey = type != null ? $"{site}-Log-{type}" : $"{site}-Log-Default";
  475. biLog.platform = site != null ? site : "Default";
  476. biLog.msg = msg;
  477. biLog.type = type;
  478. biLog.scope = scope;
  479. string host = httpContext?.Request?.Host.Value;
  480. host = !string.IsNullOrWhiteSpace($"{host}") ? $"{host}" : option?.Location != null ? $"{host}" : "Default";
  481. biLog.url = $"{host}{httpContext?.Request.Path}";
  482. if (!string.IsNullOrWhiteSpace(msg) && msg.Length > 255)
  483. {
  484. biLog.saveMod = 1;
  485. biLog.jsonfile = $"/0-public/BIOptLog/{biLog.PartitionKey}-{biLog.RowKey}.json";
  486. await UploadFileByContainer(blobContainer, biLog.ToJsonString(), "BIOptLog", $"{biLog.PartitionKey}-{biLog.RowKey}.json");
  487. biLog.msg = null;
  488. await table.SaveOrUpdate<BIOptLog>(biLog);
  489. }
  490. else await table.SaveOrUpdate<BIOptLog>(biLog);
  491. }
  492. catch (Exception ex)
  493. {
  494. _ = dingDing.SendBotMsg($"BI日志保存失败:{ex.Message}\n{ex.StackTrace},,{biLog.ToJsonString()}", GroupNames.成都开发測試群組);
  495. }
  496. }
  497. }
  498. }