AreaRelevantController.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. using Azure.Cosmos;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using Microsoft.Extensions.Configuration;
  5. using Microsoft.Extensions.Options;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text.Json;
  10. using System.Threading.Tasks;
  11. using TEAMModelBI.Filter;
  12. using TEAMModelBI.Models;
  13. using TEAMModelBI.Tool.Extension;
  14. using TEAMModelOS.Models;
  15. using TEAMModelOS.SDK;
  16. using TEAMModelOS.SDK.Context.BI;
  17. using TEAMModelOS.SDK.Context.Constant;
  18. using TEAMModelOS.SDK.DI;
  19. using TEAMModelOS.SDK.Extension;
  20. using TEAMModelOS.SDK.Models;
  21. using TEAMModelOS.SDK.Models.Cosmos.BI;
  22. namespace TEAMModelBI.Controllers.BISchool
  23. {
  24. [Route("area")]
  25. [ApiController]
  26. public class AreaRelevantController : ControllerBase
  27. {
  28. //数据容器
  29. private readonly AzureCosmosFactory _azureCosmos;
  30. private readonly AzureStorageFactory _azureStorage;
  31. //钉钉提示信息
  32. private readonly DingDing _dingDing;
  33. private readonly Option _option;
  34. private readonly IConfiguration _configuration;
  35. private readonly CoreAPIHttpService _coreAPIHttpService;
  36. public AreaRelevantController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, DingDing dingDing, IOptionsSnapshot<Option> option, IConfiguration configuration, CoreAPIHttpService coreAPIHttpService)
  37. {
  38. _azureCosmos = azureCosmos;
  39. _azureStorage = azureStorage;
  40. _dingDing = dingDing;
  41. _option = option?.Value;
  42. }
  43. /// <summary>
  44. /// 查询区域已经有的学校 已对接
  45. /// </summary>
  46. /// <param name="jsonElement"></param>
  47. /// <returns></returns>
  48. [ProducesDefaultResponseType]
  49. [HttpPost("get-areaschools")]
  50. public async Task<IActionResult> GetAreaSchools(JsonElement jsonElement)
  51. {
  52. try
  53. {
  54. jsonElement.TryGetProperty("areaId", out JsonElement _areaId);
  55. jsonElement.TryGetProperty("isDefault", out JsonElement _isDefalue);
  56. jsonElement.TryGetProperty("site", out JsonElement site);
  57. var cosmosClient = _azureCosmos.GetCosmosClient();
  58. if ($"{site}".Equals(BIConst.Global))
  59. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  60. var isManyArea = false;
  61. if (!string.IsNullOrEmpty($"{_isDefalue}"))
  62. {
  63. isManyArea = true;
  64. }
  65. List<JoinAreaSchool> joinAreaSchools = new();
  66. string sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c WHERE c.areaId='{_areaId}'";
  67. if (isManyArea)
  68. {
  69. sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c join m in c.manyAreas WHERE c.areaId ='{_areaId}' or m.areaId='{_areaId}'";
  70. //sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period FROM c join m in c.manyAreas where m.areaId='{_areaId}' or c.areaId='{_areaId}'";
  71. }
  72. await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
  73. {
  74. using var json = await JsonDocument.ParseAsync(item.ContentStream);
  75. if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
  76. {
  77. foreach(var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
  78. {
  79. JoinAreaSchool joinAreaSchool = new JoinAreaSchool
  80. {
  81. id = obj.GetProperty("id").GetString(),
  82. name = obj.GetProperty("name").GetString(),
  83. schoolCode = obj.GetProperty("schoolCode").GetString(),
  84. province = obj.GetProperty("province").GetString(),
  85. city = obj.GetProperty("city").GetString(),
  86. dist = obj.GetProperty("dist").GetString(),
  87. picture = obj.GetProperty("picture").GetString(),
  88. period = obj.GetProperty("period").ToObject<List<Period>>().Select(x => x.name).ToList(),
  89. areaId = obj.GetProperty("areaId").GetString(),
  90. standard = obj.GetProperty("standard").GetString()
  91. };
  92. try
  93. {
  94. joinAreaSchool.areas = obj.GetProperty("areas").ToObject<List<SchoolArea>>();
  95. }
  96. catch { }
  97. joinAreaSchools.Add(joinAreaSchool);
  98. }
  99. }
  100. }
  101. return Ok(new { state = 200, joinAreaSchools });
  102. }
  103. catch (Exception ex)
  104. {
  105. await _dingDing.SendBotMsg($"BI, {_option.Location} /area/get-areaschools \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  106. return BadRequest();
  107. }
  108. }
  109. /// <summary>
  110. /// 学校移出区域 //已对接
  111. /// </summary>
  112. /// <param name="jsonElement"></param>
  113. /// <returns></returns>
  114. [ProducesDefaultResponseType]
  115. [AuthToken(Roles = "admin,rdc")]
  116. [HttpPost("set-areashiftschool")]
  117. public async Task<IActionResult> SetAreaShiftSchool(JsonElement jsonElement)
  118. {
  119. try
  120. {
  121. if (!jsonElement.TryGetProperty("schoolId", out JsonElement schoolId)) return BadRequest();
  122. jsonElement.TryGetProperty("areaId", out JsonElement areaId);
  123. jsonElement.TryGetProperty("standard", out JsonElement standard);
  124. jsonElement.TryGetProperty("isDefault", out JsonElement isDefault);
  125. jsonElement.TryGetProperty("site", out JsonElement site);
  126. var (_tmdId, _tmdName, pic, did, dname, dpic) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
  127. var cosmosClient = _azureCosmos.GetCosmosClient();
  128. var tableClient = _azureStorage.GetCloudTableClient();
  129. var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
  130. if ($"{site}".Equals(BIConst.Global))
  131. {
  132. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  133. tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
  134. blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
  135. }
  136. var responseSet = await cosmosClient.GetContainer(Constant.TEAMModelOS, "Normal").ReadItemStreamAsync($"{areaId}", new PartitionKey("AreaSetting"));
  137. if (responseSet.Status == 200)
  138. {
  139. using var fileJson = await JsonDocument.ParseAsync(responseSet.ContentStream);
  140. AreaSetting delSet = fileJson.ToObject<AreaSetting>();
  141. if (!string.IsNullOrEmpty(delSet.accessConfig))
  142. return Ok(new { state = 401, msg = "区域已经规定了,不能切换能能力" });
  143. }
  144. School tempSchool = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{schoolId}", new PartitionKey("Base"));
  145. if (bool.Parse($"{isDefault}") == true)
  146. {
  147. tempSchool.areaId = null;
  148. tempSchool.standard = null;
  149. List<Teacher> teachers = new();
  150. await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<Teacher>(queryText: $"SELECT value(c) FROM c join s in c.schools where s.schoolId ='{schoolId}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
  151. {
  152. teachers.Add(item);
  153. }
  154. foreach (var item in teachers)
  155. {
  156. var tchSchool = item.schools.Find(f => f.schoolId.Equals($"{schoolId}") && f.areaId.Equals($"{areaId}"));
  157. if (tchSchool != null)
  158. {
  159. item.schools.Remove(tchSchool);
  160. await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(item, item.id, new PartitionKey("Base"));
  161. }
  162. }
  163. }
  164. if (tempSchool.areas != null)
  165. {
  166. if (bool.Parse($"{isDefault}") == true)
  167. {
  168. tempSchool.areaId = "";
  169. tempSchool.standard = "";
  170. }
  171. if (tempSchool.areas != null)
  172. {
  173. if (!string.IsNullOrEmpty($"{areaId}"))
  174. {
  175. var temp = tempSchool.areas.Find(ma => ma.areaId == $"{areaId}");
  176. if (temp != null)
  177. tempSchool.areas.Remove(temp);
  178. }
  179. }
  180. }
  181. School school = await cosmosClient.GetContainer(Constant.TEAMModelOS, "School").ReplaceItemAsync<School>(tempSchool, tempSchool.id, new PartitionKey("Base"));
  182. //保存操作记录
  183. //await _azureStorage.SaveBILog("school-update", $"{_tmdName}【{_tmdId}】已操作学校({schoolId})移除该区域", _dingDing, httpContext: HttpContext);
  184. await AzureStorageBlobExtensions.SaveBILog(blobClient, tableClient, "school-update", $"{_tmdName}【{_tmdId}】已操作学校(ID:{schoolId})移除已区域(ID:{areaId})", _dingDing, httpContext: HttpContext);
  185. return Ok(new { state = 200, school });
  186. }
  187. catch (Exception ex)
  188. {
  189. await _dingDing.SendBotMsg($"BI, {_option.Location} /area/set-areashiftschool \n {ex.Message}\n{ex.StackTrace}", GroupNames.成都开发測試群組);
  190. return BadRequest();
  191. }
  192. }
  193. /// <summary>
  194. /// 设置区级管理员 //已对接
  195. /// </summary>
  196. /// <param name="jsonElement"></param>
  197. /// <returns></returns>
  198. [ProducesDefaultResponseType]
  199. [AuthToken(Roles = "admin,rdc")]
  200. [HttpPost("set-manage")]
  201. public async Task<IActionResult> SetAreaManage(JsonElement jsonElement)
  202. {
  203. var (_tmdId, _tmdName, _, _, _, _) = HttpJwtAnalysis.JwtXAuthBI(HttpContext.GetXAuth("AuthToken"), _option);
  204. if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
  205. if (!jsonElement.TryGetProperty("tmdName", out JsonElement tmdName)) return BadRequest();
  206. jsonElement.TryGetProperty("tmdPic", out JsonElement tmdPic);
  207. if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
  208. if (!jsonElement.TryGetProperty("areaName", out JsonElement areaName)) return BadRequest();
  209. jsonElement.TryGetProperty("site", out JsonElement site);
  210. var cosmosClient = _azureCosmos.GetCosmosClient();
  211. var tableClient = _azureStorage.GetCloudTableClient();
  212. var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
  213. if ($"{site}".Equals(BIConst.Global))
  214. {
  215. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  216. tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
  217. blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
  218. }
  219. Teacher teacher = null;
  220. var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
  221. if (response.Status == 200)
  222. {
  223. using var json = await JsonDocument.ParseAsync(response.ContentStream);
  224. teacher = json.ToObject<Teacher>();
  225. var existArea = teacher.areas.Find(f => f.areaId.Equals($"{areaId}"));
  226. if (existArea == null)
  227. {
  228. teacher.areas.Add(new Teacher.TeacherArea() { areaId = $"{areaId}", name = $"{areaName}", status = "join" });
  229. teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
  230. }
  231. else
  232. return Ok(new { state = RespondCode.Conflict, msg = "该账户已是管理员" });
  233. }
  234. else
  235. {
  236. teacher.id = $"{tmdId}";
  237. teacher.name = $"{tmdName}";
  238. teacher.picture = string.IsNullOrEmpty($"{tmdPic}") ? "" : $"{tmdPic}";
  239. teacher.pk = "Base";
  240. teacher.code = "Base";
  241. teacher.size = 1;
  242. teacher.createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
  243. //教师存在,在该教师信息中添加要管理的学校信息
  244. teacher.areas.Add(new Teacher.TeacherArea { areaId = $"{areaId}", name = $"{areaName}", status = "join" });
  245. await cosmosClient.GetContainer(Constant.TEAMModelOS, "Teacher").CreateItemAsync<Teacher>(teacher, new PartitionKey("Base"));
  246. }
  247. return Ok(new { state = RespondCode.Ok, teacher });
  248. }
  249. /// <summary>
  250. /// 获取区域的管理员 //已对接
  251. /// </summary>
  252. /// <param name="jsonElement"></param>
  253. /// <returns></returns>
  254. [ProducesDefaultResponseType]
  255. [HttpPost("get-manage")]
  256. public async Task<IActionResult> GetAreaManages(JsonElement jsonElement)
  257. {
  258. if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
  259. jsonElement.TryGetProperty("site", out JsonElement site);
  260. var cosmosClient = _azureCosmos.GetCosmosClient();
  261. if ($"{site}".Equals(BIConst.Global))
  262. {
  263. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  264. }
  265. List<BaseInfo> areaManages = new();
  266. await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Teacher").GetItemQueryIterator<BaseInfo>(queryText:$"select c.id,c.name,c.picture from c join a in c.areas where a.areaId ='{areaId}' and c.code='Base'",requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
  267. {
  268. areaManages.Add(item);
  269. }
  270. return Ok(new { state = RespondCode.Ok, areaManages });
  271. }
  272. /// <summary>
  273. /// 删除区域管理员 //已对接
  274. /// </summary>
  275. /// <param name="jsonElement"></param>
  276. /// <returns></returns>
  277. [ProducesDefaultResponseType]
  278. [AuthToken(Roles = "admin,rdc")]
  279. [HttpPost("del-manage")]
  280. public async Task<IActionResult> DelAreaManage(JsonElement jsonElement)
  281. {
  282. if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
  283. if (!jsonElement.TryGetProperty("tmdId", out JsonElement tmdId)) return BadRequest();
  284. jsonElement.TryGetProperty("site", out JsonElement site);
  285. var cosmosClient = _azureCosmos.GetCosmosClient();
  286. if ($"{site}".Equals(BIConst.Global))
  287. {
  288. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  289. }
  290. Teacher teacher = null;
  291. var response = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReadItemStreamAsync($"{tmdId}", new PartitionKey($"Base"));
  292. if (response.Status == 200)
  293. {
  294. using var json = await JsonDocument.ParseAsync(response.ContentStream);
  295. teacher = json.ToObject<Teacher>();
  296. var existArea = teacher.areas.Find(f => f.areaId.Equals($"{areaId}"));
  297. if (existArea != null)
  298. {
  299. teacher.areas.RemoveAll((stt)=>stt.areaId.Equals($"{areaId}"));
  300. teacher = await cosmosClient.GetContainer("TEAMModelOS", "Teacher").ReplaceItemAsync<Teacher>(teacher, teacher.id, new PartitionKey("Base"));
  301. }
  302. else
  303. return Ok(new { state = RespondCode.NotFound, msg = "该账户不是该区的管理员" });
  304. }
  305. else
  306. return Ok(new { state = RespondCode.NotFound, msg = "未找到该教师信息" });
  307. return Ok(new { state = RespondCode.Ok, teacher });
  308. }
  309. /// <summary>
  310. /// 通过区域ID查询学校列表 //已对接
  311. /// </summary>
  312. /// <param name="jsonElement"></param>
  313. /// <returns></returns>
  314. [ProducesDefaultResponseType]
  315. [HttpPost("get-schools")]
  316. public async Task<IActionResult> GetSchools(JsonElement jsonElement)
  317. {
  318. if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
  319. jsonElement.TryGetProperty("site", out JsonElement site);
  320. var cosmosClient = _azureCosmos.GetCosmosClient();
  321. if ($"{site}".Equals(BIConst.Global))
  322. {
  323. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  324. }
  325. List<AreaSchool> areaSchool = new();
  326. string areaScSql = $"select c.id,c.name,c.picture,c.size,c.areaId,c.scale from c where c.areaId='{areaId}'";
  327. await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<AreaSchool>(queryText: areaScSql,requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
  328. {
  329. areaSchool.Add(item);
  330. }
  331. areaSchool.ForEach(async areaSc =>
  332. {
  333. var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(areaSc.id, new PartitionKey("ProductSum"));
  334. if (response.Status == 200)
  335. {
  336. using var json = await JsonDocument.ParseAsync(response.ContentStream);
  337. if (json.RootElement.TryGetProperty("serial", out JsonElement serial) && !serial.ValueKind.Equals(JsonValueKind.Null))
  338. {
  339. areaSc.serial = serial.ToObject<List<SchoolProductSumData>>().Count;//.Select(x => x.prodCode).ToList();
  340. }
  341. if (json.RootElement.TryGetProperty("service", out JsonElement service) && !service.ValueKind.Equals(JsonValueKind.Null))
  342. {
  343. areaSc.service = service.ToObject<List<SchoolProductSumData>>().Count;//.Select(x => x.prodCode).ToList();
  344. }
  345. if (json.RootElement.TryGetProperty("hard", out JsonElement hard) && !hard.ValueKind.Equals(JsonValueKind.Null))
  346. {
  347. areaSc.hard = hard.ToObject<List<SchoolProductSumDataHard>>().Count;//.Select(x => x.prodCode).ToList();
  348. }
  349. }
  350. });
  351. return Ok(new { state = RespondCode.Ok, areaSchool });
  352. }
  353. /// <summary>
  354. /// 依据区域id查询该区域的顾问信息 //已对接
  355. /// </summary>
  356. /// <param name="jsonElement"></param>
  357. /// <returns></returns>
  358. [HttpPost("get-assists")]
  359. public async Task<IActionResult> GetAssists(JsonElement jsonElement)
  360. {
  361. if (!jsonElement.TryGetProperty("areaId", out JsonElement areaId)) return BadRequest();
  362. jsonElement.TryGetProperty("site", out JsonElement site);
  363. var cosmosClient = _azureCosmos.GetCosmosClient();
  364. var tableClient = _azureStorage.GetCloudTableClient();
  365. var blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public");
  366. if ($"{site}".Equals(BIConst.Global))
  367. {
  368. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  369. tableClient = _azureStorage.GetCloudTableClient(BIConst.Global);
  370. blobClient = _azureStorage.GetBlobContainerClient(containerName: "0-public", BIConst.Global);
  371. }
  372. var table = tableClient.GetTableReference("BIDDUserInfo");
  373. List<string> scIds = new();
  374. HashSet<string> tchIds = new();
  375. string scIdsSql = $"select value(c.id) from c where c.areaId='{areaId}'";
  376. await foreach (var itemId in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: scIdsSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base") }))
  377. {
  378. scIds.Add(itemId);
  379. }
  380. foreach (var scId in scIds)
  381. {
  382. string tchIdSql = $"select value(c.id) from c where array_contains(c.roles,'assist',true) and c.pk='Teacher'";
  383. await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<string>(queryText: tchIdSql, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Teacher-{scId}") }))
  384. {
  385. tchIds.Add(item);
  386. }
  387. }
  388. List<AreaAssist> areaAssists = new();
  389. List<string> noIds = new();
  390. foreach (var item in tchIds)
  391. {
  392. List<DingDingUserInfo> ddUsers = await table.QueryWhereString<DingDingUserInfo>($"PartitionKey eq '{_option.Location}' and tmdId eq '{item}'");
  393. if (ddUsers.Count > 0)
  394. {
  395. foreach (var dduser in ddUsers)
  396. {
  397. AreaAssist areaAssist = new()
  398. {
  399. userId = dduser.userId,
  400. unionId = dduser.unionId,
  401. name = dduser.name,
  402. mobile = dduser.mobile,
  403. avatar = dduser.avatar,
  404. tmdId = dduser.tmdId,
  405. tmdName = dduser.tmdName,
  406. tmdMobile = dduser.tmdMobile,
  407. picture = dduser.picture,
  408. roles = dduser.roles,
  409. schoolIds = dduser.schoolIds
  410. };
  411. areaAssists.Add(areaAssist);
  412. }
  413. }
  414. else { noIds.Add(item); }
  415. }
  416. return Ok(new { state = 200, areaAssists, noIds });
  417. }
  418. public record AreaAssist
  419. {
  420. public string userId { get; set; }
  421. public string unionId { get; set; }
  422. public string name { get; set; }
  423. public string mobile { get; set; }
  424. public string avatar { get; set; }
  425. public string tmdId { get; set; }
  426. public string tmdName { get; set; }
  427. public string tmdMobile { get; set; }
  428. public string picture { get; set; }
  429. public string roles { get; set; }
  430. public string schoolIds { get; set; }
  431. }
  432. /// <summary>
  433. /// 通过区域ID查询学校前端暂时
  434. /// </summary>
  435. public record AreaSchool
  436. {
  437. public string id{ get; set; }
  438. public string name{ get; set; }
  439. public string picture { get; set; }
  440. public int size { get; set; }
  441. public string areaId { get; set; }
  442. public int scale { get; set; }
  443. public int serial { get; set; }
  444. public int service { get; set; }
  445. public int hard { get; set; }
  446. }
  447. /// <summary>
  448. /// 已加入区域的学校
  449. /// </summary>
  450. public record JoinAreaSchool
  451. {
  452. public string id { get; set; }
  453. public string name { get; set; }
  454. public string schoolCode { get; set; }
  455. public string picture { get; set; }
  456. public string areaId{ get; set; }
  457. public string standard { get; set; }
  458. public List<string> period { get; set; }
  459. public string province { get; set; }
  460. public string city { get; set; }
  461. public string dist { get; set; }
  462. public List<SchoolArea> areas { get; set; } = new List<SchoolArea>();
  463. }
  464. }
  465. }