user.m.dart 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042
  1. import 'liveConsultation.m.dart';
  2. import 'notification.m.dart';
  3. import 'package:fis_jsonrpc/utils.dart';
  4. class GetUserInfoRequest extends TokenRequest{
  5. GetUserInfoRequest({
  6. String? token,
  7. }) : super(
  8. token: token,
  9. );
  10. factory GetUserInfoRequest.fromJson(Map<String, dynamic> map) {
  11. return GetUserInfoRequest(
  12. token: map['Token'],
  13. );
  14. }
  15. Map<String, dynamic> toJson() {
  16. final map = super.toJson();
  17. return map;
  18. }
  19. }
  20. class AlterUserInfoRequest extends TokenRequest{
  21. String? phone;
  22. String? email;
  23. String? nickName;
  24. String? fullName;
  25. String? headImageUrl;
  26. String? organizationCode;
  27. String? extensionData;
  28. AlterUserInfoRequest({
  29. this.phone,
  30. this.email,
  31. this.nickName,
  32. this.fullName,
  33. this.headImageUrl,
  34. this.organizationCode,
  35. this.extensionData,
  36. String? token,
  37. }) : super(
  38. token: token,
  39. );
  40. factory AlterUserInfoRequest.fromJson(Map<String, dynamic> map) {
  41. return AlterUserInfoRequest(
  42. phone: map['Phone'],
  43. email: map['Email'],
  44. nickName: map['NickName'],
  45. fullName: map['FullName'],
  46. headImageUrl: map['HeadImageUrl'],
  47. organizationCode: map['OrganizationCode'],
  48. extensionData: map['ExtensionData'],
  49. token: map['Token'],
  50. );
  51. }
  52. Map<String, dynamic> toJson() {
  53. final map = super.toJson();
  54. if(phone != null)
  55. map['Phone'] = phone;
  56. if(email != null)
  57. map['Email'] = email;
  58. if(nickName != null)
  59. map['NickName'] = nickName;
  60. if(fullName != null)
  61. map['FullName'] = fullName;
  62. if(headImageUrl != null)
  63. map['HeadImageUrl'] = headImageUrl;
  64. if(organizationCode != null)
  65. map['OrganizationCode'] = organizationCode;
  66. if(extensionData != null)
  67. map['ExtensionData'] = extensionData;
  68. return map;
  69. }
  70. }
  71. enum OrganizationQueryTypeEnum {
  72. Wait,
  73. Single,
  74. AllDep,
  75. All,
  76. }
  77. class GetUserListRequest extends TokenRequest{
  78. String? keyword;
  79. OrganizationQueryTypeEnum organizationQueryType;
  80. String? organizationCode;
  81. String? rankCode;
  82. String? positionCode;
  83. bool exceptSelf;
  84. String? language;
  85. List<String >? roleCodes;
  86. GetUserListRequest({
  87. this.keyword,
  88. this.organizationQueryType = OrganizationQueryTypeEnum.Wait,
  89. this.organizationCode,
  90. this.rankCode,
  91. this.positionCode,
  92. this.exceptSelf = false,
  93. this.language,
  94. this.roleCodes,
  95. String? token,
  96. }) : super(
  97. token: token,
  98. );
  99. factory GetUserListRequest.fromJson(Map<String, dynamic> map) {
  100. return GetUserListRequest(
  101. keyword: map['Keyword'],
  102. organizationQueryType: OrganizationQueryTypeEnum.values.firstWhere((e) => e.index == map['OrganizationQueryType']),
  103. organizationCode: map['OrganizationCode'],
  104. rankCode: map['RankCode'],
  105. positionCode: map['PositionCode'],
  106. exceptSelf: map['ExceptSelf'],
  107. language: map['Language'],
  108. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  109. token: map['Token'],
  110. );
  111. }
  112. Map<String, dynamic> toJson() {
  113. final map = super.toJson();
  114. if(keyword != null)
  115. map['Keyword'] = keyword;
  116. map['OrganizationQueryType'] = organizationQueryType.index;
  117. if(organizationCode != null)
  118. map['OrganizationCode'] = organizationCode;
  119. if(rankCode != null)
  120. map['RankCode'] = rankCode;
  121. if(positionCode != null)
  122. map['PositionCode'] = positionCode;
  123. map['ExceptSelf'] = exceptSelf;
  124. if(language != null)
  125. map['Language'] = language;
  126. if(roleCodes != null)
  127. map['RoleCodes'] = roleCodes;
  128. return map;
  129. }
  130. }
  131. class RemoveUsersFromOrganizationRequest extends TokenRequest{
  132. List<String >? userCodes;
  133. RemoveUsersFromOrganizationRequest({
  134. this.userCodes,
  135. String? token,
  136. }) : super(
  137. token: token,
  138. );
  139. factory RemoveUsersFromOrganizationRequest.fromJson(Map<String, dynamic> map) {
  140. return RemoveUsersFromOrganizationRequest(
  141. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  142. token: map['Token'],
  143. );
  144. }
  145. Map<String, dynamic> toJson() {
  146. final map = super.toJson();
  147. if(userCodes != null)
  148. map['UserCodes'] = userCodes;
  149. return map;
  150. }
  151. }
  152. class SetUserOrganizationInfoRequest extends TokenRequest{
  153. String? userCode;
  154. List<String >? roleCodes;
  155. List<String >? rankCodes;
  156. List<String >? positionCodes;
  157. String? organizationCode;
  158. SetUserOrganizationInfoRequest({
  159. this.userCode,
  160. this.roleCodes,
  161. this.rankCodes,
  162. this.positionCodes,
  163. this.organizationCode,
  164. String? token,
  165. }) : super(
  166. token: token,
  167. );
  168. factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
  169. return SetUserOrganizationInfoRequest(
  170. userCode: map['UserCode'],
  171. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  172. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  173. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  174. organizationCode: map['OrganizationCode'],
  175. token: map['Token'],
  176. );
  177. }
  178. Map<String, dynamic> toJson() {
  179. final map = super.toJson();
  180. if(userCode != null)
  181. map['UserCode'] = userCode;
  182. if(roleCodes != null)
  183. map['RoleCodes'] = roleCodes;
  184. if(rankCodes != null)
  185. map['RankCodes'] = rankCodes;
  186. if(positionCodes != null)
  187. map['PositionCodes'] = positionCodes;
  188. if(organizationCode != null)
  189. map['OrganizationCode'] = organizationCode;
  190. return map;
  191. }
  192. }
  193. class AlterPersonInfoRequest {
  194. String? token;
  195. String? nickName;
  196. String? headImageUrl;
  197. AlterPersonInfoRequest({
  198. this.token,
  199. this.nickName,
  200. this.headImageUrl,
  201. });
  202. factory AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
  203. return AlterPersonInfoRequest(
  204. token: map['Token'],
  205. nickName: map['NickName'],
  206. headImageUrl: map['HeadImageUrl'],
  207. );
  208. }
  209. Map<String, dynamic> toJson() {
  210. final map = Map<String, dynamic>();
  211. if(token != null)
  212. map['Token'] = token;
  213. if(nickName != null)
  214. map['NickName'] = nickName;
  215. if(headImageUrl != null)
  216. map['HeadImageUrl'] = headImageUrl;
  217. return map;
  218. }
  219. }
  220. class ShareDeviceUserDTO extends BaseDTO{
  221. String? userCode;
  222. String? fullName;
  223. String? phone;
  224. String? headImageUrl;
  225. List<String >? rankNames;
  226. String? rootOrganizationCode;
  227. String? rootOrganizationName;
  228. ShareDeviceUserDTO({
  229. this.userCode,
  230. this.fullName,
  231. this.phone,
  232. this.headImageUrl,
  233. this.rankNames,
  234. this.rootOrganizationCode,
  235. this.rootOrganizationName,
  236. DateTime? createTime,
  237. DateTime? updateTime,
  238. }) : super(
  239. createTime: createTime,
  240. updateTime: updateTime,
  241. );
  242. factory ShareDeviceUserDTO.fromJson(Map<String, dynamic> map) {
  243. return ShareDeviceUserDTO(
  244. userCode: map['UserCode'],
  245. fullName: map['FullName'],
  246. phone: map['Phone'],
  247. headImageUrl: map['HeadImageUrl'],
  248. rankNames: map['RankNames'] != null ? map['RankNames'].cast<String>().toList() : null,
  249. rootOrganizationCode: map['RootOrganizationCode'],
  250. rootOrganizationName: map['RootOrganizationName'],
  251. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  252. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  253. );
  254. }
  255. Map<String, dynamic> toJson() {
  256. final map = super.toJson();
  257. if(userCode != null)
  258. map['UserCode'] = userCode;
  259. if(fullName != null)
  260. map['FullName'] = fullName;
  261. if(phone != null)
  262. map['Phone'] = phone;
  263. if(headImageUrl != null)
  264. map['HeadImageUrl'] = headImageUrl;
  265. if(rankNames != null)
  266. map['RankNames'] = rankNames;
  267. if(rootOrganizationCode != null)
  268. map['RootOrganizationCode'] = rootOrganizationCode;
  269. if(rootOrganizationName != null)
  270. map['RootOrganizationName'] = rootOrganizationName;
  271. return map;
  272. }
  273. }
  274. class GetShareDeviceUsersPageRequest extends PageRequest{
  275. String? deviceCode;
  276. GetShareDeviceUsersPageRequest({
  277. this.deviceCode,
  278. int pageIndex = 0,
  279. int pageSize = 0,
  280. String? token,
  281. }) : super(
  282. pageIndex: pageIndex,
  283. pageSize: pageSize,
  284. token: token,
  285. );
  286. factory GetShareDeviceUsersPageRequest.fromJson(Map<String, dynamic> map) {
  287. return GetShareDeviceUsersPageRequest(
  288. deviceCode: map['DeviceCode'],
  289. pageIndex: map['PageIndex'],
  290. pageSize: map['PageSize'],
  291. token: map['Token'],
  292. );
  293. }
  294. Map<String, dynamic> toJson() {
  295. final map = super.toJson();
  296. if(deviceCode != null)
  297. map['DeviceCode'] = deviceCode;
  298. return map;
  299. }
  300. }
  301. class UserFeatureInfoResult {
  302. String? featureCode;
  303. String? featureName;
  304. String? fatherCode;
  305. String? uniqueCode;
  306. UserFeatureInfoResult({
  307. this.featureCode,
  308. this.featureName,
  309. this.fatherCode,
  310. this.uniqueCode,
  311. });
  312. factory UserFeatureInfoResult.fromJson(Map<String, dynamic> map) {
  313. return UserFeatureInfoResult(
  314. featureCode: map['FeatureCode'],
  315. featureName: map['FeatureName'],
  316. fatherCode: map['FatherCode'],
  317. uniqueCode: map['UniqueCode'],
  318. );
  319. }
  320. Map<String, dynamic> toJson() {
  321. final map = Map<String, dynamic>();
  322. if(featureCode != null)
  323. map['FeatureCode'] = featureCode;
  324. if(featureName != null)
  325. map['FeatureName'] = featureName;
  326. if(fatherCode != null)
  327. map['FatherCode'] = fatherCode;
  328. if(uniqueCode != null)
  329. map['UniqueCode'] = uniqueCode;
  330. return map;
  331. }
  332. }
  333. class UserInfoByCodeDTO extends UserDTO{
  334. String? bindAssistantUserName;
  335. String? bindAssistantDoctorUserName;
  336. UserInfoByCodeDTO({
  337. this.bindAssistantUserName,
  338. this.bindAssistantDoctorUserName,
  339. String? phone,
  340. String? email,
  341. String? nickName,
  342. String? fullName,
  343. String? organizationCode,
  344. String? organizationName,
  345. String? rootOrganizationCode,
  346. String? rootOrganizationName,
  347. List<String >? authorityGroups,
  348. List<String >? bindDevices,
  349. String? lastIP,
  350. int logintimes = 0,
  351. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  352. List<String >? roleCodes,
  353. List<String >? rankCodes,
  354. List<String >? positionCodes,
  355. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  356. String? rankName,
  357. String? positionName,
  358. bool isDirector = false,
  359. List<String >? fieldList,
  360. List<String >? deletePatientCodes,
  361. bool isBatchExportDiagnoseData = false,
  362. String? bindAssistantUserCode,
  363. String? bindAssistantDoctorUserCode,
  364. LoginLockInfoDTO? loginLockInfo,
  365. String? signature,
  366. String? language,
  367. bool enableReportLabel = false,
  368. String? userCode,
  369. String? userName,
  370. String? headImageUrl,
  371. DateTime? createTime,
  372. DateTime? updateTime,
  373. }) : super(
  374. phone: phone,
  375. email: email,
  376. nickName: nickName,
  377. fullName: fullName,
  378. organizationCode: organizationCode,
  379. organizationName: organizationName,
  380. rootOrganizationCode: rootOrganizationCode,
  381. rootOrganizationName: rootOrganizationName,
  382. authorityGroups: authorityGroups,
  383. bindDevices: bindDevices,
  384. lastIP: lastIP,
  385. logintimes: logintimes,
  386. userState: userState,
  387. roleCodes: roleCodes,
  388. rankCodes: rankCodes,
  389. positionCodes: positionCodes,
  390. applyState: applyState,
  391. rankName: rankName,
  392. positionName: positionName,
  393. isDirector: isDirector,
  394. fieldList: fieldList,
  395. deletePatientCodes: deletePatientCodes,
  396. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  397. bindAssistantUserCode: bindAssistantUserCode,
  398. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  399. loginLockInfo: loginLockInfo,
  400. signature: signature,
  401. language: language,
  402. enableReportLabel: enableReportLabel,
  403. userCode: userCode,
  404. userName: userName,
  405. headImageUrl: headImageUrl,
  406. createTime: createTime,
  407. updateTime: updateTime,
  408. );
  409. factory UserInfoByCodeDTO.fromJson(Map<String, dynamic> map) {
  410. return UserInfoByCodeDTO(
  411. bindAssistantUserName: map['BindAssistantUserName'],
  412. bindAssistantDoctorUserName: map['BindAssistantDoctorUserName'],
  413. phone: map['Phone'],
  414. email: map['Email'],
  415. nickName: map['NickName'],
  416. fullName: map['FullName'],
  417. organizationCode: map['OrganizationCode'],
  418. organizationName: map['OrganizationName'],
  419. rootOrganizationCode: map['RootOrganizationCode'],
  420. rootOrganizationName: map['RootOrganizationName'],
  421. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  422. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  423. lastIP: map['LastIP'],
  424. logintimes: map['Logintimes'],
  425. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  426. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  427. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  428. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  429. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  430. rankName: map['RankName'],
  431. positionName: map['PositionName'],
  432. isDirector: map['IsDirector'],
  433. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  434. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  435. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  436. bindAssistantUserCode: map['BindAssistantUserCode'],
  437. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  438. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  439. signature: map['Signature'],
  440. language: map['Language'],
  441. enableReportLabel: map['EnableReportLabel'],
  442. userCode: map['UserCode'],
  443. userName: map['UserName'],
  444. headImageUrl: map['HeadImageUrl'],
  445. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  446. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  447. );
  448. }
  449. Map<String, dynamic> toJson() {
  450. final map = super.toJson();
  451. if(bindAssistantUserName != null)
  452. map['BindAssistantUserName'] = bindAssistantUserName;
  453. if(bindAssistantDoctorUserName != null)
  454. map['BindAssistantDoctorUserName'] = bindAssistantDoctorUserName;
  455. return map;
  456. }
  457. }
  458. class GetUserByCodeRequest extends TokenRequest{
  459. String? userCode;
  460. GetUserByCodeRequest({
  461. this.userCode,
  462. String? token,
  463. }) : super(
  464. token: token,
  465. );
  466. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  467. return GetUserByCodeRequest(
  468. userCode: map['UserCode'],
  469. token: map['Token'],
  470. );
  471. }
  472. Map<String, dynamic> toJson() {
  473. final map = super.toJson();
  474. if(userCode != null)
  475. map['UserCode'] = userCode;
  476. return map;
  477. }
  478. }
  479. enum CommonSettingsEnum {
  480. Signature,
  481. Language,
  482. EnableReportLabel,
  483. }
  484. class CommonSettingsRequest extends TokenRequest{
  485. CommonSettingsEnum settingType;
  486. String? value;
  487. CommonSettingsRequest({
  488. this.settingType = CommonSettingsEnum.Signature,
  489. this.value,
  490. String? token,
  491. }) : super(
  492. token: token,
  493. );
  494. factory CommonSettingsRequest.fromJson(Map<String, dynamic> map) {
  495. return CommonSettingsRequest(
  496. settingType: CommonSettingsEnum.values.firstWhere((e) => e.index == map['SettingType']),
  497. value: map['Value'],
  498. token: map['Token'],
  499. );
  500. }
  501. Map<String, dynamic> toJson() {
  502. final map = super.toJson();
  503. map['SettingType'] = settingType.index;
  504. if(value != null)
  505. map['Value'] = value;
  506. return map;
  507. }
  508. }
  509. class RefreshStaticticRecordsRequest {
  510. String? userCode;
  511. bool inExecutor;
  512. RefreshStaticticRecordsRequest({
  513. this.userCode,
  514. this.inExecutor = false,
  515. });
  516. factory RefreshStaticticRecordsRequest.fromJson(Map<String, dynamic> map) {
  517. return RefreshStaticticRecordsRequest(
  518. userCode: map['UserCode'],
  519. inExecutor: map['InExecutor'],
  520. );
  521. }
  522. Map<String, dynamic> toJson() {
  523. final map = Map<String, dynamic>();
  524. if(userCode != null)
  525. map['UserCode'] = userCode;
  526. map['InExecutor'] = inExecutor;
  527. return map;
  528. }
  529. }
  530. enum ScheduleTypeEnum {
  531. Consultation,
  532. Training,
  533. }
  534. class ClientScheduleDTO {
  535. String? title;
  536. TransactionStatusEnum status;
  537. ScheduleTypeEnum scheduleType;
  538. DateTime? startTime;
  539. DateTime? endTime;
  540. String? relevanceCode;
  541. ClientScheduleDTO({
  542. this.title,
  543. this.status = TransactionStatusEnum.Applied,
  544. this.scheduleType = ScheduleTypeEnum.Consultation,
  545. this.startTime,
  546. this.endTime,
  547. this.relevanceCode,
  548. });
  549. factory ClientScheduleDTO.fromJson(Map<String, dynamic> map) {
  550. return ClientScheduleDTO(
  551. title: map['Title'],
  552. status: TransactionStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  553. scheduleType: ScheduleTypeEnum.values.firstWhere((e) => e.index == map['ScheduleType']),
  554. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  555. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  556. relevanceCode: map['RelevanceCode'],
  557. );
  558. }
  559. Map<String, dynamic> toJson() {
  560. final map = Map<String, dynamic>();
  561. if(title != null)
  562. map['Title'] = title;
  563. map['Status'] = status.index;
  564. map['ScheduleType'] = scheduleType.index;
  565. if(startTime != null)
  566. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  567. if(endTime != null)
  568. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  569. if(relevanceCode != null)
  570. map['RelevanceCode'] = relevanceCode;
  571. return map;
  572. }
  573. }
  574. class FindSchedulesRequest extends TokenRequest{
  575. DateTime? startTime;
  576. DateTime? endTime;
  577. FindSchedulesRequest({
  578. this.startTime,
  579. this.endTime,
  580. String? token,
  581. }) : super(
  582. token: token,
  583. );
  584. factory FindSchedulesRequest.fromJson(Map<String, dynamic> map) {
  585. return FindSchedulesRequest(
  586. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  587. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  588. token: map['Token'],
  589. );
  590. }
  591. Map<String, dynamic> toJson() {
  592. final map = super.toJson();
  593. if(startTime != null)
  594. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  595. if(endTime != null)
  596. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  597. return map;
  598. }
  599. }
  600. enum ApplicantTypeEnum {
  601. Client,
  602. Device,
  603. Management,
  604. ThirdParty,
  605. Server,
  606. }
  607. class MessageExtendInfoDTO extends BaseDTO{
  608. String? messageCode;
  609. NotificationTypeEnum notificationType;
  610. String? content;
  611. DateTime? notifyTime;
  612. ApplicantTypeEnum receiverType;
  613. String? relevanceCode;
  614. bool isReaded;
  615. DateTime? deliveryTime;
  616. DateTime? readTime;
  617. MessageExtendInfoDTO({
  618. this.messageCode,
  619. this.notificationType = NotificationTypeEnum.Unknown,
  620. this.content,
  621. this.notifyTime,
  622. this.receiverType = ApplicantTypeEnum.Client,
  623. this.relevanceCode,
  624. this.isReaded = false,
  625. this.deliveryTime,
  626. this.readTime,
  627. DateTime? createTime,
  628. DateTime? updateTime,
  629. }) : super(
  630. createTime: createTime,
  631. updateTime: updateTime,
  632. );
  633. factory MessageExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  634. return MessageExtendInfoDTO(
  635. messageCode: map['MessageCode'],
  636. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  637. content: map['Content'],
  638. notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
  639. receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
  640. relevanceCode: map['RelevanceCode'],
  641. isReaded: map['IsReaded'],
  642. deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
  643. readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
  644. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  645. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  646. );
  647. }
  648. Map<String, dynamic> toJson() {
  649. final map = super.toJson();
  650. if(messageCode != null)
  651. map['MessageCode'] = messageCode;
  652. map['NotificationType'] = notificationType.index;
  653. if(content != null)
  654. map['Content'] = content;
  655. if(notifyTime != null)
  656. map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
  657. map['ReceiverType'] = receiverType.index;
  658. if(relevanceCode != null)
  659. map['RelevanceCode'] = relevanceCode;
  660. map['IsReaded'] = isReaded;
  661. if(deliveryTime != null)
  662. map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
  663. if(readTime != null)
  664. map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
  665. return map;
  666. }
  667. }
  668. enum TransactionTypeEnum {
  669. placeHolder_0,
  670. Consultion,
  671. Chat,
  672. Announcement,
  673. Session,
  674. RemoteDia,
  675. ControlParameter,
  676. Education,
  677. Upgrade,
  678. Live,
  679. RemoteControl,
  680. }
  681. class QueryMessageListRequest extends PageRequest{
  682. TransactionTypeEnum transactionType;
  683. String? keyword;
  684. QueryMessageListRequest({
  685. this.transactionType = TransactionTypeEnum.Consultion,
  686. this.keyword,
  687. int pageIndex = 0,
  688. int pageSize = 0,
  689. String? token,
  690. }) : super(
  691. pageIndex: pageIndex,
  692. pageSize: pageSize,
  693. token: token,
  694. );
  695. factory QueryMessageListRequest.fromJson(Map<String, dynamic> map) {
  696. return QueryMessageListRequest(
  697. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  698. keyword: map['Keyword'],
  699. pageIndex: map['PageIndex'],
  700. pageSize: map['PageSize'],
  701. token: map['Token'],
  702. );
  703. }
  704. Map<String, dynamic> toJson() {
  705. final map = super.toJson();
  706. map['TransactionType'] = transactionType.index;
  707. if(keyword != null)
  708. map['Keyword'] = keyword;
  709. return map;
  710. }
  711. }
  712. class SetMessageDeliveryRequest extends TokenRequest{
  713. String? messageCode;
  714. bool isReaded;
  715. SetMessageDeliveryRequest({
  716. this.messageCode,
  717. this.isReaded = false,
  718. String? token,
  719. }) : super(
  720. token: token,
  721. );
  722. factory SetMessageDeliveryRequest.fromJson(Map<String, dynamic> map) {
  723. return SetMessageDeliveryRequest(
  724. messageCode: map['MessageCode'],
  725. isReaded: map['IsReaded'],
  726. token: map['Token'],
  727. );
  728. }
  729. Map<String, dynamic> toJson() {
  730. final map = super.toJson();
  731. if(messageCode != null)
  732. map['MessageCode'] = messageCode;
  733. map['IsReaded'] = isReaded;
  734. return map;
  735. }
  736. }
  737. class SetMessageInfoReqeust extends TokenRequest{
  738. List<String >? messageCodes;
  739. SetMessageInfoReqeust({
  740. this.messageCodes,
  741. String? token,
  742. }) : super(
  743. token: token,
  744. );
  745. factory SetMessageInfoReqeust.fromJson(Map<String, dynamic> map) {
  746. return SetMessageInfoReqeust(
  747. messageCodes: map['MessageCodes'] != null ? map['MessageCodes'].cast<String>().toList() : null,
  748. token: map['Token'],
  749. );
  750. }
  751. Map<String, dynamic> toJson() {
  752. final map = super.toJson();
  753. if(messageCodes != null)
  754. map['MessageCodes'] = messageCodes;
  755. return map;
  756. }
  757. }
  758. class AnnouncementExtendInfoDTO extends BaseDTO{
  759. String? announcementCode;
  760. AnnouncementTypeEnum announcementType;
  761. String? language;
  762. String? title;
  763. String? content;
  764. AnnouncementExtendInfoDTO({
  765. this.announcementCode,
  766. this.announcementType = AnnouncementTypeEnum.Broadcast,
  767. this.language,
  768. this.title,
  769. this.content,
  770. DateTime? createTime,
  771. DateTime? updateTime,
  772. }) : super(
  773. createTime: createTime,
  774. updateTime: updateTime,
  775. );
  776. factory AnnouncementExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  777. return AnnouncementExtendInfoDTO(
  778. announcementCode: map['AnnouncementCode'],
  779. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  780. language: map['Language'],
  781. title: map['Title'],
  782. content: map['Content'],
  783. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  784. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  785. );
  786. }
  787. Map<String, dynamic> toJson() {
  788. final map = super.toJson();
  789. if(announcementCode != null)
  790. map['AnnouncementCode'] = announcementCode;
  791. map['AnnouncementType'] = announcementType.index;
  792. if(language != null)
  793. map['Language'] = language;
  794. if(title != null)
  795. map['Title'] = title;
  796. if(content != null)
  797. map['Content'] = content;
  798. return map;
  799. }
  800. }
  801. class QueryAnnouncementListRequest extends PageRequest{
  802. AnnouncementTypeEnum announcementType;
  803. String? language;
  804. String? keyword;
  805. DateTime? startTime;
  806. DateTime? endTime;
  807. QueryAnnouncementListRequest({
  808. this.announcementType = AnnouncementTypeEnum.Broadcast,
  809. this.language,
  810. this.keyword,
  811. this.startTime,
  812. this.endTime,
  813. int pageIndex = 0,
  814. int pageSize = 0,
  815. String? token,
  816. }) : super(
  817. pageIndex: pageIndex,
  818. pageSize: pageSize,
  819. token: token,
  820. );
  821. factory QueryAnnouncementListRequest.fromJson(Map<String, dynamic> map) {
  822. return QueryAnnouncementListRequest(
  823. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  824. language: map['Language'],
  825. keyword: map['Keyword'],
  826. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  827. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  828. pageIndex: map['PageIndex'],
  829. pageSize: map['PageSize'],
  830. token: map['Token'],
  831. );
  832. }
  833. Map<String, dynamic> toJson() {
  834. final map = super.toJson();
  835. map['AnnouncementType'] = announcementType.index;
  836. if(language != null)
  837. map['Language'] = language;
  838. if(keyword != null)
  839. map['Keyword'] = keyword;
  840. if(startTime != null)
  841. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  842. if(endTime != null)
  843. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  844. return map;
  845. }
  846. }
  847. class GetAnnouncementRequest extends TokenRequest{
  848. String? announcementCode;
  849. String? language;
  850. GetAnnouncementRequest({
  851. this.announcementCode,
  852. this.language,
  853. String? token,
  854. }) : super(
  855. token: token,
  856. );
  857. factory GetAnnouncementRequest.fromJson(Map<String, dynamic> map) {
  858. return GetAnnouncementRequest(
  859. announcementCode: map['AnnouncementCode'],
  860. language: map['Language'],
  861. token: map['Token'],
  862. );
  863. }
  864. Map<String, dynamic> toJson() {
  865. final map = super.toJson();
  866. if(announcementCode != null)
  867. map['AnnouncementCode'] = announcementCode;
  868. if(language != null)
  869. map['Language'] = language;
  870. return map;
  871. }
  872. }
  873. class NoReadMessagesDTO {
  874. int count;
  875. List<String >? noReadCodes;
  876. NoReadMessagesDTO({
  877. this.count = 0,
  878. this.noReadCodes,
  879. });
  880. factory NoReadMessagesDTO.fromJson(Map<String, dynamic> map) {
  881. return NoReadMessagesDTO(
  882. count: map['Count'],
  883. noReadCodes: map['NoReadCodes'] != null ? map['NoReadCodes'].cast<String>().toList() : null,
  884. );
  885. }
  886. Map<String, dynamic> toJson() {
  887. final map = Map<String, dynamic>();
  888. map['Count'] = count;
  889. if(noReadCodes != null)
  890. map['NoReadCodes'] = noReadCodes;
  891. return map;
  892. }
  893. }
  894. class GetNoReadMessagesRequest extends TokenRequest{
  895. TransactionTypeEnum transactionType;
  896. GetNoReadMessagesRequest({
  897. this.transactionType = TransactionTypeEnum.Consultion,
  898. String? token,
  899. }) : super(
  900. token: token,
  901. );
  902. factory GetNoReadMessagesRequest.fromJson(Map<String, dynamic> map) {
  903. return GetNoReadMessagesRequest(
  904. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  905. token: map['Token'],
  906. );
  907. }
  908. Map<String, dynamic> toJson() {
  909. final map = super.toJson();
  910. map['TransactionType'] = transactionType.index;
  911. return map;
  912. }
  913. }
  914. class RemoveUserSingleTokenRequest extends TokenRequest{
  915. String? wSToken;
  916. RemoveUserSingleTokenRequest({
  917. this.wSToken,
  918. String? token,
  919. }) : super(
  920. token: token,
  921. );
  922. factory RemoveUserSingleTokenRequest.fromJson(Map<String, dynamic> map) {
  923. return RemoveUserSingleTokenRequest(
  924. wSToken: map['WSToken'],
  925. token: map['Token'],
  926. );
  927. }
  928. Map<String, dynamic> toJson() {
  929. final map = super.toJson();
  930. if(wSToken != null)
  931. map['WSToken'] = wSToken;
  932. return map;
  933. }
  934. }