OnLineController.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. using Azure.Cosmos;
  2. using Azure.Storage.Blobs;
  3. using Azure.Storage.Blobs.Models;
  4. using Microsoft.AspNetCore.Http;
  5. using Microsoft.AspNetCore.Mvc;
  6. using StackExchange.Redis;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Text.Json;
  13. using System.Threading.Tasks;
  14. using TEAMModelBI.Tool;
  15. using TEAMModelOS.SDK.Context.BI;
  16. using TEAMModelOS.SDK.Context.Constant;
  17. using TEAMModelOS.SDK.DI;
  18. using TEAMModelOS.SDK.Extension;
  19. using TEAMModelOS.SDK.Models;
  20. using TEAMModelOS.SDK.Models.Cosmos.BI;
  21. using TEAMModelOS.SDK.Models.Table;
  22. namespace TEAMModelBI.Controllers.BIHome
  23. {
  24. [Route("online")]
  25. [ApiController]
  26. public class OnLineController : ControllerBase
  27. {
  28. private readonly AzureCosmosFactory _azureCosmos;
  29. private readonly AzureStorageFactory _azureStorage;
  30. private readonly AzureRedisFactory _azureRedis;
  31. public OnLineController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis)
  32. {
  33. _azureCosmos = azureCosmos;
  34. _azureStorage = azureStorage;
  35. _azureRedis = azureRedis;
  36. }
  37. /// <summary>
  38. /// 总数统计 //已对接
  39. /// </summary>
  40. /// <returns></returns>
  41. [ProducesDefaultResponseType]
  42. [HttpPost("get-count")]
  43. public async Task<IActionResult> GetCount(JsonElement jsonElement)
  44. {
  45. var cosmosClient = _azureCosmos.GetCosmosClient();
  46. var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
  47. var blobClient = _azureStorage.GetBlobContainerClient($"0-public");
  48. jsonElement.TryGetProperty("site", out JsonElement site);
  49. if ($"{site}".Equals(BIConst.Global))
  50. {
  51. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  52. table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
  53. blobClient = _azureStorage.GetBlobContainerClient($"0-public", BIConst.Global);
  54. }
  55. DateTimeOffset dateTime = DateTimeOffset.UtcNow;
  56. string cDay = dateTime.ToString("yyyyMMdd");
  57. var (daySt, dayEt) = TimeHelper.GetStartOrEnd(dateTime); //今天开始时间 13位
  58. var (daySf, dayEf) = TimeHelper.GetStartOrEnd(dateTime, dateLenth: false); //今天开始时间 10位
  59. var (lastDayS, lastdayE) = TimeHelper.GetStartOrEnd(dateTime.AddDays(-1)); //昨天开始时间
  60. var near7S = dateTime.AddDays(-7).ToUnixTimeMilliseconds(); //前七天的开始时间
  61. var near7E = dateTime.ToUnixTimeMilliseconds(); //当前结束时间
  62. long hour1 = dateTime.AddHours(-1).ToUnixTimeMilliseconds(); //一小时前时间戳
  63. int areaCnt = 0; //学区总数
  64. int scCnt = 0; //学校总数
  65. int tchCnt = 0; //教师总数
  66. int stuCnt = 0; //学生总数
  67. int apiCnt = 0; //当天接口访问总量
  68. int onStuCnt = 0; //学生在线人数
  69. int onTchCnt = 0; //教师在线人数
  70. int todayScCnt = 0; //今日新增学校数
  71. int todayTchCnt = 0; //今日新增教师
  72. int todayStuCnt = 0; //今日新增学生数
  73. string currentSql = "select value(count(c.id)) from c";
  74. areaCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Normal", currentSql, "Base-Area");
  75. scCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", currentSql, "Base");
  76. tchCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", currentSql, "Base");
  77. stuCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Student", "select value(count(c.id)) from c where c.pk='Base'");
  78. string addSql = $"select value(count(c.id)) from c where c.createTime >={daySt} and c.createTime <= {dayEt}";
  79. todayScCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", addSql, "Base");
  80. todayTchCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", addSql, "Base");
  81. todayStuCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Student", addSql, "Base");
  82. string onStuSql = $"select value(count(c.id)) from c join t in c.loginInfos where array_length(c.loginInfos) > 0 and t.expire > {hour1} and c.pk='Base'";
  83. onTchCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", onStuSql);
  84. onStuCnt = await CommonFind.GetSqlValueCount(cosmosClient, "Student", onStuSql);
  85. //接口访问量
  86. List<RecCnt> recCnts = new();
  87. await foreach (BlobItem blobItem in blobClient.GetBlobsAsync(BlobTraits.None, BlobStates.None, $"visitCnt/{cDay}"))
  88. {
  89. BlobClient tempBlobClient = blobClient.GetBlobClient(blobItem.Name);
  90. if (await tempBlobClient.ExistsAsync())
  91. {
  92. using (var meomoryStream = new MemoryStream())
  93. {
  94. var response = blobClient.GetBlobClient($"{blobItem.Name}").DownloadTo(meomoryStream);
  95. RecCnt recCnt = Encoding.UTF8.GetString(meomoryStream.ToArray()).ToString().ToObject<RecCnt>();
  96. recCnts.Add(recCnt);
  97. }
  98. }
  99. }
  100. apiCnt = recCnts.Select(x => x.apiCnt.Select(s => s.count).Sum()).Sum();
  101. return Ok(new { state = 200, areaCnt, scCnt, tchCnt, stuCnt, todayScCnt, todayTchCnt, todayStuCnt, onStuCnt, onTchCnt, apiCnt });
  102. }
  103. /// <summary>
  104. /// 在线人数趋势图 //已对接
  105. /// </summary>
  106. /// <returns></returns>
  107. [ProducesDefaultResponseType]
  108. [HttpPost("get-trend")]
  109. public async Task<IActionResult> GetTrend(JsonElement jsonElement)
  110. {
  111. var table = _azureStorage.GetCloudTableClient().GetTableReference("IESLogin");
  112. var redisClinet = _azureRedis.GetRedisClient(8);
  113. jsonElement.TryGetProperty("site", out JsonElement site);
  114. if ($"{site}".Equals(BIConst.Global))
  115. {
  116. table = _azureStorage.GetCloudTableClient(BIConst.Global).GetTableReference("IESLogin");
  117. redisClinet = _azureRedis.GetRedisClient(dbnum: 8, name: BIConst.Global);
  118. }
  119. DateTimeOffset dateTime = DateTimeOffset.UtcNow;
  120. var (daySt, dayEt) = TimeHelper.GetStartOrEnd(dateTime); //今天开始时间 13位
  121. var (strDaySt, strDayEt) = TimeHelper.GetUnixToDate(daySt, dayEt, "yyyyMMddHH");
  122. var dateDay = dateTime.ToString("yyyyMMdd"); //获取当天的日期
  123. //daySt.ToString("yyyyMMddHH");
  124. Dictionary<long, int> allDays = new(); //所有在线人数
  125. Dictionary<long, int> tchDays = new(); //教师在线人数
  126. Dictionary<long, int> stuDays = new(); //学生在线人数
  127. Dictionary<long, int> tmdDays = new(); //醍摩豆账户学生
  128. SortedSetEntry[] tchDay = redisClinet.SortedSetRangeByScoreWithScores($"Login:IES:teacher:{dateDay}");
  129. if (tchDay.Length > 0)
  130. {
  131. foreach (var item in tchDay)
  132. {
  133. int val = ((int)item.Score);
  134. int key = ((int)item.Element);
  135. //var utcTo = new DateTimeOffset(new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, key, 0, 0)).Hour;
  136. //var hour = int.Parse(DateTime.SpecifyKind(Convert.ToDateTime($"{dateTime.Year}/{dateTime.Month}/{ dateTime.Day} {key}:00:00"), DateTimeKind.Utc).ToLocalTime().ToString("HH"));
  137. tchDays.Add(key, val);
  138. if (allDays.ContainsKey(key))
  139. allDays[key] = (allDays[key] + val);
  140. else
  141. allDays.Add(key, val);
  142. }
  143. }
  144. else
  145. {
  146. string tableSqlTch = $"PartitionKey eq 'HourLogin' and RowKey ge '{strDaySt}' and RowKey le '{strDayEt}'";
  147. List<HourLogin> hourLoginsTch = await table.QueryWhereString<HourLogin>(tableSqlTch);
  148. if (hourLoginsTch.Count > 0)
  149. {
  150. foreach (var item in hourLoginsTch)
  151. {
  152. await redisClinet.SortedSetIncrementAsync($"Login:IES:teacher:{dateDay}", $"{item.Hour}", item.Teacher);//存一天24小时
  153. tchDays.Add(item.Hour, item.Teacher);
  154. if (allDays.ContainsKey(item.Hour))
  155. allDays[item.Hour] = (allDays[item.Hour] + item.Teacher);
  156. else
  157. allDays.Add(item.Hour, item.Teacher);
  158. }
  159. }
  160. }
  161. SortedSetEntry[] stuDay = redisClinet.SortedSetRangeByScoreWithScores($"Login:IES:student:{dateDay}");
  162. if (stuDay.Length > 0)
  163. {
  164. foreach (var item in stuDay)
  165. {
  166. int val = (int)item.Score;
  167. int key = (int)item.Element;
  168. stuDays.Add(key, val);
  169. if (allDays.ContainsKey(key))
  170. allDays[key] = (allDays[key] + val);
  171. else
  172. allDays.Add(key, val);
  173. }
  174. }
  175. else
  176. {
  177. string tableSqlStu = $"PartitionKey eq 'HourLogin' and RowKey ge '{strDaySt}' and RowKey le '{strDayEt}'";
  178. List<HourLogin> hourLoginsStu = await table.QueryWhereString<HourLogin>(tableSqlStu);
  179. //var hourStuCnt = hourLoginsStu.GroupBy(x => x.Hour).Select(k => new { key = int.Parse(k.Key.ToString().Substring(8, 2)), value = k.Count() }).ToList();
  180. if (hourLoginsStu.Count > 0)
  181. {
  182. foreach (var item in hourLoginsStu)
  183. {
  184. await redisClinet.SortedSetIncrementAsync($"Login:IES:student:{dateDay}", $"{item.Hour}", item.Student);//存一天24小时
  185. stuDays.Add(item.Hour, item.Student);
  186. if (allDays.ContainsKey(item.Hour))
  187. allDays[item.Hour] = (allDays[item.Hour] + item.Student);
  188. else
  189. allDays.Add(item.Hour, item.Student);
  190. }
  191. }
  192. }
  193. SortedSetEntry[] tmdDay = redisClinet.SortedSetRangeByScoreWithScores($"Login:IES:tmduser:{dateDay}");
  194. if (tmdDay.Length > 0)
  195. {
  196. foreach (var item in tmdDay)
  197. {
  198. int val = (int)item.Score;
  199. int key = (int)item.Element;
  200. tmdDays.Add(key, val);
  201. if (allDays.ContainsKey(key))
  202. allDays[key] = (allDays[key] + val);
  203. else
  204. allDays.Add(key, val);
  205. }
  206. }
  207. else
  208. {
  209. string tableSqlTmd = $"PartitionKey eq 'HourLogin' and RowKey ge '{strDaySt}' and RowKey le '{strDayEt}'";
  210. List<HourLogin> hourLoginsTmd = await table.QueryWhereString<HourLogin>(tableSqlTmd);
  211. //var hourTmdCnt = hourLoginsTmd.GroupBy(x => x.Hour).Select(k => new { key = int.Parse(k.Key.ToString().Substring(8, 2)), value = k.Count() }).ToList();
  212. if (hourLoginsTmd.Count > 0)
  213. {
  214. foreach (var item in hourLoginsTmd)
  215. {
  216. await redisClinet.SortedSetIncrementAsync($"Login:IES:tmduser:{dateDay}", $"{item.Hour}", item.TmdUser);//存一天24小时
  217. var utcTo = new DateTimeOffset(new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, item.Hour, 00, 00)).Hour;
  218. tmdDays.Add(utcTo, item.TmdUser);
  219. if (allDays.ContainsKey(utcTo))
  220. allDays[utcTo] = (allDays[utcTo] + item.TmdUser);
  221. else
  222. allDays.Add(utcTo, item.TmdUser);
  223. }
  224. }
  225. }
  226. return Ok(new { state = 200,allDays = allDays.OrderBy(o=>o.Key).ToList(), tchDays=tchDays.OrderBy(o => o.Key).ToList(), stuDays= stuDays.OrderBy(o => o.Key).ToList(), tmdDays= tmdDays.OrderBy(o => o.Key).ToList() });
  227. }
  228. /// <summary>
  229. /// 课例趋势图 //已对接
  230. /// </summary>
  231. /// <returns></returns>
  232. [ProducesDefaultResponseType]
  233. [HttpPost("get-lessontrend")]
  234. public async Task<IActionResult> GetLessonTrend(JsonElement jsonElement)
  235. {
  236. DateTimeOffset dateTime = DateTimeOffset.UtcNow;
  237. var cosmosClient = _azureCosmos.GetCosmosClient();
  238. jsonElement.TryGetProperty("site", out JsonElement site);
  239. if ($"{site}".Equals(BIConst.Global))
  240. {
  241. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  242. }
  243. int year = dateTime.Year; //当前年
  244. int month = dateTime.Month; //当前月
  245. int day = dateTime.Day; //当天
  246. var lestDate = dateTime.AddDays(-1); //昨天
  247. int hour = int.Parse(DateTime.SpecifyKind(Convert.ToDateTime($"{dateTime.Year}/{dateTime.Month}/{ dateTime.Day} {dateTime.Hour}:00:00"), DateTimeKind.Utc).ToLocalTime().ToString("HH")); //当前小时
  248. var (daySt, dayEt) = TimeHelper.GetStartOrEnd(dateTime); //今天开始时间 13位
  249. var (lastDayS, lastdayE) = TimeHelper.GetStartOrEnd(lestDate); //昨天开始时间
  250. var (monthDayS, monthDayE) = TimeHelper.GetStartOrEnd(lestDate, "monthDay"); //本月开始/结束时间
  251. var (yearS, yearE) = TimeHelper.GetStartOrEnd(lestDate, "yearMonth"); //本月开始/结束时间
  252. Dictionary<int, int> sdOpenLesn = new(); //今日开课
  253. Dictionary<int, int> sdUpdLesn = new(); //今日上传课例
  254. Dictionary<int, int> ydOpenLesn = new(); //昨日开课
  255. Dictionary<int, int> ydUpdLesn = new(); //昨日上传课例
  256. Dictionary<int, int> mthOpenLesn = new(); //本月开课
  257. Dictionary<int, int> mthUpdLesn = new(); //本月上传课例
  258. Dictionary<int, int> yrOpenLesn = new(); //本年开课
  259. Dictionary<int, int> yrUpdLesn = new(); //本年上传课例
  260. Dictionary<int, int> allOpenLesn = new(); //所有年开课
  261. Dictionary<int, int> allUpdLesn = new(); //所有年上传课例
  262. List<RecLesn> yearLeson = new();
  263. List<RecLesn> allLess = new();
  264. string allSql = "select c.id,c.name,c.code,c.school,c.scope,c.startTime from c where c.pk='LessonRecord'";
  265. //所有的课例
  266. allLess = await CommonFind.GetObject<RecLesn>(cosmosClient, new List<string>() { "School", "Teacher" }, allSql);
  267. if (allLess.Count > 0)
  268. {
  269. for (int i = 0; i < 24; i++)
  270. {
  271. if (hour >= i)
  272. {
  273. DateTimeOffset timeHour = new DateTime(year, month, day, i, 0, 0);
  274. var (hourS, hourE) = TimeHelper.GetStartOrEnd(timeHour, type: "hour");
  275. var openLesn1 = allLess.Where(item => item.startTime >= hourS && item.startTime <= hourE && item.upload == 0).Count();
  276. var openLesn = allLess.Where(item => item.startTime >= hourS && item.startTime <= hourE && item.upload == 0).ToList();
  277. sdOpenLesn.Add(i, openLesn.Count());
  278. var UpdLesn = allLess.Where(item => item.startTime >= hourS && item.startTime <= hourE && item.upload == 1).ToList();
  279. sdUpdLesn.Add(i, UpdLesn.Count());
  280. }
  281. DateTimeOffset yesterday = new DateTime(lestDate.Year, lestDate.Month, lestDate.Day, i, 0, 0);
  282. var (yHourS, yHourE) = TimeHelper.GetStartOrEnd(yesterday, type: "hour");
  283. var yOpenLesn = allLess.Where(item => item.startTime >= yHourS && item.startTime <= yHourE && item.upload == 0).ToList();
  284. ydOpenLesn.Add(i, yOpenLesn.Count);
  285. var yUpdLesn = allLess.Where(item => item.startTime >= yHourS && item.startTime <= yHourE && item.upload == 1).ToList();
  286. ydUpdLesn.Add(i, yUpdLesn.Count);
  287. }
  288. for (int i = 1; i <= day; i++)
  289. {
  290. DateTimeOffset timeDay = new DateTime(year, month, i, 0, 0, 0);
  291. var (dayS, dayE) = TimeHelper.GetStartOrEnd(timeDay); //本月开始/结束时间
  292. var openLesn = allLess.Where(item => item.startTime >= dayS && item.startTime <= dayE && item.upload == 0).ToList();
  293. mthOpenLesn.Add(i, openLesn.Count());
  294. var UpdLesn = allLess.Where(item => item.startTime >= dayS && item.startTime <= dayE && item.upload == 1).ToList();
  295. mthUpdLesn.Add(i, UpdLesn.Count());
  296. }
  297. for (int i = 1; i <= month; i++)
  298. {
  299. DateTimeOffset timeDay = new DateTime(year, i, day, 0, 0, 0);
  300. var (monthS, monthE) = TimeHelper.GetStartOrEnd(timeDay, "month"); //本月开始/结束时间
  301. var openLesn = allLess.Where(item => item.startTime >= monthS && item.startTime <= monthE && item.upload == 0).ToList();
  302. yrOpenLesn.Add(i, openLesn.Count());
  303. var UpdLesn = allLess.Where(item => item.startTime >= monthS && item.startTime <= monthE && item.upload == 1).ToList();
  304. yrUpdLesn.Add(i, UpdLesn.Count());
  305. }
  306. yearLeson = allLess.Select(item => { item.startTime = TimeHelper.GetDateTime(item.startTime).Year; return item; }).ToList();
  307. List<RecLesn> oRecLess = yearLeson.Where(o => o.upload == 0).ToList();
  308. var allo = oRecLess.GroupBy(g => g.startTime).Select(s => new { key = s.Key, value = s.Count() }).ToList();
  309. if (allo.Count > 0)
  310. allo.ForEach(a => { allOpenLesn.Add((int)a.key, a.value); });
  311. List<RecLesn> uRecLesns = yearLeson.Where(o => o.upload == 1).ToList();
  312. var allu = uRecLesns.GroupBy(g => g.startTime).Select(s => new { key = s.Key, value = s.Count() }).ToList();
  313. if (allu.Count > 0)
  314. allu.ForEach(a => { allUpdLesn.Add((int)a.key, a.value); });
  315. }
  316. return Ok(new
  317. {
  318. state = RespondCode.Ok,
  319. hours = new { sdOpenLesn = sdOpenLesn.ToList(), sdUpdLesn = sdUpdLesn.ToList(), ydOpenLesn = ydOpenLesn.ToList(), ydUpdLesn = ydUpdLesn.ToList() },
  320. days = new { sdOpenLesn = mthOpenLesn.ToList(), sdUpdLesn = mthUpdLesn.ToList() },
  321. months = new { sdOpenLesn = yrOpenLesn.ToList(), sdUpdLesn = yrUpdLesn.ToList() },
  322. years = new { sdOpenLesn = allOpenLesn.ToList(), sdUpdLesn = allUpdLesn.ToList() }
  323. }) ;
  324. }
  325. /// <summary>
  326. /// 版本数量占比 //已对接
  327. /// </summary>
  328. /// <returns></returns>
  329. [ProducesDefaultResponseType]
  330. [HttpPost("get-edition")]
  331. public async Task<IActionResult> GetEdition(JsonElement jsonElement)
  332. {
  333. var cosmosClient = _azureCosmos.GetCosmosClient();
  334. jsonElement.TryGetProperty("site", out JsonElement site);
  335. if ($"{site}".Equals(BIConst.Global))
  336. {
  337. cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
  338. }
  339. int beCnt = 0; //基础班
  340. int seCnt = 0; //标准版
  341. int peCnt = 0; //专业版
  342. List<RecScEd> scEdCnt = new();
  343. var ScSql = $"select c.id,c.name,c.size,c.scale from c";
  344. await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "School").GetItemQueryIterator<RecScEd>(queryText: ScSql, requestOptions:new QueryRequestOptions() { PartitionKey= new PartitionKey("Base")}))
  345. {
  346. scEdCnt.Add(item);
  347. }
  348. scEdCnt.ForEach(async scProCnt =>
  349. {
  350. var response = await cosmosClient.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(scProCnt.id, new PartitionKey("ProductSum"));
  351. if (response.Status == 200)
  352. {
  353. using var json = await JsonDocument.ParseAsync(response.ContentStream);
  354. SchoolProductSum ScProductSum = json.ToObject<SchoolProductSum>();
  355. //scProCnt.serial = ScProductSum.serial.Count();
  356. //scProCnt.service = ScProductSum.service.Count();
  357. //scProCnt.hard = ScProductSum.hard.Count();
  358. int pSeriCnt = ScProductSum.serial.Count();
  359. int pServCnt = ScProductSum.service.Count();
  360. int pHardCnt = ScProductSum.hard.Count();
  361. scProCnt.serial = pSeriCnt;
  362. scProCnt.service = pServCnt;
  363. scProCnt.hard = pHardCnt;
  364. if (scProCnt.scale >= 500 && (pSeriCnt > 0 || pServCnt > 0 || pHardCnt > 0)) peCnt += 1;
  365. }
  366. if (scProCnt.scale >= 500 && scProCnt.serial == 0 && scProCnt.service == 0 && scProCnt.hard == 0) seCnt += 1;
  367. if (scProCnt.scale == 0) beCnt += 1;
  368. });
  369. return Ok(new { state = 200, beCnt, seCnt, peCnt, scEdCnt });
  370. }
  371. /// <summary>
  372. /// 记录学校版本信息
  373. /// </summary>
  374. public record RecScEd
  375. {
  376. public string id { get; set; }
  377. public string name { get; set; }
  378. public int size { get; set; }
  379. public int scale { get; set; }
  380. public int serial { get; set; } = 0;//软体
  381. public int service { get; set; } = 0; //服务
  382. public int hard { get; set; } = 0; //硬体
  383. }
  384. /// <summary>
  385. /// 记录课例
  386. /// </summary>
  387. public record RecLesn
  388. {
  389. public string id { get; set; }
  390. public string name { get; set; }
  391. public string code { get; set; }
  392. public string school { get; set; }
  393. public string scope{get;set;}
  394. public long startTime { get; set; }
  395. public int upload { get; set; }
  396. }
  397. }
  398. }