SchoolProduct.cs 11 KB

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