vitalOrganization.m.dart 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  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. OrganizationDTO2({
  119. this.code,
  120. this.provinceCode,
  121. this.cityCode,
  122. this.districtCode,
  123. this.townCode,
  124. this.residenceCode,
  125. this.townName,
  126. this.residenceName,
  127. this.organizationName,
  128. this.contactNumber,
  129. this.logoUrl,
  130. this.address,
  131. this.directors,
  132. this.fatherCode,
  133. this.fatherName,
  134. this.featureCodes,
  135. this.customType = CustomTypeEnum.General,
  136. this.peripheralDeviceKeys,
  137. this.dynamicParameter,
  138. DateTime? createTime,
  139. DateTime? updateTime,
  140. }) : super(
  141. createTime: createTime,
  142. updateTime: updateTime,
  143. );
  144. factory OrganizationDTO2.fromJson(Map<String, dynamic> map) {
  145. return OrganizationDTO2(
  146. code: map['Code'],
  147. provinceCode: map['ProvinceCode'],
  148. cityCode: map['CityCode'],
  149. districtCode: map['DistrictCode'],
  150. townCode: map['TownCode'],
  151. residenceCode: map['ResidenceCode'],
  152. townName: map['TownName'],
  153. residenceName: map['ResidenceName'],
  154. organizationName: map['OrganizationName'],
  155. contactNumber: map['ContactNumber'],
  156. logoUrl: map['LogoUrl'],
  157. address: map['Address'],
  158. directors: map['Directors']?.cast<String>().toList(),
  159. fatherCode: map['FatherCode'],
  160. fatherName: map['FatherName'],
  161. featureCodes: map['FeatureCodes']?.cast<String>().toList(),
  162. customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
  163. peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
  164. dynamicParameter: map['DynamicParameter'],
  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 (code != null)
  172. map['Code'] = code;
  173. if (provinceCode != null)
  174. map['ProvinceCode'] = provinceCode;
  175. if (cityCode != null)
  176. map['CityCode'] = cityCode;
  177. if (districtCode != null)
  178. map['DistrictCode'] = districtCode;
  179. if (townCode != null)
  180. map['TownCode'] = townCode;
  181. if (residenceCode != null)
  182. map['ResidenceCode'] = residenceCode;
  183. if (townName != null)
  184. map['TownName'] = townName;
  185. if (residenceName != null)
  186. map['ResidenceName'] = residenceName;
  187. if (organizationName != null)
  188. map['OrganizationName'] = organizationName;
  189. if (contactNumber != null)
  190. map['ContactNumber'] = contactNumber;
  191. if (logoUrl != null)
  192. map['LogoUrl'] = logoUrl;
  193. if (address != null)
  194. map['Address'] = address;
  195. if (directors != null)
  196. map['Directors'] = directors;
  197. if (fatherCode != null)
  198. map['FatherCode'] = fatherCode;
  199. if (fatherName != null)
  200. map['FatherName'] = fatherName;
  201. if (featureCodes != null)
  202. map['FeatureCodes'] = featureCodes;
  203. map['CustomType'] = customType.index;
  204. if (peripheralDeviceKeys != null)
  205. map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
  206. if (dynamicParameter != null)
  207. map['DynamicParameter'] = dynamicParameter;
  208. return map;
  209. }
  210. }
  211. class GetOrganizationRequest extends TokenRequest{
  212. String? code;
  213. GetOrganizationRequest({
  214. this.code,
  215. String? token,
  216. }) : super(
  217. token: token,
  218. );
  219. factory GetOrganizationRequest.fromJson(Map<String, dynamic> map) {
  220. return GetOrganizationRequest(
  221. code: map['Code'],
  222. token: map['Token'],
  223. );
  224. }
  225. Map<String, dynamic> toJson() {
  226. final map = super.toJson();
  227. if (code != null)
  228. map['Code'] = code;
  229. return map;
  230. }
  231. }
  232. class GetOrganizationByKeyRequest extends TokenRequest{
  233. String? key;
  234. String? value;
  235. GetOrganizationByKeyRequest({
  236. this.key,
  237. this.value,
  238. String? token,
  239. }) : super(
  240. token: token,
  241. );
  242. factory GetOrganizationByKeyRequest.fromJson(Map<String, dynamic> map) {
  243. return GetOrganizationByKeyRequest(
  244. key: map['Key'],
  245. value: map['Value'],
  246. token: map['Token'],
  247. );
  248. }
  249. Map<String, dynamic> toJson() {
  250. final map = super.toJson();
  251. if (key != null)
  252. map['Key'] = key;
  253. if (value != null)
  254. map['Value'] = value;
  255. return map;
  256. }
  257. }
  258. class OrganizationPageRequest extends PageRequest{
  259. OrganizationPageRequest({
  260. int pageIndex = 0,
  261. int pageSize = 0,
  262. String? token,
  263. }) : super(
  264. pageIndex: pageIndex,
  265. pageSize: pageSize,
  266. token: token,
  267. );
  268. factory OrganizationPageRequest.fromJson(Map<String, dynamic> map) {
  269. return OrganizationPageRequest(
  270. pageIndex: map['PageIndex'],
  271. pageSize: map['PageSize'],
  272. token: map['Token'],
  273. );
  274. }
  275. Map<String, dynamic> toJson() {
  276. final map = super.toJson();
  277. return map;
  278. }
  279. }
  280. class RemoveOrganizationRequest extends TokenRequest{
  281. String? code;
  282. RemoveOrganizationRequest({
  283. this.code,
  284. String? token,
  285. }) : super(
  286. token: token,
  287. );
  288. factory RemoveOrganizationRequest.fromJson(Map<String, dynamic> map) {
  289. return RemoveOrganizationRequest(
  290. code: map['Code'],
  291. token: map['Token'],
  292. );
  293. }
  294. Map<String, dynamic> toJson() {
  295. final map = super.toJson();
  296. if (code != null)
  297. map['Code'] = code;
  298. return map;
  299. }
  300. }
  301. class GetOrganizationListRequest extends TokenRequest{
  302. List<String>? codes;
  303. GetOrganizationListRequest({
  304. this.codes,
  305. String? token,
  306. }) : super(
  307. token: token,
  308. );
  309. factory GetOrganizationListRequest.fromJson(Map<String, dynamic> map) {
  310. return GetOrganizationListRequest(
  311. codes: map['Codes']?.cast<String>().toList(),
  312. token: map['Token'],
  313. );
  314. }
  315. Map<String, dynamic> toJson() {
  316. final map = super.toJson();
  317. if (codes != null)
  318. map['Codes'] = codes;
  319. return map;
  320. }
  321. }
  322. class UpdateOrganizationRequest extends TokenRequest{
  323. String? code;
  324. String? provinceCode;
  325. String? cityCode;
  326. String? districtCode;
  327. String? townCode;
  328. String? residenceCode;
  329. String? organizationName;
  330. String? contactNumber;
  331. String? logoUrl;
  332. String? address;
  333. String? fatherCode;
  334. List<String>? featureCodes;
  335. CustomTypeEnum customType;
  336. List<String>? peripheralDeviceKeys;
  337. String? dynamicParameter;
  338. UpdateOrganizationRequest({
  339. this.code,
  340. this.provinceCode,
  341. this.cityCode,
  342. this.districtCode,
  343. this.townCode,
  344. this.residenceCode,
  345. this.organizationName,
  346. this.contactNumber,
  347. this.logoUrl,
  348. this.address,
  349. this.fatherCode,
  350. this.featureCodes,
  351. this.customType = CustomTypeEnum.General,
  352. this.peripheralDeviceKeys,
  353. this.dynamicParameter,
  354. String? token,
  355. }) : super(
  356. token: token,
  357. );
  358. factory UpdateOrganizationRequest.fromJson(Map<String, dynamic> map) {
  359. return UpdateOrganizationRequest(
  360. code: map['Code'],
  361. provinceCode: map['ProvinceCode'],
  362. cityCode: map['CityCode'],
  363. districtCode: map['DistrictCode'],
  364. townCode: map['TownCode'],
  365. residenceCode: map['ResidenceCode'],
  366. organizationName: map['OrganizationName'],
  367. contactNumber: map['ContactNumber'],
  368. logoUrl: map['LogoUrl'],
  369. address: map['Address'],
  370. fatherCode: map['FatherCode'],
  371. featureCodes: map['FeatureCodes']?.cast<String>().toList(),
  372. customType: CustomTypeEnum.values.firstWhere((e) => e.index == map['CustomType']),
  373. peripheralDeviceKeys: map['PeripheralDeviceKeys']?.cast<String>().toList(),
  374. dynamicParameter: map['DynamicParameter'],
  375. token: map['Token'],
  376. );
  377. }
  378. Map<String, dynamic> toJson() {
  379. final map = super.toJson();
  380. if (code != null)
  381. map['Code'] = code;
  382. if (provinceCode != null)
  383. map['ProvinceCode'] = provinceCode;
  384. if (cityCode != null)
  385. map['CityCode'] = cityCode;
  386. if (districtCode != null)
  387. map['DistrictCode'] = districtCode;
  388. if (townCode != null)
  389. map['TownCode'] = townCode;
  390. if (residenceCode != null)
  391. map['ResidenceCode'] = residenceCode;
  392. if (organizationName != null)
  393. map['OrganizationName'] = organizationName;
  394. if (contactNumber != null)
  395. map['ContactNumber'] = contactNumber;
  396. if (logoUrl != null)
  397. map['LogoUrl'] = logoUrl;
  398. if (address != null)
  399. map['Address'] = address;
  400. if (fatherCode != null)
  401. map['FatherCode'] = fatherCode;
  402. if (featureCodes != null)
  403. map['FeatureCodes'] = featureCodes;
  404. map['CustomType'] = customType.index;
  405. if (peripheralDeviceKeys != null)
  406. map['PeripheralDeviceKeys'] = peripheralDeviceKeys;
  407. if (dynamicParameter != null)
  408. map['DynamicParameter'] = dynamicParameter;
  409. return map;
  410. }
  411. }
  412. class TeamBaseDTO {
  413. String? teamName;
  414. String? code;
  415. TeamBaseDTO({
  416. this.teamName,
  417. this.code,
  418. });
  419. factory TeamBaseDTO.fromJson(Map<String, dynamic> map) {
  420. return TeamBaseDTO(
  421. teamName: map['TeamName'],
  422. code: map['Code'],
  423. );
  424. }
  425. Map<String, dynamic> toJson() {
  426. final map = Map<String, dynamic>();
  427. if (teamName != null) {
  428. map['TeamName'] = teamName;
  429. }
  430. if (code != null) {
  431. map['Code'] = code;
  432. }
  433. return map;
  434. }
  435. }
  436. class OrganizationTreeDTO extends BaseDTO{
  437. String? fatherCode;
  438. String? organizationName;
  439. List<TeamBaseDTO>? teams;
  440. OrganizationTreeDTO({
  441. this.fatherCode,
  442. this.organizationName,
  443. this.teams,
  444. DateTime? createTime,
  445. DateTime? updateTime,
  446. }) : super(
  447. createTime: createTime,
  448. updateTime: updateTime,
  449. );
  450. factory OrganizationTreeDTO.fromJson(Map<String, dynamic> map) {
  451. return OrganizationTreeDTO(
  452. fatherCode: map['FatherCode'],
  453. organizationName: map['OrganizationName'],
  454. teams: map['Teams'] != null ? (map['Teams'] as List).map((e)=>TeamBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  455. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  456. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  457. );
  458. }
  459. Map<String, dynamic> toJson() {
  460. final map = super.toJson();
  461. if (fatherCode != null)
  462. map['FatherCode'] = fatherCode;
  463. if (organizationName != null)
  464. map['OrganizationName'] = organizationName;
  465. if (teams != null)
  466. map['Teams'] = teams;
  467. return map;
  468. }
  469. }
  470. class GetOrganizationTreeRequest extends TokenRequest{
  471. GetOrganizationTreeRequest({
  472. String? token,
  473. }) : super(
  474. token: token,
  475. );
  476. factory GetOrganizationTreeRequest.fromJson(Map<String, dynamic> map) {
  477. return GetOrganizationTreeRequest(
  478. token: map['Token'],
  479. );
  480. }
  481. Map<String, dynamic> toJson() {
  482. final map = super.toJson();
  483. return map;
  484. }
  485. }
  486. class GetEnableDeviceKeysRequest extends TokenRequest{
  487. String? organizationCode;
  488. GetEnableDeviceKeysRequest({
  489. this.organizationCode,
  490. String? token,
  491. }) : super(
  492. token: token,
  493. );
  494. factory GetEnableDeviceKeysRequest.fromJson(Map<String, dynamic> map) {
  495. return GetEnableDeviceKeysRequest(
  496. organizationCode: map['OrganizationCode'],
  497. token: map['Token'],
  498. );
  499. }
  500. Map<String, dynamic> toJson() {
  501. final map = super.toJson();
  502. if (organizationCode != null)
  503. map['OrganizationCode'] = organizationCode;
  504. return map;
  505. }
  506. }
  507. class DynamicParameterDTO {
  508. String? type;
  509. String? key;
  510. String? mode;
  511. DynamicParameterDTO({
  512. this.type,
  513. this.key,
  514. this.mode,
  515. });
  516. factory DynamicParameterDTO.fromJson(Map<String, dynamic> map) {
  517. return DynamicParameterDTO(
  518. type: map['Type'],
  519. key: map['Key'],
  520. mode: map['Mode'],
  521. );
  522. }
  523. Map<String, dynamic> toJson() {
  524. final map = Map<String, dynamic>();
  525. if (type != null) {
  526. map['Type'] = type;
  527. }
  528. if (key != null) {
  529. map['Key'] = key;
  530. }
  531. if (mode != null) {
  532. map['Mode'] = mode;
  533. }
  534. return map;
  535. }
  536. }
  537. class GetDynamicParameterRequest extends TokenRequest{
  538. String? organizationCode;
  539. GetDynamicParameterRequest({
  540. this.organizationCode,
  541. String? token,
  542. }) : super(
  543. token: token,
  544. );
  545. factory GetDynamicParameterRequest.fromJson(Map<String, dynamic> map) {
  546. return GetDynamicParameterRequest(
  547. organizationCode: map['OrganizationCode'],
  548. token: map['Token'],
  549. );
  550. }
  551. Map<String, dynamic> toJson() {
  552. final map = super.toJson();
  553. if (organizationCode != null)
  554. map['OrganizationCode'] = organizationCode;
  555. return map;
  556. }
  557. }