OnLineController.cs 22 KB

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