TkController.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. using molilian.core;
  2. using dodohold.core;
  3. using Microsoft.AspNetCore.Mvc;
  4. using Org.BouncyCastle.Ocsp;
  5. using System.Text.Json;
  6. using System.Runtime.InteropServices;
  7. using System.Net;
  8. using System.Security.Cryptography;
  9. using Microsoft.AspNetCore.Authentication;
  10. using TencentCloud.Ecm.V20190719.Models;
  11. using COSXML.Network;
  12. using System.Linq;
  13. using static dodohold.core.ZTOExpress.CreateOrderArgs;
  14. using MySqlX.XDevAPI;
  15. using TencentCloud.Ame.V20190916.Models;
  16. using YunhuiKit;
  17. namespace molilian.api.Controllers
  18. {
  19. [ApiController]
  20. [Route("[controller]/[action]")]
  21. public class TkController : ControllerBase
  22. {
  23. protected IHttpContextAccessor _accessor;
  24. public TkController(IHttpContextAccessor accessor)
  25. {
  26. _accessor = accessor;
  27. }
  28. /// <summary>
  29. /// oppo调用
  30. /// </summary>
  31. /// <param name="s">正文</param>
  32. /// <param name="c">渠道。tb/jd</param>
  33. /// <param name="a">分配的客户端账号</param>
  34. /// <param name="t">11位时间戳</param>
  35. /// <param name="sign">签名</param>
  36. /// <param name="ip">客户的IP</param>
  37. /// <param name="oaid">客户的唯一ID</param>
  38. /// <returns></returns>
  39. [HttpPost]
  40. public async Task<ActionResult> unionParse([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  41. {
  42. //正文
  43. var content = form.Read("s", string.Empty);
  44. var channel = form.Read("c", string.Empty);
  45. var ip = form.Read("ip", string.Empty);
  46. var oaid = form.Read("oaid", string.Empty);
  47. var type = form.Read("type", string.Empty);
  48. var clickId = form.Read("clickId", string.Empty);
  49. var commerceType = form.Read<int>("commerceType", 0);
  50. var riskStrategy = form.Read("riskStrategy", string.Empty);
  51. var launchScene = form.Read<int>("launchScene", -1);
  52. var special_text = form.Read<int>("special_text", -1);
  53. var query_text = form.Read("query_text", string.Empty);
  54. //验证签名
  55. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  56. {
  57. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  58. }
  59. DateTime time1 = t.Convert2Datetime();
  60. if (time1 < DateTime.Now.AddMinutes(-10))
  61. {
  62. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  63. }
  64. var account = await ApiAccountCore.GetOneAsync(a);
  65. if (account == null)
  66. {
  67. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  68. }
  69. string app_sign = $"{account.api_secret}@{t}".MD5();
  70. if (sign != app_sign)
  71. {
  72. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  73. }
  74. var request = new UnionParseRequest
  75. {
  76. Content = content,
  77. Channel = channel,
  78. CommerceType = commerceType,
  79. Ip = ip,
  80. Oaid = oaid,
  81. RiskStrategy = riskStrategy,
  82. LaunchScene = launchScene,
  83. AccountId = 0,
  84. SpecialText = special_text,
  85. QueryText = query_text,
  86. ClickId = clickId,
  87. Type = type
  88. };
  89. return await UnionParseCore.UnionParseAsync(request);
  90. }
  91. [HttpPost]
  92. public async Task<ActionResult> unsafeParse([FromBody] JsonElement form)
  93. {
  94. var content = form.Read("s", string.Empty);
  95. var channel = form.Read("c", string.Empty);
  96. var ip = form.Read("ip", string.Empty);
  97. var oaid = form.Read("oaid", string.Empty);
  98. var clickId = form.Read("clickId", string.Empty);
  99. var type = form.Read("type", string.Empty);
  100. int accountid = form.Read("aid", 0);
  101. var commerceType = form.Read<int>("commerceType", 0);
  102. var riskStrategy = form.Read("riskStrategy", string.Empty);
  103. var launchScene = form.Read<int>("launchScene", -1);
  104. var special_text = form.Read<int>("special_text", -1);
  105. var query_text = form.Read("query_text", string.Empty);
  106. #if DEBUG
  107. //ip = "127.0.0.1";
  108. //oaid = "test-oaid";
  109. #endif
  110. var request = new UnionParseRequest
  111. {
  112. Content = content,
  113. Channel = channel,
  114. CommerceType = commerceType,
  115. Ip = ip,
  116. Oaid = oaid,
  117. RiskStrategy = riskStrategy,
  118. LaunchScene = launchScene,
  119. AccountId = accountid,
  120. SpecialText = special_text,
  121. QueryText = query_text,
  122. ClickId = clickId,
  123. Type = type
  124. };
  125. return await UnionParseCore.UnionParseAsync(request);
  126. }
  127. [HttpPost]
  128. public async Task<ActionResult> unsafeBatchParse([FromBody] JsonElement form)
  129. {
  130. var content = form.PathReadArray("s[]", string.Empty);
  131. var channel = form.Read("c", string.Empty);
  132. var ip = form.Read("ip", string.Empty);
  133. var oaid = form.Read("oaid", string.Empty);
  134. var clickId = form.Read("clickId", string.Empty);
  135. var type = form.Read("type", string.Empty);
  136. int accountid = form.Read("aid", 0);
  137. int count = form.Read("count", 0);
  138. var commerceType = form.Read<int>("commerceType", 0);
  139. //入参参数。brw-浏览器,qapp-快应用
  140. var riskStrategy = form.Read("riskStrategy", string.Empty);
  141. var launchScene = form.Read<int>("launchScene", -1);
  142. var special_text = form.Read<int>("special_text", -1);
  143. var query_text = form.Read("query_text", string.Empty);
  144. #if DEBUG
  145. //ip = "127.0.0.1";
  146. //oaid = "test-oaid";
  147. #endif
  148. for (int i = 0; i < count; i++)
  149. {
  150. var request = new UnionParseRequest
  151. {
  152. Content = content[i],
  153. Channel = channel,
  154. CommerceType = commerceType,
  155. Ip = ip,
  156. Oaid = oaid,
  157. RiskStrategy = riskStrategy,
  158. LaunchScene = launchScene,
  159. AccountId = accountid,
  160. SpecialText = special_text,
  161. QueryText = query_text,
  162. ClickId = clickId,
  163. Type = type
  164. };
  165. _ = await UnionParseCore.UnionParseAsync(request);
  166. }
  167. return new APIResult(new { msg = "ok" });
  168. }
  169. [HttpPost]
  170. public async Task<ActionResult> unionCoupon([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  171. {
  172. //正文
  173. var content = form.Read("s", string.Empty);
  174. var dplink = form.Read("dp", string.Empty);
  175. var channel = form.Read("c", string.Empty);
  176. var ip = form.Read("ip", string.Empty);
  177. var oaid = form.Read("oaid", string.Empty);
  178. var clickId = form.Read("clickId", string.Empty);
  179. var style = form.Read("style", string.Empty);
  180. //验证签名
  181. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  182. {
  183. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  184. }
  185. DateTime time1 = t.Convert2Datetime();
  186. if (time1 < DateTime.Now.AddMinutes(-10))
  187. {
  188. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  189. }
  190. var account = await ApiAccountCore.GetOneAsync(a);
  191. if (account == null)
  192. {
  193. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  194. }
  195. string app_sign = $"{account.api_secret}@{t}".MD5();
  196. if (sign != app_sign)
  197. {
  198. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  199. }
  200. return await UnionCouponCore.UnionCouponAsync(content, dplink, channel, style, ip, oaid, clickId);
  201. }
  202. [HttpPost]
  203. public async Task<ActionResult> unsafeCoupon([FromBody] JsonElement form)
  204. {
  205. var content = form.Read("s", string.Empty);
  206. var dplink = form.Read("dp", string.Empty);
  207. var channel = form.Read("c", string.Empty);
  208. var ip = form.Read("ip", string.Empty);
  209. var oaid = form.Read("oaid", string.Empty);
  210. var style = form.Read("style", string.Empty);
  211. var clickId = form.Read("clickId", string.Empty);
  212. #if DEBUG
  213. ip = "127.0.0.1";
  214. oaid = "test-oaid";
  215. #endif
  216. return await UnionCouponCore.UnionCouponAsync(content, dplink, channel, style, ip, oaid, clickId);
  217. }
  218. [HttpGet]
  219. public async Task<ActionResult> jd_parse(string s, string s2 = "", string ip = "", string oaid = "")
  220. {
  221. UnionParseRequest request = new()
  222. {
  223. Content = s,
  224. Ip = ip,
  225. Oaid = oaid
  226. };
  227. var result = JdUnionPlus.GetFormattedObject(request);
  228. string body = "";
  229. string content = s.UrlDecode();
  230. string content2 = s2.UrlDecode();
  231. try
  232. {
  233. if (AlimamaPlus.ShouldIgnoreRequest(ip, oaid, string.Empty, 0, out string reason))
  234. {
  235. result.success = false;
  236. result.message = "放弃转链";
  237. result.reason = reason;
  238. result.rawContent = content;
  239. result.rawContent2 = content2;
  240. _ = TkLogCore.LogAsync(result);
  241. return new APIResult(result);
  242. }
  243. var api = DataokeCore.GetOne();
  244. if (api == null)
  245. {
  246. result.success = false;
  247. result.message = "放弃转链";
  248. result.reason = "没有匹配账号";
  249. result.rawContent = content;
  250. result.rawContent2 = content2;
  251. _ = TkLogCore.LogAsync(result);
  252. return new APIResult(result);
  253. }
  254. var account = await JdPoolCore.GetOneAsync();
  255. if (account == null)
  256. {
  257. result.success = false;
  258. result.message = "放弃转链";
  259. result.reason = "没有匹配账号";
  260. result.rawContent = content;
  261. result.rawContent2 = content2;
  262. _ = TkLogCore.LogAsync(result);
  263. return new APIResult(result);
  264. }
  265. result = DataokeCore.JdParse(result, api, account, content);
  266. }
  267. catch (Exception ex)
  268. {
  269. _ = new LoggerLibrary("api_error")
  270. .Info(s, s2)
  271. .Info("【jd】", body)
  272. .Info(ex.Message, ex.StackTrace)
  273. .SaveAsync();
  274. NotifyCore.Notify(new NifyMessage
  275. {
  276. message = $"【转链接口异常】\n{content}\n{content2}\n{body}\n\n{ex.Message}\n{ex.StackTrace}",
  277. priority = NifyMessagePriority.high,
  278. tags = ["red_circle"]
  279. });
  280. result.success = false;
  281. result.message = "放弃转链";
  282. result.reason = "转链接口异常";
  283. }
  284. result.rawContent = content;
  285. result.rawContent2 = content2;
  286. _ = TkLogCore.LogAsync(result);
  287. return new APIResult(new
  288. {
  289. result.success,
  290. result.message,
  291. result.shortLinkurl,
  292. result.itemId,
  293. result.itemName,
  294. result.deeplink_url,
  295. });
  296. }
  297. [HttpGet]
  298. public async Task<ActionResult> Reload()
  299. {
  300. await EndPointCore.NotifyReload();
  301. return new APIResult(new
  302. {
  303. success = true,
  304. message = "ok",
  305. });
  306. }
  307. [HttpGet]
  308. public async Task<ActionResult> dplist([FromQuery] string query = "", [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  309. {
  310. var clientIp = _accessor.HttpContext.GetUserIp();
  311. //验证签名
  312. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  313. {
  314. _ = new LoggerLibrary("api", "dplist_error")
  315. .Info($"{clientIp}\t{query}")
  316. .Info($"{a}\t{sign}\t{t}")
  317. .Info("验证错误")
  318. .SaveAsync();
  319. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  320. }
  321. DateTime time1 = t.Convert2Datetime();
  322. if (time1 < DateTime.Now.AddMinutes(-10))
  323. {
  324. _ = new LoggerLibrary("api", "dplist_error")
  325. .Info($"{clientIp}\t{query}")
  326. .Info($"{a}\t{sign}\t{t}")
  327. .Info("验证错误2")
  328. .SaveAsync();
  329. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  330. }
  331. var account = await ApiAccountCore.GetOneAsync(a);
  332. if (account == null)
  333. {
  334. _ = new LoggerLibrary("api", "dplist_error")
  335. .Info($"{clientIp}\t{query}")
  336. .Info($"{a}\t{sign}\t{t}")
  337. .Info("验证错误3")
  338. .SaveAsync();
  339. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  340. }
  341. string app_sign = $"{account.api_secret}@{t}".MD5();
  342. if (sign != app_sign)
  343. {
  344. _ = new LoggerLibrary("api", "dplist_error")
  345. .Info($"{clientIp}\t{query}")
  346. .Info($"{a}\t{sign}\t{t}")
  347. .Info("验证错误4")
  348. .SaveAsync();
  349. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  350. }
  351. if (string.IsNullOrEmpty(query))
  352. {
  353. _ = new LoggerLibrary("api", "dplist_error")
  354. .Info($"{clientIp}\t{query}")
  355. .Info($"{a}\t{sign}\t{t}")
  356. .Info("查询条件不能为空")
  357. .SaveAsync();
  358. return new APIResult(new { success = false, message = "查询条件不能为空" });
  359. }
  360. int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
  361. int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
  362. string filter = $"batchId=@query";
  363. var account_list = await TkPoolCore.ListAsync();
  364. List<int> account_ids = [];
  365. if (account_list.Any())
  366. {
  367. account_ids = account_list.Where(e => e.enable_fake_click).Select(e => e.id).ToList();
  368. if (report_account_ids.Length > 0)
  369. {
  370. account_ids = account_ids.Intersect(report_account_ids).ToList();
  371. }
  372. if (report_exclude_account_ids.Length > 0)
  373. {
  374. account_ids = account_ids.Except(report_exclude_account_ids).ToList();
  375. }
  376. filter += $" AND accountId IN @account_ids";
  377. }
  378. string orderBy = "paid_time ASC";
  379. var data = new DBContext.Table("tk_order_tracking")
  380. .Where(filter, new { query, account_ids })
  381. .Order(orderBy)
  382. .Select<TkOrderTrackingDTO>();
  383. //fake_click_link_type
  384. List<object> list = [];
  385. foreach (var item in data)
  386. {
  387. list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
  388. }
  389. var ids = data.Select(e => e.Id).ToArray();
  390. _ = new LoggerLibrary("api", "dplist")
  391. .Info($"{clientIp}\t{query}\tcount:{list.Count}")
  392. .Info(string.Join(',', ids))
  393. .SaveAsync();
  394. var update = new DBContext.Table("tk_order_tracking")
  395. .Add("last_pull_time", DateTime.Now)
  396. .Add("last_pull_account", account.name)
  397. .Add("clicked_num:", "clicked_num+1")
  398. .Where("id IN @ids", new { ids })
  399. .Update();
  400. return new APIResult(new
  401. {
  402. success = true,
  403. message = list.Count == 0 ? "none" : "ok",
  404. count = list.Count,
  405. data = list,
  406. });
  407. }
  408. [HttpGet]
  409. public async Task<ActionResult> unsafeParseDpList([FromQuery] string a = "", [FromQuery] string query = "")
  410. {
  411. if (string.IsNullOrEmpty(a))
  412. {
  413. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  414. }
  415. var account = await ApiAccountCore.GetOneAsync(a);
  416. if (account == null || !account.enable_report)
  417. {
  418. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  419. }
  420. if (string.IsNullOrEmpty(query))
  421. {
  422. return new APIResult(new { success = false, message = "查询条件不能为空" });
  423. }
  424. int[] report_account_ids = account.report_account_ids.TryToArray<int>(',');
  425. int[] report_exclude_account_ids = account.report_exclude_account_ids.TryToArray<int>(',');
  426. string filter = $"batchId=@query";
  427. var account_list = await TkPoolCore.ListAsync();
  428. List<int> account_ids = [];
  429. if (account_list.Any())
  430. {
  431. account_ids = account_list.Where(e => e.enable_fake_click).Select(e => e.id).ToList();
  432. if (report_account_ids.Length > 0)
  433. {
  434. account_ids = account_ids.Intersect(report_account_ids).ToList();
  435. }
  436. if (report_exclude_account_ids.Length > 0)
  437. {
  438. account_ids = account_ids.Except(report_exclude_account_ids).ToList();
  439. }
  440. filter += $" AND accountId IN @account_ids";
  441. }
  442. string orderBy = "paid_time ASC";
  443. var data = new DBContext.Table("tk_order_tracking")
  444. .Where(filter, new { query, account_ids })
  445. .Order(orderBy)
  446. .Select<TkOrderTrackingDTO>();
  447. List<object> list = [];
  448. foreach (var item in data)
  449. {
  450. list.Add(new { pid = item.accountId, url = item.deeplinkUrl, item.shortLinkUrl, count = item.click_num, time = item.exp_time });
  451. }
  452. var clientIp = _accessor.HttpContext.GetUserIp();
  453. LoggerLibrary log = new LoggerLibrary("api", "unsafeParseDpList");
  454. log.Info($"{clientIp}\t{query}\tcount:{list.Count}");
  455. var ids = data.Select(e => e.Id).ToArray();
  456. log.Info(string.Join(',', ids));
  457. _ = log.SaveAsync();
  458. return new APIResult(new
  459. {
  460. success = true,
  461. message = list.Count == 0 ? "none" : "ok",
  462. count = list.Count,
  463. data = list,
  464. });
  465. }
  466. [HttpPost]
  467. public async Task<ActionResult> dataReport([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
  468. {
  469. bool debug = form.Read("debug", false);
  470. var clientIp = _accessor.HttpContext.GetUserIp();
  471. var log = new LoggerLibrary("ApiReportCore", "dataReport");
  472. log.Info(clientIp);
  473. //验证签名
  474. if (string.IsNullOrEmpty(a) || string.IsNullOrEmpty(sign))
  475. {
  476. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误")
  477. .Info(form.GetRawText())
  478. .SaveAsync();
  479. return new APIResult(new { success = false, message = "验证错误" }, APIResultCodeEnum.Unauthorized);
  480. }
  481. DateTime time1 = t.Convert2Datetime();
  482. if (time1 < DateTime.Now.AddMinutes(-10))
  483. {
  484. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误2")
  485. .Info(form.GetRawText())
  486. .SaveAsync();
  487. return new APIResult(new { success = false, message = "验证错误2" }, APIResultCodeEnum.Unauthorized);
  488. }
  489. var account = await ApiAccountCore.GetOneAsync(a);
  490. if (account == null)
  491. {
  492. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\t", $"message:验证错误3")
  493. .Info(form.GetRawText())
  494. .SaveAsync();
  495. return new APIResult(new { success = false, message = "验证错误3" }, APIResultCodeEnum.Unauthorized);
  496. }
  497. string app_sign = $"{account.api_secret}@{t}".MD5();
  498. if (sign != app_sign)
  499. {
  500. _ = log.Info($"a:{a}\tt:{t}\tsign:{sign}\tapp_sign:{app_sign}", $"message:验证错误4")
  501. .Info(form.GetRawText())
  502. .SaveAsync();
  503. return new APIResult(new { success = false, message = "验证错误4" }, APIResultCodeEnum.Unauthorized);
  504. }
  505. try
  506. {
  507. //0:全分销类型;-1:各分销类型,1:goods 2: live 3:video 4: profile 5: unknown
  508. int distributiontype = form.Read("distributiontype", 0);
  509. //0:全平台;-1:各平台;1:淘宝 2:京东 2:多多
  510. int platform = form.Read("platform", 0);
  511. var data = await ApiReportCore.ReportDailysAsync(form, clientIp, debug);
  512. _ = log.Info(form.GetRawText(), data.Convert2Json()).SaveAsync();
  513. return new APIResult(new { success = true, platform, distributiontype, data });
  514. }
  515. catch (Exception ex)
  516. {
  517. _ = log.Info(form.GetRawText()).Info(ex.Message, ex.StackTrace).SaveAsync();
  518. return new APIResult(new { success = false, message = "内部错误" });
  519. }
  520. }
  521. [HttpPost]
  522. public async Task<ActionResult> unsafeDataReport([FromBody] JsonElement form)
  523. {
  524. bool debug = form.Read("debug", false);
  525. var clientIp = _accessor.HttpContext.GetUserIp();
  526. var log = new LoggerLibrary("ApiReportCore", "unsafeDataReport");
  527. log.Info(clientIp);
  528. try
  529. {
  530. //0:全分销类型;-1:各分销类型,1:goods 2: live 3:video 4: profile 5: unknown
  531. int distributiontype = form.Read("distributiontype", 0);
  532. //0:全平台;-1:各平台;1:淘宝 2:京东
  533. int platform = form.Read("platform", 0);
  534. var data = await ApiReportCore.ReportDailysAsync(form, clientIp, debug);
  535. _ = log.Info(form.GetRawText(), data.Convert2Json()).SaveAsync();
  536. return new APIResult(new { success = true, platform, distributiontype, data });
  537. }
  538. catch (Exception ex)
  539. {
  540. _ = log.Info(form.GetRawText()).Info(ex.Message, ex.StackTrace).SaveAsync();
  541. return new APIResult(new { success = false, message = "内部错误" });
  542. }
  543. }
  544. }
  545. }