SchoolProduct.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Text;
  5. using System.Text.Json.Serialization;
  6. using TEAMModelOS.SDK.Context.Attributes.Azure;
  7. using TEAMModelOS.SDK.DI;
  8. namespace TEAMModelOS.SDK.Models
  9. {
  10. //產品購買紀錄
  11. public class SchoolProductCommon : CosmosEntity
  12. {
  13. public SchoolProductCommon()
  14. {
  15. pk = "Product";
  16. }
  17. public string dataType { get; set; }
  18. public string prodCode { get; set; }
  19. }
  20. //產品購買紀錄-序號
  21. public class SchoolProductSerial : SchoolProductCommon
  22. {
  23. public string serial { get; set; }
  24. public List<deviceBound> deviceBound { get; set; }
  25. public int clientQty { get; set; }
  26. public long regDate { get; set; }
  27. public long startDate { get; set; }
  28. public long endDate { get; set; }
  29. public int deviceMax { get; set; }
  30. public object aprule { get; set; }
  31. public string expireStatus { get; set; }
  32. public int status { get; set; }
  33. }
  34. //產品購買紀錄-服務
  35. public class SchoolProductService : SchoolProductCommon
  36. {
  37. public long startDate { get; set; }
  38. public long endDate { get; set; }
  39. public int number { get; set; }
  40. public string unit { get; set; }
  41. }
  42. //產品購買紀錄-硬體
  43. public class SchoolProductHard : SchoolProductCommon
  44. {
  45. public string model { get; set; }
  46. public string serial { get; set; }
  47. }
  48. //產品一覽
  49. public class SchoolProductSum
  50. {
  51. public SchoolProductSum()
  52. {
  53. pk = "ProductSum";
  54. code = "ProductSum";
  55. prodinfo = new List<SchoolProductSumProdInfo>();
  56. serial = new List<SchoolProductSumData>();
  57. service = new List<SchoolProductSumDataService>();
  58. hard = new List<SchoolProductSumDataHard>();
  59. }
  60. public string pk { get; set; }
  61. public string code { get; set; }
  62. public string id { get; set; }
  63. public List<SchoolProductSumProdInfo> prodinfo { get; set; }
  64. public List<SchoolProductSumData> serial { get; set; }
  65. public List<SchoolProductSumDataService> service { get; set; }
  66. public List<SchoolProductSumDataHard> hard { get; set; }
  67. //public Aclassone aclassone { get; set; } //是否獨立出來,未定
  68. }
  69. public class SchoolProductSumProdInfo
  70. {
  71. public string prodCode { get; set; }
  72. public string prodName { get; set; }
  73. public string dataType { get; set; }
  74. public ServiceType serviceType { get; set; }
  75. }
  76. public enum ServiceType
  77. {
  78. number = 0,
  79. module = 1,
  80. space = 2
  81. }
  82. //產品一覽 產品內容 基本項
  83. public class SchoolProductSumData
  84. {
  85. public SchoolProductSumData()
  86. {
  87. ids = new List<string>();
  88. }
  89. public string prodCode { get; set; }
  90. public List<string> ids { get; set; }
  91. public int avaliable { get; set; }
  92. }
  93. //產品一覽 產品內容 服務
  94. public class SchoolProductSumDataService : SchoolProductSumData
  95. {
  96. public long startDate { get; set; }
  97. public long endDate { get; set; }
  98. }
  99. //產品一覽 產品內容 硬體
  100. public class SchoolProductSumDataHard : SchoolProductSumData
  101. {
  102. public string model { get; set; }
  103. }
  104. //服務各產品資訊購買紀錄(前端用)
  105. public class SchoolProductOrder
  106. {
  107. public string prodCode { get; set; }
  108. public List<SchoolProductOrderList> order { get; set; }
  109. public int avaliable { get; set; }
  110. public long avaliableStartDate { get; set; }
  111. public long avaliableEndDate { get; set; }
  112. }
  113. //產品購買紀錄(前端顯示用)
  114. public class SchoolProductOrderList
  115. {
  116. public string id { get; set; }
  117. public long startDate { get; set; }
  118. public long endDate { get; set; }
  119. public int number { get; set; }
  120. public string unit { get; set; }
  121. }
  122. //序號資訊(含deviceId、classId、OS等硬體資訊)
  123. public class SerialInfoBaseWithdeviceBoundExt : SchoolProductSerial
  124. {
  125. public new List<deviceBoundExt> deviceBound { get; set; }
  126. }
  127. //服務授權期限(主週期資訊) ※code='Product' code='Product-{SchoolID}' dataType='servicePeriod'
  128. public class SchoolProductServicePeriod : SchoolProductCommon
  129. {
  130. public int type { get; set; } //授權週期類型 0:銷售 1:試用
  131. public long startDate { get; set; }
  132. public long endDate { get; set; }
  133. public int number { get; set; }
  134. public string unit { get; set; }
  135. }
  136. /////////////////////////////////////////////////////////
  137. public class SchoolProduct : CosmosEntity
  138. {
  139. public SchoolProduct()
  140. {
  141. pk = "Base";
  142. }
  143. public List<SerialInfoBaseWithdeviceBound> serial { get; set; }
  144. public ProductService service { get; set; }
  145. public List<ProductHard> hard { get; set; }
  146. public Aclassone aclassone { get; set; }
  147. }
  148. public class Aclassone
  149. {
  150. public List<string> ids { get; set; } //固定分配的學生ID
  151. public List<string> outids { get; set; } //過期被回收的學生ID(無法使用,待數量購足後回復移至ids)
  152. public int total { get; set; }
  153. public int used { get; set; }
  154. }
  155. public class SerialInfoBase
  156. {
  157. public string id { get; set; }
  158. public string serial { get; set; }
  159. public string prodCode { get; set; }
  160. public int clientQty { get; set; }
  161. public long regDate { get; set; }
  162. public long startDate { get; set; }
  163. public long endDate { get; set; }
  164. public int deviceMax { get; set; }
  165. public object aprule { get; set; }
  166. public string expireStatus { get; set; }
  167. public int status { get; set; }
  168. }
  169. public class SerialInfoBaseWithdeviceBound : SerialInfoBase
  170. {
  171. public List<deviceBound> deviceBound { get; set; }
  172. }
  173. //public class SerialInfoBaseWithdeviceBoundExt : SerialInfoBase
  174. //{
  175. // public List<deviceBoundExt> deviceBound { get; set; }
  176. //}
  177. public class deviceBound
  178. {
  179. public string uuid { get; set; }
  180. public string uuid2 { get; set; }
  181. public string deviceId { get; set; }
  182. public string classId { get; set; }
  183. }
  184. public class deviceBoundRich : deviceBound
  185. {
  186. public string serial { get; set; }
  187. }
  188. public class deviceForCoreService
  189. {
  190. public string uuid1 { get; set; }
  191. public string uuid2 { get; set; }
  192. public string device_id { get; set; }
  193. public string class_id { get; set; }
  194. public string sn { get; set; }
  195. }
  196. public class deviceFromCoreService
  197. {
  198. public string uuid1 { get; set; }
  199. public string uuid2 { get; set; }
  200. public string device_id { get; set; }
  201. public string sn { get; set; }
  202. public string os { get; set; }
  203. public string os_ver { get; set; }
  204. public string local_ip { get; set; }
  205. public string product_ver { get; set; }
  206. public string cpu { get; set; }
  207. public string pc_name { get; set; }
  208. }
  209. public class deviceBoundExt : deviceBound
  210. {
  211. public string ip { get; set; }
  212. public string pcname { get; set; }
  213. public string os { get; set; }
  214. public string cpu { get; set; }
  215. public string osver { get; set; }
  216. }
  217. public class ProductService
  218. {
  219. public List<ServiceMainPeriod> mainperiod { get; set; }
  220. public List<ServicePeriod> period { get; set; }
  221. public List<ServiceProduct> product { get; set; }
  222. }
  223. public class ServiceMainPeriod
  224. {
  225. public string mainPeriodId { get; set; }
  226. public string mainPeriodtype { get; set; }
  227. public long startDate { get; set; }
  228. public long endDate { get; set; }
  229. public bool active { get; set; }
  230. }
  231. public class ServicePeriod
  232. {
  233. public string mainPeriodId { get; set; }
  234. public string periodId { get; set; }
  235. public long startDate { get; set; }
  236. public long endDate { get; set; }
  237. public bool active { get; set; }
  238. }
  239. public class ServiceProduct
  240. {
  241. public string prodCode { get; set; }
  242. public bool noperiod { get; set; }
  243. public string serviceType { get; set; }
  244. public List<ServiceProductAuth> auth { get; set; }
  245. public int avaliable { get; set; }
  246. }
  247. public class ServiceProductResult
  248. {
  249. public string prodCode { get; set; }
  250. public bool noperiod { get; set; }
  251. public string serviceType { get; set; }
  252. public long startDate { get; set; }
  253. public long endDate { get; set; }
  254. public int avaliable { get; set; }
  255. }
  256. public class ServiceProductAclassoneResult : ServiceProductResult
  257. {
  258. public int staUsed { get; set; }
  259. public int dynUsed { get; set; }
  260. }
  261. public class ServiceProductAuth
  262. {
  263. public string orderId { get; set; }
  264. public string periodId { get; set; }
  265. public int number { get; set; }
  266. public string unit { get; set; }
  267. }
  268. public class ServiceProductAuthHistoryBasic
  269. {
  270. public string orderId { get; set; }
  271. public long orderDate { get; set; }
  272. public int number { get; set; }
  273. public string unit { get; set; }
  274. }
  275. public class ServiceProductAuthHistory : ServiceProductAuthHistoryBasic
  276. {
  277. public List<string> periodIdList { get; set; }
  278. }
  279. public class ServiceProductAuthHistoryStartEnd : ServiceProductAuthHistoryBasic
  280. {
  281. public long startDate { get; set; }
  282. public long endDate { get; set; }
  283. }
  284. public class ProductHard
  285. {
  286. public string prodCode { get; set; }
  287. public string model { get; set; }
  288. public string serial { get; set; }
  289. }
  290. public class CoreUuid
  291. {
  292. public string serial { get; set; }
  293. public string os { get; set; }
  294. public string ip { get; set; }
  295. public string uuid { get; set; }
  296. public string uuid2 { get; set; }
  297. public string deviceId { get; set; }
  298. public string pcname { get; set; }
  299. public string cpu { get; set; }
  300. public int ram { get; set; }
  301. }
  302. public class periodZone
  303. {
  304. public long startDate { get; set; }
  305. public long endDate { get; set; }
  306. }
  307. }