vitalOrganization.m.dart 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'device.m.dart';
  4. enum CustomTypeEnum {
  5. General,
  6. CustomFirst,
  7. }
  8. class CreateOrganizationRequest extends TokenRequest{
  9. String? code;
  10. String? provinceCode;
  11. String? cityCode;
  12. String? districtCode;
  13. String? townCode;
  14. String? residenceCode;
  15. String? organizationName;
  16. String? contactNumber;
  17. String? logoUrl;
  18. String? address;
  19. String? fatherCode;
  20. List<String>? featureCodes;
  21. CustomTypeEnum customType;
  22. List<String>? peripheralDeviceKeys;
  23. String? dynamicParameter;
  24. CreateOrganizationRequest({
  25. this.code,
  26. this.provinceCode,
  27. this.cityCode,
  28. this.districtCode,
  29. this.townCode,
  30. this.residenceCode,
  31. this.organizationName,
  32. this.contactNumber,
  33. this.logoUrl,
  34. this.address,
  35. this.fatherCode,
  36. this.featureCodes,
  37. this.customType = CustomTypeEnum.General,
  38. this.peripheralDeviceKeys,
  39. this.dynamicParameter,
  40. String? token,
  41. }) : super(
  42. token: token,
  43. );
  44. factory CreateOrganizationRequest.fromJson(Map<String, dynamic> map) {
  45. return CreateOrganizationRequest(
  46. code: map['Code'],
  47. provinceCode: map['ProvinceCode'],
  48. cityCode: map['CityCode'],
  49. districtCode: map['DistrictCode'],
  50. townCode: map['TownCode'],
  51. residenceCode: map['ResidenceCode'],
  52. organizationName: map['OrganizationName'],
  53. contactNumber: map['ContactNumber'],
  54. logoUrl: map['LogoUrl'],
  55. address: map['Address'],
  56. fatherCode: map['FatherCode'],
  57. featureCodes: map['FeatureCodes']?.cast<String>().toList(),
  58. customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
  59. peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
  60. dynamicParameter: map['DynamicParameter'],
  61. token: map['Token'],
  62. );
  63. }
  64. Map<String, dynamic> toJson() {
  65. final map = super.toJson();
  66. if (code != null)
  67. map['Code'] = code;
  68. if (provinceCode != null)
  69. map['ProvinceCode'] = provinceCode;
  70. if (cityCode != null)
  71. map['CityCode'] = cityCode;
  72. if (districtCode != null)
  73. map['DistrictCode'] = districtCode;
  74. if (townCode != null)
  75. map['TownCode'] = townCode;
  76. if (residenceCode != null)
  77. map['ResidenceCode'] = residenceCode;
  78. if (organizationName != null)
  79. map['OrganizationName'] = organizationName;
  80. if (contactNumber != null)
  81. map['ContactNumber'] = contactNumber;
  82. if (logoUrl != null)
  83. map['LogoUrl'] = logoUrl;
  84. if (address != null)
  85. map['Address'] = address;
  86. if (fatherCode != null)
  87. map['FatherCode'] = fatherCode;
  88. if (featureCodes != null)
  89. map['FeatureCodes'] = featureCodes;
  90. map['CustomType'] = customType.index;
  91. if (peripheralDeviceKeys != null)
  92. map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
  93. if (dynamicParameter != null)
  94. map['DynamicParameter'] = dynamicParameter;
  95. return map;
  96. }
  97. }
  98. class OrganizationDTO2 extends BaseDTO{
  99. String? code;
  100. String? provinceCode;
  101. String? cityCode;
  102. String? districtCode;
  103. String? townCode;
  104. String? residenceCode;
  105. String? townName;
  106. String? residenceName;
  107. String? organizationName;
  108. String? contactNumber;
  109. String? logoUrl;
  110. String? address;
  111. List<String>? directors;
  112. String? fatherCode;
  113. String? fatherName;
  114. List<String>? featureCodes;
  115. CustomTypeEnum customType;
  116. List<String>? peripheralDeviceKeys;
  117. String? dynamicParameter;
  118. String? organizationUniqueCode;
  119. OrganizationDTO2({
  120. this.code,
  121. this.provinceCode,
  122. this.cityCode,
  123. this.districtCode,
  124. this.townCode,
  125. this.residenceCode,
  126. this.townName,
  127. this.residenceName,
  128. this.organizationName,
  129. this.contactNumber,
  130. this.logoUrl,
  131. this.address,
  132. this.directors,
  133. this.fatherCode,
  134. this.fatherName,
  135. this.featureCodes,
  136. this.customType = CustomTypeEnum.General,
  137. this.peripheralDeviceKeys,
  138. this.dynamicParameter,
  139. this.organizationUniqueCode,
  140. DateTime? createTime,
  141. DateTime? updateTime,
  142. }) : super(
  143. createTime: createTime,
  144. updateTime: updateTime,
  145. );
  146. factory OrganizationDTO2.fromJson(Map<String, dynamic> map) {
  147. return OrganizationDTO2(
  148. code: map['Code'],
  149. provinceCode: map['ProvinceCode'],
  150. cityCode: map['CityCode'],
  151. districtCode: map['DistrictCode'],
  152. townCode: map['TownCode'],
  153. residenceCode: map['ResidenceCode'],
  154. townName: map['TownName'],
  155. residenceName: map['ResidenceName'],
  156. organizationName: map['OrganizationName'],
  157. contactNumber: map['ContactNumber'],
  158. logoUrl: map['LogoUrl'],
  159. address: map['Address'],
  160. directors: map['Directors']?.cast<String>().toList(),
  161. fatherCode: map['FatherCode'],
  162. fatherName: map['FatherName'],
  163. featureCodes: map['FeatureCodes']?.cast<String>().toList(),
  164. customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
  165. peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
  166. dynamicParameter: map['DynamicParameter'],
  167. organizationUniqueCode: map['OrganizationUniqueCode'],
  168. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  169. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  170. );
  171. }
  172. Map<String, dynamic> toJson() {
  173. final map = super.toJson();
  174. if (code != null)
  175. map['Code'] = code;
  176. if (provinceCode != null)
  177. map['ProvinceCode'] = provinceCode;
  178. if (cityCode != null)
  179. map['CityCode'] = cityCode;
  180. if (districtCode != null)
  181. map['DistrictCode'] = districtCode;
  182. if (townCode != null)
  183. map['TownCode'] = townCode;
  184. if (residenceCode != null)
  185. map['ResidenceCode'] = residenceCode;
  186. if (townName != null)
  187. map['TownName'] = townName;
  188. if (residenceName != null)
  189. map['ResidenceName'] = residenceName;
  190. if (organizationName != null)
  191. map['OrganizationName'] = organizationName;
  192. if (contactNumber != null)
  193. map['ContactNumber'] = contactNumber;
  194. if (logoUrl != null)
  195. map['LogoUrl'] = logoUrl;
  196. if (address != null)
  197. map['Address'] = address;
  198. if (directors != null)
  199. map['Directors'] = directors;
  200. if (fatherCode != null)
  201. map['FatherCode'] = fatherCode;
  202. if (fatherName != null)
  203. map['FatherName'] = fatherName;
  204. if (featureCodes != null)
  205. map['FeatureCodes'] = featureCodes;
  206. map['CustomType'] = customType.index;
  207. if (peripheralDeviceKeys != null)
  208. map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
  209. if (dynamicParameter != null)
  210. map['DynamicParameter'] = dynamicParameter;
  211. if (organizationUniqueCode != null)
  212. map['OrganizationUniqueCode'] = organizationUniqueCode;
  213. return map;
  214. }
  215. }
  216. class GetOrganizationRequest extends TokenRequest{
  217. String? code;
  218. GetOrganizationRequest({
  219. this.code,
  220. String? token,
  221. }) : super(
  222. token: token,
  223. );
  224. factory GetOrganizationRequest.fromJson(Map<String, dynamic> map) {
  225. return GetOrganizationRequest(
  226. code: map['Code'],
  227. token: map['Token'],
  228. );
  229. }
  230. Map<String, dynamic> toJson() {
  231. final map = super.toJson();
  232. if (code != null)
  233. map['Code'] = code;
  234. return map;
  235. }
  236. }
  237. class GetOrganizationByKeyRequest extends TokenRequest{
  238. String? key;
  239. String? value;
  240. GetOrganizationByKeyRequest({
  241. this.key,
  242. this.value,
  243. String? token,
  244. }) : super(
  245. token: token,
  246. );
  247. factory GetOrganizationByKeyRequest.fromJson(Map<String, dynamic> map) {
  248. return GetOrganizationByKeyRequest(
  249. key: map['Key'],
  250. value: map['Value'],
  251. token: map['Token'],
  252. );
  253. }
  254. Map<String, dynamic> toJson() {
  255. final map = super.toJson();
  256. if (key != null)
  257. map['Key'] = key;
  258. if (value != null)
  259. map['Value'] = value;
  260. return map;
  261. }
  262. }
  263. class OrganizationPageRequest extends PageRequest{
  264. OrganizationPageRequest({
  265. int pageIndex = 0,
  266. int pageSize = 0,
  267. String? token,
  268. }) : super(
  269. pageIndex: pageIndex,
  270. pageSize: pageSize,
  271. token: token,
  272. );
  273. factory OrganizationPageRequest.fromJson(Map<String, dynamic> map) {
  274. return OrganizationPageRequest(
  275. pageIndex: map['PageIndex'],
  276. pageSize: map['PageSize'],
  277. token: map['Token'],
  278. );
  279. }
  280. Map<String, dynamic> toJson() {
  281. final map = super.toJson();
  282. return map;
  283. }
  284. }
  285. class RemoveOrganizationRequest extends TokenRequest{
  286. String? code;
  287. RemoveOrganizationRequest({
  288. this.code,
  289. String? token,
  290. }) : super(
  291. token: token,
  292. );
  293. factory RemoveOrganizationRequest.fromJson(Map<String, dynamic> map) {
  294. return RemoveOrganizationRequest(
  295. code: map['Code'],
  296. token: map['Token'],
  297. );
  298. }
  299. Map<String, dynamic> toJson() {
  300. final map = super.toJson();
  301. if (code != null)
  302. map['Code'] = code;
  303. return map;
  304. }
  305. }
  306. class GetOrganizationListRequest extends TokenRequest{
  307. List<String>? codes;
  308. GetOrganizationListRequest({
  309. this.codes,
  310. String? token,
  311. }) : super(
  312. token: token,
  313. );
  314. factory GetOrganizationListRequest.fromJson(Map<String, dynamic> map) {
  315. return GetOrganizationListRequest(
  316. codes: map['Codes']?.cast<String>().toList(),
  317. token: map['Token'],
  318. );
  319. }
  320. Map<String, dynamic> toJson() {
  321. final map = super.toJson();
  322. if (codes != null)
  323. map['Codes'] = codes;
  324. return map;
  325. }
  326. }
  327. class UpdateOrganizationRequest extends TokenRequest{
  328. String? code;
  329. String? provinceCode;
  330. String? cityCode;
  331. String? districtCode;
  332. String? townCode;
  333. String? residenceCode;
  334. String? organizationName;
  335. String? contactNumber;
  336. String? logoUrl;
  337. String? address;
  338. String? fatherCode;
  339. List<String>? featureCodes;
  340. CustomTypeEnum customType;
  341. List<String>? peripheralDeviceKeys;
  342. String? dynamicParameter;
  343. UpdateOrganizationRequest({
  344. this.code,
  345. this.provinceCode,
  346. this.cityCode,
  347. this.districtCode,
  348. this.townCode,
  349. this.residenceCode,
  350. this.organizationName,
  351. this.contactNumber,
  352. this.logoUrl,
  353. this.address,
  354. this.fatherCode,
  355. this.featureCodes,
  356. this.customType = CustomTypeEnum.General,
  357. this.peripheralDeviceKeys,
  358. this.dynamicParameter,
  359. String? token,
  360. }) : super(
  361. token: token,
  362. );
  363. factory UpdateOrganizationRequest.fromJson(Map<String, dynamic> map) {
  364. return UpdateOrganizationRequest(
  365. code: map['Code'],
  366. provinceCode: map['ProvinceCode'],
  367. cityCode: map['CityCode'],
  368. districtCode: map['DistrictCode'],
  369. townCode: map['TownCode'],
  370. residenceCode: map['ResidenceCode'],
  371. organizationName: map['OrganizationName'],
  372. contactNumber: map['ContactNumber'],
  373. logoUrl: map['LogoUrl'],
  374. address: map['Address'],
  375. fatherCode: map['FatherCode'],
  376. featureCodes: map['FeatureCodes']?.cast<String>().toList(),
  377. customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
  378. peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
  379. dynamicParameter: map['DynamicParameter'],
  380. token: map['Token'],
  381. );
  382. }
  383. Map<String, dynamic> toJson() {
  384. final map = super.toJson();
  385. if (code != null)
  386. map['Code'] = code;
  387. if (provinceCode != null)
  388. map['ProvinceCode'] = provinceCode;
  389. if (cityCode != null)
  390. map['CityCode'] = cityCode;
  391. if (districtCode != null)
  392. map['DistrictCode'] = districtCode;
  393. if (townCode != null)
  394. map['TownCode'] = townCode;
  395. if (residenceCode != null)
  396. map['ResidenceCode'] = residenceCode;
  397. if (organizationName != null)
  398. map['OrganizationName'] = organizationName;
  399. if (contactNumber != null)
  400. map['ContactNumber'] = contactNumber;
  401. if (logoUrl != null)
  402. map['LogoUrl'] = logoUrl;
  403. if (address != null)
  404. map['Address'] = address;
  405. if (fatherCode != null)
  406. map['FatherCode'] = fatherCode;
  407. if (featureCodes != null)
  408. map['FeatureCodes'] = featureCodes;
  409. map['CustomType'] = customType.index;
  410. if (peripheralDeviceKeys != null)
  411. map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
  412. if (dynamicParameter != null)
  413. map['DynamicParameter'] = dynamicParameter;
  414. return map;
  415. }
  416. }
  417. class TeamBaseDTO {
  418. String? teamName;
  419. String? code;
  420. TeamBaseDTO({
  421. this.teamName,
  422. this.code,
  423. });
  424. factory TeamBaseDTO.fromJson(Map<String, dynamic> map) {
  425. return TeamBaseDTO(
  426. teamName: map['TeamName'],
  427. code: map['Code'],
  428. );
  429. }
  430. Map<String, dynamic> toJson() {
  431. final map = Map<String, dynamic>();
  432. if (teamName != null) {
  433. map['TeamName'] = teamName;
  434. }
  435. if (code != null) {
  436. map['Code'] = code;
  437. }
  438. return map;
  439. }
  440. }
  441. class OrganizationTreeDTO extends BaseDTO{
  442. String? code;
  443. String? fatherCode;
  444. String? organizationName;
  445. List<TeamBaseDTO>? teams;
  446. OrganizationTreeDTO({
  447. this.code,
  448. this.fatherCode,
  449. this.organizationName,
  450. this.teams,
  451. DateTime? createTime,
  452. DateTime? updateTime,
  453. }) : super(
  454. createTime: createTime,
  455. updateTime: updateTime,
  456. );
  457. factory OrganizationTreeDTO.fromJson(Map<String, dynamic> map) {
  458. return OrganizationTreeDTO(
  459. code: map['Code'],
  460. fatherCode: map['FatherCode'],
  461. organizationName: map['OrganizationName'],
  462. teams: map['Teams'] != null ? (map['Teams'] as List).map((e)=>TeamBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  463. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  464. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  465. );
  466. }
  467. Map<String, dynamic> toJson() {
  468. final map = super.toJson();
  469. if (code != null)
  470. map['Code'] = code;
  471. if (fatherCode != null)
  472. map['FatherCode'] = fatherCode;
  473. if (organizationName != null)
  474. map['OrganizationName'] = organizationName;
  475. if (teams != null)
  476. map['Teams'] = teams;
  477. return map;
  478. }
  479. }
  480. class GetOrganizationTreeRequest extends TokenRequest{
  481. GetOrganizationTreeRequest({
  482. String? token,
  483. }) : super(
  484. token: token,
  485. );
  486. factory GetOrganizationTreeRequest.fromJson(Map<String, dynamic> map) {
  487. return GetOrganizationTreeRequest(
  488. token: map['Token'],
  489. );
  490. }
  491. Map<String, dynamic> toJson() {
  492. final map = super.toJson();
  493. return map;
  494. }
  495. }
  496. class GetEnableDeviceKeysRequest extends TokenRequest{
  497. String? organizationCode;
  498. GetEnableDeviceKeysRequest({
  499. this.organizationCode,
  500. String? token,
  501. }) : super(
  502. token: token,
  503. );
  504. factory GetEnableDeviceKeysRequest.fromJson(Map<String, dynamic> map) {
  505. return GetEnableDeviceKeysRequest(
  506. organizationCode: map['OrganizationCode'],
  507. token: map['Token'],
  508. );
  509. }
  510. Map<String, dynamic> toJson() {
  511. final map = super.toJson();
  512. if (organizationCode != null)
  513. map['OrganizationCode'] = organizationCode;
  514. return map;
  515. }
  516. }
  517. class DynamicParameterDTO {
  518. String? type;
  519. String? key;
  520. String? mode;
  521. DynamicParameterDTO({
  522. this.type,
  523. this.key,
  524. this.mode,
  525. });
  526. factory DynamicParameterDTO.fromJson(Map<String, dynamic> map) {
  527. return DynamicParameterDTO(
  528. type: map['Type'],
  529. key: map['Key'],
  530. mode: map['Mode'],
  531. );
  532. }
  533. Map<String, dynamic> toJson() {
  534. final map = Map<String, dynamic>();
  535. if (type != null) {
  536. map['Type'] = type;
  537. }
  538. if (key != null) {
  539. map['Key'] = key;
  540. }
  541. if (mode != null) {
  542. map['Mode'] = mode;
  543. }
  544. return map;
  545. }
  546. }
  547. class GetDynamicParameterRequest extends TokenRequest{
  548. String? organizationCode;
  549. GetDynamicParameterRequest({
  550. this.organizationCode,
  551. String? token,
  552. }) : super(
  553. token: token,
  554. );
  555. factory GetDynamicParameterRequest.fromJson(Map<String, dynamic> map) {
  556. return GetDynamicParameterRequest(
  557. organizationCode: map['OrganizationCode'],
  558. token: map['Token'],
  559. );
  560. }
  561. Map<String, dynamic> toJson() {
  562. final map = super.toJson();
  563. if (organizationCode != null)
  564. map['OrganizationCode'] = organizationCode;
  565. return map;
  566. }
  567. }