SystemService.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. using HTEXLib.COMM.Helpers;
  2. using Newtonsoft.Json.Linq;
  3. using System;
  4. using System.Collections.Concurrent;
  5. using System.Collections.Generic;
  6. using System.IdentityModel.Tokens.Jwt;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Text.Json;
  10. using System.Threading.Tasks;
  11. using TEAMModelOS.SDK.DI;
  12. using TEAMModelOS.SDK.Extension;
  13. using TEAMModelOS.SDK.Models.Dtos;
  14. using static OpenXmlPowerTools.RevisionProcessor;
  15. namespace TEAMModelOS.SDK.Models.Service
  16. {
  17. public static class SystemService
  18. {
  19. public static async Task RecordAccumulateData(AzureRedisFactory azureRedis,DingDing dingDing, Accumulate accumulate)
  20. {
  21. if (!string.IsNullOrWhiteSpace(accumulate.key) && !string.IsNullOrWhiteSpace(accumulate.target) &&
  22. !string.IsNullOrWhiteSpace(accumulate.id) && !string.IsNullOrWhiteSpace(accumulate.name) &&
  23. !string.IsNullOrWhiteSpace(accumulate.scope) && !string.IsNullOrWhiteSpace(accumulate.client))
  24. {
  25. await RecordAccumulateData(azureRedis, accumulate.key, accumulate.target, accumulate.id, accumulate.name, accumulate.scope, accumulate.client, accumulate.count);
  26. }
  27. else {
  28. await dingDing.SendBotMsg($"IES累计数据变更统计参数异常,{accumulate.ToJsonString()}", GroupNames.成都开发測試群組);
  29. }
  30. }
  31. /// <summary>
  32. /// 记录累计数据
  33. /// </summary>
  34. public static async Task RecordAccumulateData(AzureRedisFactory azureRedis, string key, string target, string id, string name, string scope, string client,int count)
  35. {
  36. if (!string.IsNullOrWhiteSpace(key) && !string.IsNullOrWhiteSpace(target) &&
  37. !string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(name) &&
  38. !string.IsNullOrWhiteSpace(scope)&& !string.IsNullOrWhiteSpace(client)) {
  39. //处理UTC时差
  40. var nowTime = DateTimeOffset.UtcNow.GetGMTTime();
  41. int difference = (DayOfWeek.Sunday - nowTime.DayOfWeek + 7) % 7; //1-7的结果0-6
  42. var day = nowTime.ToString("yyyyMMdd");
  43. string redisKey = $"Accumulate:Daily:{scope}:{key}:{day}";
  44. string member = $"{target}::{id}::{client}::{name}";
  45. await azureRedis.GetRedisClient(8).SortedSetIncrementAsync(redisKey, member, count);
  46. await azureRedis.GetRedisClient(8).KeyExpireAsync(redisKey,new TimeSpan((difference+1)*24, 10,0));
  47. //if (key.Equals("lesson") || key.StartsWith("login_"))
  48. //{
  49. // redisKey = $"Accumulate:Daily:ies:{key}:{day}";
  50. // if (scope.Equals("school"))
  51. // {
  52. // member = $"ies::{id}::{name}";
  53. // }
  54. // else {
  55. // member = $"ies::ies::{name}";
  56. // }
  57. // await azureRedis.GetRedisClient(8).SortedSetIncrementAsync(redisKey, member, 1);
  58. //}
  59. }
  60. }
  61. public static (ConcurrentBag<ApiVist> vists, ConcurrentBag<(string uuid, HttpLog httpLog, List<string> tmdid, List<string> school)> uuidInfo) ConvertHttpLog(ConcurrentBag<HttpLog> logs, IPSearcher _ipSearcher, Region2LongitudeLatitudeTranslator _longitudeLatitudeTranslator)
  62. {
  63. ConcurrentBag<ApiVist> vists = new ConcurrentBag<ApiVist>();
  64. ConcurrentBag<(string uuid, HttpLog httpLog, List<string> tmdid, List<string> school)> uuidInfo = new ConcurrentBag<(string uuid, HttpLog httpLog, List<string> tmdid, List<string> school)>();
  65. object lockObj = new object();
  66. Parallel.ForEach(logs, async log => {
  67. string uuid = Guid.NewGuid().ToString();
  68. List<string> schoolMatch = new List<string>();
  69. List<string> useridMatch = new List<string>();
  70. var vist = new ApiVist()
  71. {
  72. id=uuid,
  73. ip=log.ip,
  74. tid=log.tid,
  75. time= log.time,
  76. userId= log.id,
  77. school= log.school,
  78. tname= log.name,
  79. path = log.path,
  80. year=log.year,
  81. month=log.month,
  82. day=log.day,
  83. hour=log.hour
  84. };
  85. if (string.IsNullOrWhiteSpace(vist.userId))
  86. {
  87. //var jsonPathContext = new JsonPathContext();
  88. //jsonPathContext.ValueSystem= new JsonTextValueSystem();
  89. string path = "$..['id_token','idToken','idtoken','tmdid','id','teacherId','teacher','tid','tId','userid','userId','code','studentId','student','studentid']";
  90. JObject jsonObject = JObject.Parse(log.param.GetRawText());
  91. //var nodes_path = jsonPathContext.SelectNodes(log.param, path);
  92. var nodes_path = jsonObject.SelectTokens(path);
  93. foreach (var node in nodes_path)
  94. {
  95. // 只获取是字符串的
  96. if (node.Type.Equals(JTokenType.String))
  97. {
  98. switch (true)
  99. {
  100. case bool when node.Path.Contains("id_token")||node.Path.Contains("idToken")||node.Path.Contains("idtoken"):
  101. {
  102. try
  103. {
  104. var jwt = new JwtSecurityToken($"{node}");
  105. string id = jwt.Payload.Sub;
  106. var name = jwt.Claims.FirstOrDefault(claim => claim.Type.Equals("name"))?.Value;
  107. if (!string.IsNullOrWhiteSpace(id) && long.TryParse(id, out long _id))
  108. {
  109. useridMatch.Add(id);
  110. }
  111. }
  112. catch (Exception ex) { }
  113. break;
  114. }
  115. case bool when node.Path.Contains("tmdid")||node.Path.Contains("id")||node.Path.Contains("teacherId")
  116. ||node.Path.Contains("teacher")||node.Path.Contains("tid")||node.Path.Contains("tId")||node.Path.Contains("userid")
  117. ||node.Path.Contains("userId")||node.Path.Contains("studentId")||node.Path.Contains("student")||node.Path.Contains("studentid"):
  118. {
  119. if (!string.IsNullOrWhiteSpace($"{node}") && long.TryParse($"{node}", out long _id))
  120. {
  121. useridMatch.Add($"{node}");
  122. }
  123. break;
  124. }
  125. case bool when node.Path.Contains("code"):
  126. {
  127. if (!string.IsNullOrWhiteSpace($"{node}"))
  128. {
  129. if (long.TryParse($"{node}", out long _id))
  130. {
  131. useridMatch.Add($"{node}");
  132. }
  133. else
  134. {
  135. string[] codes = $"{node}".Split("-");
  136. foreach (var _code in codes)
  137. {
  138. if (long.TryParse(_code, out long _codeid))
  139. {
  140. useridMatch.Add($"{_code}");
  141. break;
  142. }
  143. }
  144. }
  145. }
  146. break;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. if (string.IsNullOrWhiteSpace(vist.school))
  153. {
  154. string path = "$..['school','id','schoolId','schoolid','schoolCode','school_code','schoolcode','code']";
  155. JObject jsonObject = JObject.Parse(log.param.GetRawText());
  156. var nodes_path = jsonObject.SelectTokens(path);
  157. foreach (var node in nodes_path)
  158. {
  159. // 只获取是字符串的
  160. if (node.Type.Equals(JTokenType.String))
  161. {
  162. switch (true)
  163. {
  164. case bool when node.Path.Contains("school")||node.Path.Contains("id")||node.Path.Contains("schoolId")
  165. ||node.Path.Contains("schoolid")||node.Path.Contains("schoolCode")||node.Path.Contains("school_code")||node.Path.Contains("schoolcode"):
  166. {
  167. if (!$"{node}".Contains("-")&& $"{node}".Length<=8)
  168. {
  169. schoolMatch.Add($"{node}");
  170. }
  171. break;
  172. }
  173. case bool when node.Path.Contains("code"):
  174. {
  175. if (!$"{node}".Contains("-")&& $"{node}".Length<=8)
  176. {
  177. schoolMatch.Add($"{node}");
  178. }
  179. else
  180. {
  181. string[] codes = $"{node}".Split("-");
  182. foreach (var _code in codes)
  183. {
  184. if ($"{node}".Length<=8)
  185. {
  186. schoolMatch.Add($"{_code}");
  187. break;
  188. }
  189. }
  190. }
  191. break;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. //处理 client
  198. {
  199. if (!string.IsNullOrWhiteSpace(log.client))
  200. {
  201. if (log.client.Equals("IES", StringComparison.OrdinalIgnoreCase))
  202. {
  203. vist.client="ies5";
  204. }
  205. if (log.client.Equals("AClassONE", StringComparison.OrdinalIgnoreCase))
  206. {
  207. vist.client="aclassone";
  208. }
  209. if (log.client.Equals("BB", StringComparison.OrdinalIgnoreCase))
  210. {
  211. vist.client="habb";
  212. }
  213. if (log.client.Equals("HiTool", StringComparison.OrdinalIgnoreCase) ||log.client.Equals("HiTools", StringComparison.OrdinalIgnoreCase))
  214. {
  215. vist.client="hiscan";
  216. }
  217. if (log.client.Equals("HiTA", StringComparison.OrdinalIgnoreCase))
  218. {
  219. vist.client="hita";
  220. }
  221. if (log.client.Equals("HiTeachCC", StringComparison.OrdinalIgnoreCase))
  222. {
  223. vist.client="hiteachcc";
  224. }
  225. if (log.client.Equals("HiTeach", StringComparison.OrdinalIgnoreCase))
  226. {
  227. vist.client="hiteach";
  228. }
  229. if (log.client.Equals("Open", StringComparison.OrdinalIgnoreCase))
  230. {
  231. vist.client="open";
  232. }
  233. }
  234. }
  235. //补全站点
  236. {
  237. if (!string.IsNullOrWhiteSpace(log.host)
  238. &&(log.host.Equals("teammodelos-yx.chinacloudsites.cn")||log.host.Equals("teammodelos.chinacloudsites.cn")
  239. ||log.host.Equals("yx.teammodel.cn")))
  240. {
  241. log.host="IES-正式站";
  242. log.host="www.teammodel.cn";
  243. vist.client="ies5";
  244. }
  245. if (!string.IsNullOrWhiteSpace(log.host)
  246. &&(log.host.Equals("scyx.teammodel.cn") ||log.host.Equals("jinniu.teammodel.cn")))
  247. {
  248. log.host="研修2.0-正式站";
  249. log.host="scyx.teammodel.cn";
  250. vist.client="ability";
  251. }
  252. if (!string.IsNullOrWhiteSpace(log.host)
  253. &&(log.host.Equals("open.teammodel.cn")))
  254. {
  255. log.host="开放平台-正式站";
  256. log.host="open.teammodel.cn";
  257. vist.client="open";
  258. }
  259. if (!string.IsNullOrWhiteSpace(log.host)
  260. &&(log.host.Equals("open-test.teammodel.cn") ||log.host.Equals("zhiyin-test.teammodel.cn")))
  261. {
  262. log.host="开放平台-测试站";
  263. log.host="open-test.teammodel.cn";
  264. vist.client="open";
  265. }
  266. //
  267. if (!string.IsNullOrWhiteSpace(log.host)
  268. &&(log.host.Equals("teammodelos-rc.chinacloudsites.cn")))
  269. {
  270. log.host="IES-RC站";
  271. log.host="rc.teammodel.cn";
  272. vist.client="ies5";
  273. }
  274. if (!string.IsNullOrWhiteSpace(log.host)
  275. &&(log.host.Equals("teammodelos-test.chinacloudsites.cn")))
  276. {
  277. log.host="IES-测试站";
  278. log.host="test.teammodel.cn";
  279. vist.client="ies5";
  280. }
  281. if (!string.IsNullOrWhiteSpace(log.host)
  282. &&(log.host.Equals("teammodelbi-test.chinacloudsites.cn")))
  283. {
  284. log.host="BI-测试站";
  285. log.host="bitest.teammodel.cn";
  286. vist.client="bi";
  287. }
  288. if (!string.IsNullOrWhiteSpace(log.host)
  289. &&(log.host.Equals("teammodelbi.chinacloudsites.cn")))
  290. {
  291. log.host="BI-正式站";
  292. log.host="bi.teammodel.cn";
  293. vist.client="bi";
  294. }
  295. if (!string.IsNullOrWhiteSpace(log.host)
  296. &&(log.host.Equals("teamcontest.chinacloudsites.cn")))
  297. {
  298. log.host="赛课-正式站";
  299. log.host="contest.teammodel.cn";
  300. vist.client="contest";
  301. }
  302. if (!string.IsNullOrWhiteSpace(log.host)
  303. &&(log.host.Equals("contest.chinacloudsites.cn")))
  304. {
  305. log.host="赛课-正式站";
  306. log.host="contest.teammodel.cn";
  307. vist.client="contest";
  308. }
  309. if (!string.IsNullOrWhiteSpace(log.host)
  310. &&(log.host.Equals("contest-test.chinacloudsites.cn")))
  311. {
  312. log.host="赛课-测试站";
  313. log.host="contest-test.teammodel.cn";
  314. vist.client="contest";
  315. }
  316. if (!string.IsNullOrWhiteSpace(log.host)
  317. &&(log.host.Equals("hiteachcc.chinacloudsites.cn")))
  318. {
  319. log.host="CC-正式站";
  320. log.host="hiteachcc.teammodel.cn";
  321. vist.client="hiteachcc";
  322. }
  323. if (!string.IsNullOrWhiteSpace(log.host) &&(log.host.Equals("appraisal.chinacloudsites.cn")))
  324. {
  325. log.host="评价-正式站";
  326. log.host="appraisal.teammodel.cn";
  327. vist.client="appraisal";
  328. }
  329. if (!string.IsNullOrWhiteSpace(log.host)
  330. &&(log.host.Equals("appraisal-test.chinacloudsites.cn")))
  331. {
  332. log.host="评价-测试站";
  333. log.host="appraisal-test.teammodel.cn";
  334. vist.client="appraisal";
  335. }
  336. if (log.host.Equals("localhost") && log.p.Equals("appraisal"))
  337. {
  338. log.host="评价-测试站";
  339. log.host="appraisal-test.teammodel.cn";
  340. vist.client="appraisal";
  341. }
  342. if (log.host.Equals("localhost") && log.p.Equals("os"))
  343. {
  344. log.host="IES-测试站";
  345. log.host="test.teammodel.cn";
  346. vist.client="ies5";
  347. }
  348. else if (log.host.Equals("localhost") && (log.p.Equals("bi")))
  349. {
  350. log.host="BI-测试站";
  351. log.host="bitest.teammodel.cn";
  352. vist.client="bi";
  353. }
  354. }
  355. //补全产品端
  356. {
  357. //研修2.0
  358. if (log.path.Contains("research") || log.path.Contains("study") || log.path.Contains("standard-file"))
  359. {
  360. vist.client="ability";
  361. }
  362. if (log.path.StartsWith("/activity"))
  363. {
  364. vist.client="contest";
  365. }
  366. //小程序
  367. if (log.path.Contains("aclassone"))
  368. {
  369. vist.client="aclassone";
  370. }
  371. // /// <summary>
  372. /// ExamInfo qamode 書面問答類型 0:書面問答 1:紙本測驗 2:艺术评测
  373. /// </summary>
  374. //艺术评测
  375. if (log.path.Contains("art") ||log.path.Contains("aclassone/find-children-activity") ||log.path.Contains("aclassone/find-teacher-activity") ||log.path.Contains("aclassone/find-summary-activity") ||log.path.Contains("aclassone/upload-all") ||log.path.Contains("aclassone/delete"))
  376. {
  377. vist.client="art";
  378. }
  379. if (log.path.Contains("habb"))
  380. {
  381. vist.client="habb";
  382. }
  383. //阅卷客户端
  384. if (log.path.Contains("hiscan"))
  385. {
  386. vist.client="hiscan";
  387. }
  388. if (log.path.Contains("hita"))
  389. {
  390. vist.client="hita";
  391. }
  392. if (log.path.Contains("hiteachcc"))
  393. {
  394. vist.client="hiteachcc";
  395. }
  396. if (log.path.Contains("sokrate"))
  397. {
  398. vist.client="sokrate";
  399. }
  400. if (log.path.Contains("sokrate") || log.path.Contains("score"))
  401. {
  402. vist.client="sokrate";
  403. }
  404. if (log.path.Contains("hiteach"))
  405. {
  406. vist.client="hiteach";
  407. }
  408. ///IES开放平台
  409. if (log.path.Contains("business") || log.path.Contains("biz") || log.path.Contains("openapi-config") || log.path.Contains("open-api"))
  410. {
  411. vist.client="open";
  412. }
  413. //从token的role 能否获取 开放平台
  414. //单点登录及第三方接口
  415. if (log.path.Contains("lepei") || log.path.Contains("sc/") || log.path.Contains("/sso") || log.path.Contains("sc-init") || log.path.Contains("data-push") || log.path.Contains("xkw")|| log.path.Contains("tianbo")
  416. || log.path.Contains("oauth/check-bind")|| log.path.Contains("dingding") || log.path.Contains("wechat")
  417. )
  418. {
  419. vist.client="sso-third";
  420. }
  421. }
  422. //处理IP转地区
  423. vist.region=await _ipSearcher.SearchIpAsync(vist.ip);
  424. if (!string.IsNullOrWhiteSpace(vist.region))
  425. {
  426. vist.region= vist.region.Replace("省·", "·").Replace("市·", "·").Replace("特别行政区·", "·").Replace("藏族羌族自治州·", "·");
  427. var regions = vist.region.Split("·");
  428. if (regions.Length==4)
  429. {
  430. vist.area= regions[0];
  431. vist.province = regions[1];
  432. vist.city = regions[2];
  433. }
  434. if (regions.Length==3)
  435. {
  436. vist.area= regions[0];
  437. vist.province = regions[1];
  438. }
  439. if (regions.Length==2)
  440. {
  441. vist.area= regions[0];
  442. vist.province = regions[1];
  443. }
  444. if (regions.Length==1)
  445. {
  446. vist.area= regions[0];
  447. }
  448. }
  449. //处理地区转经纬度
  450. {
  451. IEnumerable<JToken> tokens = default;
  452. if (!string.IsNullOrWhiteSpace(vist.city) && !string.IsNullOrWhiteSpace(vist.province) && !string.IsNullOrWhiteSpace(vist.area))
  453. {
  454. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.province=~ /.*{vist.province}/i && @.city=~ /.*{vist.city}/i)]");
  455. if (!(tokens.Any() && tokens.Count()>0))
  456. {
  457. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.province=~ /.*{vist.city}/i && @.city=~ /.*{vist.province}/i)]");
  458. if (!(tokens.Any() && tokens.Count()>0))
  459. {
  460. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.province=~ /.*{vist.city}/i || @.city=~ /.*{vist.city}/i)]");
  461. }
  462. if (!(tokens.Any() && tokens.Count()>0))
  463. {
  464. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.province=~ /.*{vist.province}/i||@.city=~ /.*{vist.province}/i)]");
  465. }
  466. }
  467. }
  468. else if (string.IsNullOrWhiteSpace(vist.city) && !string.IsNullOrWhiteSpace(vist.province) && !string.IsNullOrWhiteSpace(vist.area))
  469. {
  470. if (vist.area.Equals("中国"))
  471. {
  472. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.province=~ /.*{vist.province}/i)]");
  473. if (!(tokens.Any() && tokens.Count()>0))
  474. {
  475. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.city=~ /.*{vist.province}/i)]");
  476. }
  477. }
  478. else
  479. {
  480. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.city=~ /.*{vist.province}/i || @.province=~ /.*{vist.province}/i)]");
  481. }
  482. }
  483. else if (!string.IsNullOrWhiteSpace(vist.city) && string.IsNullOrWhiteSpace(vist.province)&& !string.IsNullOrWhiteSpace(vist.area))
  484. {
  485. if (vist.area.Equals("中国"))
  486. {
  487. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.province=~ /.*{vist.city}/i)]");
  488. if (!(tokens.Any() && tokens.Count()>0))
  489. {
  490. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.city=~ /.*{vist.province}/i)]");
  491. }
  492. }
  493. else
  494. {
  495. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.city=~ /.*{vist.city}/i || @.city=~ /.*{vist.province}/i)]");
  496. }
  497. }
  498. else if (string.IsNullOrWhiteSpace(vist.city) && string.IsNullOrWhiteSpace(vist.province)&& !string.IsNullOrWhiteSpace(vist.area))
  499. {
  500. tokens= _longitudeLatitudeTranslator.regionJson.SelectTokens($"$..[?(@.country=~ /.*{vist.area}/i && @.m=='1')]");
  501. }
  502. if (tokens!= null && tokens!=default && tokens.Any() && tokens.Count()>0)
  503. {
  504. List<RegionLngLat> regionLngLats = new List<RegionLngLat>();
  505. foreach (JToken token in tokens)
  506. {
  507. regionLngLats.Add(token.ToString().ToObject<RegionLngLat>());
  508. }
  509. var region = regionLngLats.FindAll(x => string.IsNullOrWhiteSpace(x.area));
  510. if (!region.IsNotEmpty())
  511. {
  512. region= regionLngLats.FindAll(x => !string.IsNullOrWhiteSpace(x.m) && x.m.Equals("1"));
  513. }
  514. vist.point= region?.FirstOrDefault();
  515. }
  516. }
  517. vist.host= log.host;
  518. vist.hostName=log.hostName;
  519. uuidInfo.Add((uuid, log, useridMatch, schoolMatch));
  520. vists.Add(vist);
  521. });
  522. return (vists, uuidInfo);
  523. }
  524. public class ApiVist
  525. {
  526. public string id { get; set; }
  527. public string path { get; set; }
  528. /// <summary>
  529. /// 细分
  530. /// ies5 ,hiteach,hita,cc,bi,contest,open,aclassone,sokrates,ability,art
  531. /// 产品端
  532. /// </summary>
  533. public string client { get; set; }
  534. /// <summary>
  535. /// 具体功能
  536. /// </summary>
  537. public string func { get; set; }
  538. public string userId { get; set; }
  539. public string scope { get; set; }
  540. public string tname { get; set; }
  541. public string school { get; set; }
  542. public string ip { get; set; }
  543. public string region { get; set; }
  544. public string area { get; set; }
  545. public string province { get; set; }
  546. public string city { get; set; }
  547. public long time { get; set; }
  548. /// <summary>
  549. ///
  550. /// </summary>
  551. public string host { get; set; }
  552. public string hostName = "其他";
  553. /// <summary>
  554. /// tokenid
  555. /// </summary>
  556. public string tid { get; set; }
  557. public string year { get; set; }
  558. public string month { get; set; }
  559. public string day { get; set; }
  560. public string hour { get; set; }
  561. public RegionLngLat point { get; set; }
  562. }
  563. public class HttpLog
  564. {
  565. public string ip { get; set; }
  566. public long time { get; set; }
  567. public string host { get; set; }
  568. public string hostName = "其他";
  569. public string tid { get; set; }
  570. public string path { get; set; }
  571. public string client { get; set; }
  572. public JsonElement param { get; set; }
  573. public string id { get; set; }
  574. public string name { get; set; }
  575. public string school { get; set; }
  576. public string p { get; set; }
  577. // public string ua { get; set; }
  578. // public string referer { get; set; }
  579. public string scope { get; set; }
  580. public string year { get; set; }
  581. public string month { get; set; }
  582. public string day { get; set; }
  583. public string hour { get; set; }
  584. }
  585. public record RegionLngLat
  586. {
  587. public string country { get; set; }
  588. public string province { get; set; }
  589. public string city { get; set; }
  590. public string lat { get; set; }
  591. public string lng { get; set; }
  592. public string area { get; set; }
  593. public string m { get; set; } = "0";
  594. }
  595. }
  596. }