device.m.dart 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. import 'aIDiagnosis.m.dart';
  2. import 'connect.m.dart';
  3. import 'authentication.m.dart';
  4. import 'package:fis_common/json_convert.dart';
  5. class UploadDeviceDTO extends BaseDTO{
  6. String? serialNumber;
  7. String? deviceModel;
  8. String? deviceType;
  9. String? deviceSoftwareVersion;
  10. String? sDKSoftwareVersion;
  11. UploadDeviceDTO({
  12. this.serialNumber,
  13. this.deviceModel,
  14. this.deviceType,
  15. this.deviceSoftwareVersion,
  16. this.sDKSoftwareVersion,
  17. DateTime? createTime,
  18. DateTime? updateTime,
  19. }) : super(
  20. createTime: createTime,
  21. updateTime: updateTime,
  22. );
  23. factory UploadDeviceDTO.fromJson(Map<String, dynamic> map) {
  24. return UploadDeviceDTO(
  25. serialNumber: map['SerialNumber'],
  26. deviceModel: map['DeviceModel'],
  27. deviceType: map['DeviceType'],
  28. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  29. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  30. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  31. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  32. );
  33. }
  34. Map<String, dynamic> toJson() {
  35. final map = super.toJson();
  36. if(serialNumber != null)
  37. map['SerialNumber'] = serialNumber;
  38. if(deviceModel != null)
  39. map['DeviceModel'] = deviceModel;
  40. if(deviceType != null)
  41. map['DeviceType'] = deviceType;
  42. if(deviceSoftwareVersion != null)
  43. map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
  44. if(sDKSoftwareVersion != null)
  45. map['SDKSoftwareVersion'] = sDKSoftwareVersion;
  46. return map;
  47. }
  48. }
  49. class CreateDeviceRequest extends UploadDeviceDTO{
  50. CreateDeviceRequest({
  51. String? serialNumber,
  52. String? deviceModel,
  53. String? deviceType,
  54. String? deviceSoftwareVersion,
  55. String? sDKSoftwareVersion,
  56. DateTime? createTime,
  57. DateTime? updateTime,
  58. }) : super(
  59. serialNumber: serialNumber,
  60. deviceModel: deviceModel,
  61. deviceType: deviceType,
  62. deviceSoftwareVersion: deviceSoftwareVersion,
  63. sDKSoftwareVersion: sDKSoftwareVersion,
  64. createTime: createTime,
  65. updateTime: updateTime,
  66. );
  67. factory CreateDeviceRequest.fromJson(Map<String, dynamic> map) {
  68. return CreateDeviceRequest(
  69. serialNumber: map['SerialNumber'],
  70. deviceModel: map['DeviceModel'],
  71. deviceType: map['DeviceType'],
  72. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  73. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  74. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  75. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  76. );
  77. }
  78. Map<String, dynamic> toJson() {
  79. final map = super.toJson();
  80. return map;
  81. }
  82. }
  83. class DeviceExtendInfoDTO extends DeviceInfoDTO{
  84. String? organizationName;
  85. String? departmentName;
  86. bool isOnline;
  87. String? organizationDirectorCode;
  88. String? organizationDirectorUserName;
  89. String? organizationDirectorFullName;
  90. DeviceExtendInfoDTO({
  91. this.organizationName,
  92. this.departmentName,
  93. this.isOnline = false,
  94. this.organizationDirectorCode,
  95. this.organizationDirectorUserName,
  96. this.organizationDirectorFullName,
  97. String? deviceCode,
  98. String? serialNumber,
  99. String? password,
  100. String? name,
  101. String? description,
  102. String? deviceModel,
  103. String? deviceType,
  104. String? headPicUrl,
  105. String? deviceSoftwareVersion,
  106. String? sDKSoftwareVersion,
  107. String? organizationCode,
  108. String? departmentCode,
  109. String? shortCode,
  110. bool isAutoShared = false,
  111. DateTime? lastLoginTime,
  112. String? systemVersion,
  113. String? cPUModel,
  114. String? systemLanguage,
  115. DateTime? createTime,
  116. DateTime? updateTime,
  117. }) : super(
  118. deviceCode: deviceCode,
  119. serialNumber: serialNumber,
  120. password: password,
  121. name: name,
  122. description: description,
  123. deviceModel: deviceModel,
  124. deviceType: deviceType,
  125. headPicUrl: headPicUrl,
  126. deviceSoftwareVersion: deviceSoftwareVersion,
  127. sDKSoftwareVersion: sDKSoftwareVersion,
  128. organizationCode: organizationCode,
  129. departmentCode: departmentCode,
  130. shortCode: shortCode,
  131. isAutoShared: isAutoShared,
  132. lastLoginTime: lastLoginTime,
  133. systemVersion: systemVersion,
  134. cPUModel: cPUModel,
  135. systemLanguage: systemLanguage,
  136. createTime: createTime,
  137. updateTime: updateTime,
  138. );
  139. factory DeviceExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  140. return DeviceExtendInfoDTO(
  141. organizationName: map['OrganizationName'],
  142. departmentName: map['DepartmentName'],
  143. isOnline: map['IsOnline'],
  144. organizationDirectorCode: map['OrganizationDirectorCode'],
  145. organizationDirectorUserName: map['OrganizationDirectorUserName'],
  146. organizationDirectorFullName: map['OrganizationDirectorFullName'],
  147. deviceCode: map['DeviceCode'],
  148. serialNumber: map['SerialNumber'],
  149. password: map['Password'],
  150. name: map['Name'],
  151. description: map['Description'],
  152. deviceModel: map['DeviceModel'],
  153. deviceType: map['DeviceType'],
  154. headPicUrl: map['HeadPicUrl'],
  155. deviceSoftwareVersion: map['DeviceSoftwareVersion'],
  156. sDKSoftwareVersion: map['SDKSoftwareVersion'],
  157. organizationCode: map['OrganizationCode'],
  158. departmentCode: map['DepartmentCode'],
  159. shortCode: map['ShortCode'],
  160. isAutoShared: map['IsAutoShared'],
  161. lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
  162. systemVersion: map['SystemVersion'],
  163. cPUModel: map['CPUModel'],
  164. systemLanguage: map['SystemLanguage'],
  165. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  166. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  167. );
  168. }
  169. Map<String, dynamic> toJson() {
  170. final map = super.toJson();
  171. if(organizationName != null)
  172. map['OrganizationName'] = organizationName;
  173. if(departmentName != null)
  174. map['DepartmentName'] = departmentName;
  175. map['IsOnline'] = isOnline;
  176. if(organizationDirectorCode != null)
  177. map['OrganizationDirectorCode'] = organizationDirectorCode;
  178. if(organizationDirectorUserName != null)
  179. map['OrganizationDirectorUserName'] = organizationDirectorUserName;
  180. if(organizationDirectorFullName != null)
  181. map['OrganizationDirectorFullName'] = organizationDirectorFullName;
  182. return map;
  183. }
  184. }
  185. class GetDeviceRequest extends TokenRequest{
  186. String? deviceCode;
  187. GetDeviceRequest({
  188. this.deviceCode,
  189. String? token,
  190. }) : super(
  191. token: token,
  192. );
  193. factory GetDeviceRequest.fromJson(Map<String, dynamic> map) {
  194. return GetDeviceRequest(
  195. deviceCode: map['DeviceCode'],
  196. token: map['Token'],
  197. );
  198. }
  199. Map<String, dynamic> toJson() {
  200. final map = super.toJson();
  201. if(deviceCode != null)
  202. map['DeviceCode'] = deviceCode;
  203. return map;
  204. }
  205. }
  206. class GetDeviceByShortCodeRequest extends TokenRequest{
  207. String? shortCode;
  208. GetDeviceByShortCodeRequest({
  209. this.shortCode,
  210. String? token,
  211. }) : super(
  212. token: token,
  213. );
  214. factory GetDeviceByShortCodeRequest.fromJson(Map<String, dynamic> map) {
  215. return GetDeviceByShortCodeRequest(
  216. shortCode: map['ShortCode'],
  217. token: map['Token'],
  218. );
  219. }
  220. Map<String, dynamic> toJson() {
  221. final map = super.toJson();
  222. if(shortCode != null)
  223. map['ShortCode'] = shortCode;
  224. return map;
  225. }
  226. }
  227. class PageCollection<T> {
  228. int currentPage;
  229. int pageSize;
  230. int dataCount;
  231. List<T>? pageData;
  232. PageCollection({
  233. this.currentPage = 0,
  234. this.pageSize = 0,
  235. this.dataCount = 0,
  236. this.pageData,
  237. });
  238. factory PageCollection.fromJson(Map<String, dynamic> map) {
  239. List<T> pageDataList = [];
  240. if (map['PageData'] != null) {
  241. pageDataList.addAll(
  242. (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
  243. }
  244. return PageCollection(
  245. currentPage: map['CurrentPage'],
  246. pageSize: map['PageSize'],
  247. dataCount: map['DataCount'],
  248. pageData: pageDataList,
  249. );
  250. }
  251. Map<String, dynamic> toJson() {
  252. final map = Map<String, dynamic>();
  253. map['CurrentPage'] = currentPage;
  254. map['PageSize'] = pageSize;
  255. map['DataCount'] = dataCount;
  256. if(pageData != null)
  257. map['PageData'] = pageData;
  258. return map;
  259. }
  260. }
  261. class PageFilterRequest extends BaseRequest{
  262. int currentPage;
  263. int pageSize;
  264. Map<String,String>? filter;
  265. bool isFuzzy;
  266. PageFilterRequest({
  267. this.currentPage = 0,
  268. this.pageSize = 0,
  269. this.filter,
  270. this.isFuzzy = false,
  271. }) : super(
  272. );
  273. factory PageFilterRequest.fromJson(Map<String, dynamic> map) {
  274. return PageFilterRequest(
  275. currentPage: map['CurrentPage'],
  276. pageSize: map['PageSize'],
  277. filter: map['Filter'] != null ? map['Filter'].cast<String,String>() : null,
  278. isFuzzy: map['IsFuzzy'],
  279. );
  280. }
  281. Map<String, dynamic> toJson() {
  282. final map = super.toJson();
  283. map['CurrentPage'] = currentPage;
  284. map['PageSize'] = pageSize;
  285. if(filter != null)
  286. map['Filter'] = filter;
  287. map['IsFuzzy'] = isFuzzy;
  288. return map;
  289. }
  290. }
  291. class BindDeviceRequest extends TokenRequest{
  292. String? serialNumber;
  293. String? name;
  294. String? description;
  295. String? headPicUrl;
  296. String? organizationCode;
  297. String? departmentCode;
  298. String? shortCode;
  299. bool isAutoShared;
  300. BindDeviceRequest({
  301. this.serialNumber,
  302. this.name,
  303. this.description,
  304. this.headPicUrl,
  305. this.organizationCode,
  306. this.departmentCode,
  307. this.shortCode,
  308. this.isAutoShared = false,
  309. String? token,
  310. }) : super(
  311. token: token,
  312. );
  313. factory BindDeviceRequest.fromJson(Map<String, dynamic> map) {
  314. return BindDeviceRequest(
  315. serialNumber: map['SerialNumber'],
  316. name: map['Name'],
  317. description: map['Description'],
  318. headPicUrl: map['HeadPicUrl'],
  319. organizationCode: map['OrganizationCode'],
  320. departmentCode: map['DepartmentCode'],
  321. shortCode: map['ShortCode'],
  322. isAutoShared: map['IsAutoShared'],
  323. token: map['Token'],
  324. );
  325. }
  326. Map<String, dynamic> toJson() {
  327. final map = super.toJson();
  328. if(serialNumber != null)
  329. map['SerialNumber'] = serialNumber;
  330. if(name != null)
  331. map['Name'] = name;
  332. if(description != null)
  333. map['Description'] = description;
  334. if(headPicUrl != null)
  335. map['HeadPicUrl'] = headPicUrl;
  336. if(organizationCode != null)
  337. map['OrganizationCode'] = organizationCode;
  338. if(departmentCode != null)
  339. map['DepartmentCode'] = departmentCode;
  340. if(shortCode != null)
  341. map['ShortCode'] = shortCode;
  342. map['IsAutoShared'] = isAutoShared;
  343. return map;
  344. }
  345. }
  346. class ModifyDeviceRequest extends TokenRequest{
  347. String? deviceCode;
  348. String? name;
  349. String? headPicUrl;
  350. String? departmentCode;
  351. bool isAutoShared;
  352. ModifyDeviceRequest({
  353. this.deviceCode,
  354. this.name,
  355. this.headPicUrl,
  356. this.departmentCode,
  357. this.isAutoShared = false,
  358. String? token,
  359. }) : super(
  360. token: token,
  361. );
  362. factory ModifyDeviceRequest.fromJson(Map<String, dynamic> map) {
  363. return ModifyDeviceRequest(
  364. deviceCode: map['DeviceCode'],
  365. name: map['Name'],
  366. headPicUrl: map['HeadPicUrl'],
  367. departmentCode: map['DepartmentCode'],
  368. isAutoShared: map['IsAutoShared'],
  369. token: map['Token'],
  370. );
  371. }
  372. Map<String, dynamic> toJson() {
  373. final map = super.toJson();
  374. if(deviceCode != null)
  375. map['DeviceCode'] = deviceCode;
  376. if(name != null)
  377. map['Name'] = name;
  378. if(headPicUrl != null)
  379. map['HeadPicUrl'] = headPicUrl;
  380. if(departmentCode != null)
  381. map['DepartmentCode'] = departmentCode;
  382. map['IsAutoShared'] = isAutoShared;
  383. return map;
  384. }
  385. }
  386. enum DictionaryTypeEnum {
  387. DeviceModel,
  388. DeviceType,
  389. }
  390. class CreateDictionaryItemRequest extends TokenRequest{
  391. DictionaryTypeEnum dictionaryType;
  392. String? dictionaryItemValue;
  393. String? parentCode;
  394. CreateDictionaryItemRequest({
  395. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  396. this.dictionaryItemValue,
  397. this.parentCode,
  398. String? token,
  399. }) : super(
  400. token: token,
  401. );
  402. factory CreateDictionaryItemRequest.fromJson(Map<String, dynamic> map) {
  403. return CreateDictionaryItemRequest(
  404. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  405. dictionaryItemValue: map['DictionaryItemValue'],
  406. parentCode: map['ParentCode'],
  407. token: map['Token'],
  408. );
  409. }
  410. Map<String, dynamic> toJson() {
  411. final map = super.toJson();
  412. map['DictionaryType'] = dictionaryType.index;
  413. if(dictionaryItemValue != null)
  414. map['DictionaryItemValue'] = dictionaryItemValue;
  415. if(parentCode != null)
  416. map['ParentCode'] = parentCode;
  417. return map;
  418. }
  419. }
  420. class DictionaryDTO extends BaseDTO{
  421. String? dictionaryCode;
  422. DictionaryTypeEnum dictionaryType;
  423. String? value;
  424. String? parentCode;
  425. DictionaryDTO({
  426. this.dictionaryCode,
  427. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  428. this.value,
  429. this.parentCode,
  430. DateTime? createTime,
  431. DateTime? updateTime,
  432. }) : super(
  433. createTime: createTime,
  434. updateTime: updateTime,
  435. );
  436. factory DictionaryDTO.fromJson(Map<String, dynamic> map) {
  437. return DictionaryDTO(
  438. dictionaryCode: map['DictionaryCode'],
  439. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  440. value: map['Value'],
  441. parentCode: map['ParentCode'],
  442. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  443. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  444. );
  445. }
  446. Map<String, dynamic> toJson() {
  447. final map = super.toJson();
  448. if(dictionaryCode != null)
  449. map['DictionaryCode'] = dictionaryCode;
  450. map['DictionaryType'] = dictionaryType.index;
  451. if(value != null)
  452. map['Value'] = value;
  453. if(parentCode != null)
  454. map['ParentCode'] = parentCode;
  455. return map;
  456. }
  457. }
  458. class FindDeviceModelItemsRequest extends TokenRequest{
  459. DictionaryTypeEnum dictionaryType;
  460. String? deviceTypeCode;
  461. FindDeviceModelItemsRequest({
  462. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  463. this.deviceTypeCode,
  464. String? token,
  465. }) : super(
  466. token: token,
  467. );
  468. factory FindDeviceModelItemsRequest.fromJson(Map<String, dynamic> map) {
  469. return FindDeviceModelItemsRequest(
  470. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  471. deviceTypeCode: map['DeviceTypeCode'],
  472. token: map['Token'],
  473. );
  474. }
  475. Map<String, dynamic> toJson() {
  476. final map = super.toJson();
  477. map['DictionaryType'] = dictionaryType.index;
  478. if(deviceTypeCode != null)
  479. map['DeviceTypeCode'] = deviceTypeCode;
  480. return map;
  481. }
  482. }
  483. class FindDeviceTypeItemsRequest extends TokenRequest{
  484. DictionaryTypeEnum dictionaryType;
  485. FindDeviceTypeItemsRequest({
  486. this.dictionaryType = DictionaryTypeEnum.DeviceModel,
  487. String? token,
  488. }) : super(
  489. token: token,
  490. );
  491. factory FindDeviceTypeItemsRequest.fromJson(Map<String, dynamic> map) {
  492. return FindDeviceTypeItemsRequest(
  493. dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']),
  494. token: map['Token'],
  495. );
  496. }
  497. Map<String, dynamic> toJson() {
  498. final map = super.toJson();
  499. map['DictionaryType'] = dictionaryType.index;
  500. return map;
  501. }
  502. }
  503. class CreateShareDeviceToUserRequest extends TokenRequest{
  504. List<String>? userCodes;
  505. String? deviceCode;
  506. CreateShareDeviceToUserRequest({
  507. this.userCodes,
  508. this.deviceCode,
  509. String? token,
  510. }) : super(
  511. token: token,
  512. );
  513. factory CreateShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  514. return CreateShareDeviceToUserRequest(
  515. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  516. deviceCode: map['DeviceCode'],
  517. token: map['Token'],
  518. );
  519. }
  520. Map<String, dynamic> toJson() {
  521. final map = super.toJson();
  522. if(userCodes != null)
  523. map['UserCodes'] = userCodes;
  524. if(deviceCode != null)
  525. map['DeviceCode'] = deviceCode;
  526. return map;
  527. }
  528. }
  529. class DeleteShareDeviceToUserRequest extends TokenRequest{
  530. List<String>? userCodes;
  531. String? deviceCode;
  532. DeleteShareDeviceToUserRequest({
  533. this.userCodes,
  534. this.deviceCode,
  535. String? token,
  536. }) : super(
  537. token: token,
  538. );
  539. factory DeleteShareDeviceToUserRequest.fromJson(Map<String, dynamic> map) {
  540. return DeleteShareDeviceToUserRequest(
  541. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  542. deviceCode: map['DeviceCode'],
  543. token: map['Token'],
  544. );
  545. }
  546. Map<String, dynamic> toJson() {
  547. final map = super.toJson();
  548. if(userCodes != null)
  549. map['UserCodes'] = userCodes;
  550. if(deviceCode != null)
  551. map['DeviceCode'] = deviceCode;
  552. return map;
  553. }
  554. }
  555. class RemoveDeviceRelevancyRequest extends TokenRequest{
  556. String? organizationCode;
  557. String? departmentCode;
  558. String? deviceCode;
  559. RemoveDeviceRelevancyRequest({
  560. this.organizationCode,
  561. this.departmentCode,
  562. this.deviceCode,
  563. String? token,
  564. }) : super(
  565. token: token,
  566. );
  567. factory RemoveDeviceRelevancyRequest.fromJson(Map<String, dynamic> map) {
  568. return RemoveDeviceRelevancyRequest(
  569. organizationCode: map['OrganizationCode'],
  570. departmentCode: map['DepartmentCode'],
  571. deviceCode: map['DeviceCode'],
  572. token: map['Token'],
  573. );
  574. }
  575. Map<String, dynamic> toJson() {
  576. final map = super.toJson();
  577. if(organizationCode != null)
  578. map['OrganizationCode'] = organizationCode;
  579. if(departmentCode != null)
  580. map['DepartmentCode'] = departmentCode;
  581. if(deviceCode != null)
  582. map['DeviceCode'] = deviceCode;
  583. return map;
  584. }
  585. }
  586. class GetPersonDeviceRequest extends PageRequest{
  587. String? keyWord;
  588. String? deviceType;
  589. String? deviceModel;
  590. bool? isOnline;
  591. GetPersonDeviceRequest({
  592. this.keyWord,
  593. this.deviceType,
  594. this.deviceModel,
  595. this.isOnline,
  596. int pageIndex = 0,
  597. int pageSize = 0,
  598. String? token,
  599. }) : super(
  600. pageIndex: pageIndex,
  601. pageSize: pageSize,
  602. token: token,
  603. );
  604. factory GetPersonDeviceRequest.fromJson(Map<String, dynamic> map) {
  605. return GetPersonDeviceRequest(
  606. keyWord: map['KeyWord'],
  607. deviceType: map['DeviceType'],
  608. deviceModel: map['DeviceModel'],
  609. isOnline: map['IsOnline'],
  610. pageIndex: map['PageIndex'],
  611. pageSize: map['PageSize'],
  612. token: map['Token'],
  613. );
  614. }
  615. Map<String, dynamic> toJson() {
  616. final map = super.toJson();
  617. if(keyWord != null)
  618. map['KeyWord'] = keyWord;
  619. if(deviceType != null)
  620. map['DeviceType'] = deviceType;
  621. if(deviceModel != null)
  622. map['DeviceModel'] = deviceModel;
  623. if(isOnline != null)
  624. map['IsOnline'] = isOnline;
  625. return map;
  626. }
  627. }
  628. class FindDevicesByOrganizationCodeRequest extends TokenRequest{
  629. String? organizationCode;
  630. FindDevicesByOrganizationCodeRequest({
  631. this.organizationCode,
  632. String? token,
  633. }) : super(
  634. token: token,
  635. );
  636. factory FindDevicesByOrganizationCodeRequest.fromJson(Map<String, dynamic> map) {
  637. return FindDevicesByOrganizationCodeRequest(
  638. organizationCode: map['OrganizationCode'],
  639. token: map['Token'],
  640. );
  641. }
  642. Map<String, dynamic> toJson() {
  643. final map = super.toJson();
  644. if(organizationCode != null)
  645. map['OrganizationCode'] = organizationCode;
  646. return map;
  647. }
  648. }
  649. class SelectItemDTO {
  650. String? key;
  651. String? value;
  652. SelectItemDTO({
  653. this.key,
  654. this.value,
  655. });
  656. factory SelectItemDTO.fromJson(Map<String, dynamic> map) {
  657. return SelectItemDTO(
  658. key: map['Key'],
  659. value: map['Value'],
  660. );
  661. }
  662. Map<String, dynamic> toJson() {
  663. final map = Map<String, dynamic>();
  664. if(key != null)
  665. map['Key'] = key;
  666. if(value != null)
  667. map['Value'] = value;
  668. return map;
  669. }
  670. }
  671. class AddDeviceToOrgRequest extends TokenRequest{
  672. String? uniqueCode;
  673. AddDeviceToOrgRequest({
  674. this.uniqueCode,
  675. String? token,
  676. }) : super(
  677. token: token,
  678. );
  679. factory AddDeviceToOrgRequest.fromJson(Map<String, dynamic> map) {
  680. return AddDeviceToOrgRequest(
  681. uniqueCode: map['UniqueCode'],
  682. token: map['Token'],
  683. );
  684. }
  685. Map<String, dynamic> toJson() {
  686. final map = super.toJson();
  687. if(uniqueCode != null)
  688. map['UniqueCode'] = uniqueCode;
  689. return map;
  690. }
  691. }
  692. class DiagnosisModuleDTO extends BaseDTO{
  693. String? diagnosisModuleCode;
  694. String? diagnosisModule;
  695. bool enabled;
  696. DiagnosisModuleDTO({
  697. this.diagnosisModuleCode,
  698. this.diagnosisModule,
  699. this.enabled = false,
  700. DateTime? createTime,
  701. DateTime? updateTime,
  702. }) : super(
  703. createTime: createTime,
  704. updateTime: updateTime,
  705. );
  706. factory DiagnosisModuleDTO.fromJson(Map<String, dynamic> map) {
  707. return DiagnosisModuleDTO(
  708. diagnosisModuleCode: map['DiagnosisModuleCode'],
  709. diagnosisModule: map['DiagnosisModule'],
  710. enabled: map['Enabled'],
  711. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  712. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  713. );
  714. }
  715. Map<String, dynamic> toJson() {
  716. final map = super.toJson();
  717. if(diagnosisModuleCode != null)
  718. map['DiagnosisModuleCode'] = diagnosisModuleCode;
  719. if(diagnosisModule != null)
  720. map['DiagnosisModule'] = diagnosisModule;
  721. map['Enabled'] = enabled;
  722. return map;
  723. }
  724. }
  725. class FindDeviceDiagnosisModulesRequest extends TokenRequest{
  726. String? deviceCode;
  727. FindDeviceDiagnosisModulesRequest({
  728. this.deviceCode,
  729. String? token,
  730. }) : super(
  731. token: token,
  732. );
  733. factory FindDeviceDiagnosisModulesRequest.fromJson(Map<String, dynamic> map) {
  734. return FindDeviceDiagnosisModulesRequest(
  735. deviceCode: map['DeviceCode'],
  736. token: map['Token'],
  737. );
  738. }
  739. Map<String, dynamic> toJson() {
  740. final map = super.toJson();
  741. if(deviceCode != null)
  742. map['DeviceCode'] = deviceCode;
  743. return map;
  744. }
  745. }
  746. class ModifyDeviceDiagnosisModuleStateRequest extends TokenRequest{
  747. String? deviceCode;
  748. String? diagnosisModule;
  749. bool enabled;
  750. ModifyDeviceDiagnosisModuleStateRequest({
  751. this.deviceCode,
  752. this.diagnosisModule,
  753. this.enabled = false,
  754. String? token,
  755. }) : super(
  756. token: token,
  757. );
  758. factory ModifyDeviceDiagnosisModuleStateRequest.fromJson(Map<String, dynamic> map) {
  759. return ModifyDeviceDiagnosisModuleStateRequest(
  760. deviceCode: map['DeviceCode'],
  761. diagnosisModule: map['DiagnosisModule'],
  762. enabled: map['Enabled'],
  763. token: map['Token'],
  764. );
  765. }
  766. Map<String, dynamic> toJson() {
  767. final map = super.toJson();
  768. if(deviceCode != null)
  769. map['DeviceCode'] = deviceCode;
  770. if(diagnosisModule != null)
  771. map['DiagnosisModule'] = diagnosisModule;
  772. map['Enabled'] = enabled;
  773. return map;
  774. }
  775. }