user.m.dart 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  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. List<AssociatedInfoDTO >? associatedInfos,
  369. String? userCode,
  370. String? userName,
  371. String? headImageUrl,
  372. DateTime? createTime,
  373. DateTime? updateTime,
  374. }) : super(
  375. phone: phone,
  376. email: email,
  377. nickName: nickName,
  378. fullName: fullName,
  379. organizationCode: organizationCode,
  380. organizationName: organizationName,
  381. rootOrganizationCode: rootOrganizationCode,
  382. rootOrganizationName: rootOrganizationName,
  383. authorityGroups: authorityGroups,
  384. bindDevices: bindDevices,
  385. lastIP: lastIP,
  386. logintimes: logintimes,
  387. userState: userState,
  388. roleCodes: roleCodes,
  389. rankCodes: rankCodes,
  390. positionCodes: positionCodes,
  391. applyState: applyState,
  392. rankName: rankName,
  393. positionName: positionName,
  394. isDirector: isDirector,
  395. fieldList: fieldList,
  396. deletePatientCodes: deletePatientCodes,
  397. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  398. bindAssistantUserCode: bindAssistantUserCode,
  399. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  400. loginLockInfo: loginLockInfo,
  401. signature: signature,
  402. language: language,
  403. enableReportLabel: enableReportLabel,
  404. associatedInfos: associatedInfos,
  405. userCode: userCode,
  406. userName: userName,
  407. headImageUrl: headImageUrl,
  408. createTime: createTime,
  409. updateTime: updateTime,
  410. );
  411. factory UserInfoByCodeDTO.fromJson(Map<String, dynamic> map) {
  412. return UserInfoByCodeDTO(
  413. bindAssistantUserName: map['BindAssistantUserName'],
  414. bindAssistantDoctorUserName: map['BindAssistantDoctorUserName'],
  415. phone: map['Phone'],
  416. email: map['Email'],
  417. nickName: map['NickName'],
  418. fullName: map['FullName'],
  419. organizationCode: map['OrganizationCode'],
  420. organizationName: map['OrganizationName'],
  421. rootOrganizationCode: map['RootOrganizationCode'],
  422. rootOrganizationName: map['RootOrganizationName'],
  423. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  424. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  425. lastIP: map['LastIP'],
  426. logintimes: map['Logintimes'],
  427. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  428. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  429. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  430. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  431. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  432. rankName: map['RankName'],
  433. positionName: map['PositionName'],
  434. isDirector: map['IsDirector'],
  435. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  436. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  437. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  438. bindAssistantUserCode: map['BindAssistantUserCode'],
  439. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  440. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  441. signature: map['Signature'],
  442. language: map['Language'],
  443. enableReportLabel: map['EnableReportLabel'],
  444. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  445. userCode: map['UserCode'],
  446. userName: map['UserName'],
  447. headImageUrl: map['HeadImageUrl'],
  448. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  449. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  450. );
  451. }
  452. Map<String, dynamic> toJson() {
  453. final map = super.toJson();
  454. if(bindAssistantUserName != null)
  455. map['BindAssistantUserName'] = bindAssistantUserName;
  456. if(bindAssistantDoctorUserName != null)
  457. map['BindAssistantDoctorUserName'] = bindAssistantDoctorUserName;
  458. return map;
  459. }
  460. }
  461. class GetUserByCodeRequest extends TokenRequest{
  462. String? userCode;
  463. GetUserByCodeRequest({
  464. this.userCode,
  465. String? token,
  466. }) : super(
  467. token: token,
  468. );
  469. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  470. return GetUserByCodeRequest(
  471. userCode: map['UserCode'],
  472. token: map['Token'],
  473. );
  474. }
  475. Map<String, dynamic> toJson() {
  476. final map = super.toJson();
  477. if(userCode != null)
  478. map['UserCode'] = userCode;
  479. return map;
  480. }
  481. }
  482. enum CommonSettingsEnum {
  483. Signature,
  484. Language,
  485. EnableReportLabel,
  486. }
  487. class CommonSettingsRequest extends TokenRequest{
  488. CommonSettingsEnum settingType;
  489. String? value;
  490. CommonSettingsRequest({
  491. this.settingType = CommonSettingsEnum.Signature,
  492. this.value,
  493. String? token,
  494. }) : super(
  495. token: token,
  496. );
  497. factory CommonSettingsRequest.fromJson(Map<String, dynamic> map) {
  498. return CommonSettingsRequest(
  499. settingType: CommonSettingsEnum.values.firstWhere((e) => e.index == map['SettingType']),
  500. value: map['Value'],
  501. token: map['Token'],
  502. );
  503. }
  504. Map<String, dynamic> toJson() {
  505. final map = super.toJson();
  506. map['SettingType'] = settingType.index;
  507. if(value != null)
  508. map['Value'] = value;
  509. return map;
  510. }
  511. }
  512. class RefreshStaticticRecordsRequest {
  513. String? userCode;
  514. bool inExecutor;
  515. RefreshStaticticRecordsRequest({
  516. this.userCode,
  517. this.inExecutor = false,
  518. });
  519. factory RefreshStaticticRecordsRequest.fromJson(Map<String, dynamic> map) {
  520. return RefreshStaticticRecordsRequest(
  521. userCode: map['UserCode'],
  522. inExecutor: map['InExecutor'],
  523. );
  524. }
  525. Map<String, dynamic> toJson() {
  526. final map = Map<String, dynamic>();
  527. if(userCode != null)
  528. map['UserCode'] = userCode;
  529. map['InExecutor'] = inExecutor;
  530. return map;
  531. }
  532. }
  533. enum ScheduleTypeEnum {
  534. Consultation,
  535. Training,
  536. }
  537. class ClientScheduleDTO {
  538. String? title;
  539. TransactionStatusEnum status;
  540. ScheduleTypeEnum scheduleType;
  541. DateTime? startTime;
  542. DateTime? endTime;
  543. String? relevanceCode;
  544. ClientScheduleDTO({
  545. this.title,
  546. this.status = TransactionStatusEnum.Applied,
  547. this.scheduleType = ScheduleTypeEnum.Consultation,
  548. this.startTime,
  549. this.endTime,
  550. this.relevanceCode,
  551. });
  552. factory ClientScheduleDTO.fromJson(Map<String, dynamic> map) {
  553. return ClientScheduleDTO(
  554. title: map['Title'],
  555. status: TransactionStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  556. scheduleType: ScheduleTypeEnum.values.firstWhere((e) => e.index == map['ScheduleType']),
  557. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  558. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  559. relevanceCode: map['RelevanceCode'],
  560. );
  561. }
  562. Map<String, dynamic> toJson() {
  563. final map = Map<String, dynamic>();
  564. if(title != null)
  565. map['Title'] = title;
  566. map['Status'] = status.index;
  567. map['ScheduleType'] = scheduleType.index;
  568. if(startTime != null)
  569. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  570. if(endTime != null)
  571. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  572. if(relevanceCode != null)
  573. map['RelevanceCode'] = relevanceCode;
  574. return map;
  575. }
  576. }
  577. class FindSchedulesRequest extends TokenRequest{
  578. DateTime? startTime;
  579. DateTime? endTime;
  580. FindSchedulesRequest({
  581. this.startTime,
  582. this.endTime,
  583. String? token,
  584. }) : super(
  585. token: token,
  586. );
  587. factory FindSchedulesRequest.fromJson(Map<String, dynamic> map) {
  588. return FindSchedulesRequest(
  589. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  590. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  591. token: map['Token'],
  592. );
  593. }
  594. Map<String, dynamic> toJson() {
  595. final map = super.toJson();
  596. if(startTime != null)
  597. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  598. if(endTime != null)
  599. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  600. return map;
  601. }
  602. }
  603. enum ApplicantTypeEnum {
  604. Client,
  605. Device,
  606. Management,
  607. ThirdParty,
  608. Server,
  609. }
  610. class MessageExtendInfoDTO extends BaseDTO{
  611. String? messageCode;
  612. NotificationTypeEnum notificationType;
  613. String? content;
  614. DateTime? notifyTime;
  615. ApplicantTypeEnum receiverType;
  616. String? relevanceCode;
  617. bool isReaded;
  618. DateTime? deliveryTime;
  619. DateTime? readTime;
  620. MessageExtendInfoDTO({
  621. this.messageCode,
  622. this.notificationType = NotificationTypeEnum.Unknown,
  623. this.content,
  624. this.notifyTime,
  625. this.receiverType = ApplicantTypeEnum.Client,
  626. this.relevanceCode,
  627. this.isReaded = false,
  628. this.deliveryTime,
  629. this.readTime,
  630. DateTime? createTime,
  631. DateTime? updateTime,
  632. }) : super(
  633. createTime: createTime,
  634. updateTime: updateTime,
  635. );
  636. factory MessageExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  637. return MessageExtendInfoDTO(
  638. messageCode: map['MessageCode'],
  639. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  640. content: map['Content'],
  641. notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
  642. receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
  643. relevanceCode: map['RelevanceCode'],
  644. isReaded: map['IsReaded'],
  645. deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
  646. readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
  647. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  648. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  649. );
  650. }
  651. Map<String, dynamic> toJson() {
  652. final map = super.toJson();
  653. if(messageCode != null)
  654. map['MessageCode'] = messageCode;
  655. map['NotificationType'] = notificationType.index;
  656. if(content != null)
  657. map['Content'] = content;
  658. if(notifyTime != null)
  659. map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
  660. map['ReceiverType'] = receiverType.index;
  661. if(relevanceCode != null)
  662. map['RelevanceCode'] = relevanceCode;
  663. map['IsReaded'] = isReaded;
  664. if(deliveryTime != null)
  665. map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
  666. if(readTime != null)
  667. map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
  668. return map;
  669. }
  670. }
  671. enum TransactionTypeEnum {
  672. placeHolder_0,
  673. Consultion,
  674. Chat,
  675. Announcement,
  676. Session,
  677. RemoteDia,
  678. ControlParameter,
  679. Education,
  680. Upgrade,
  681. Live,
  682. RemoteControl,
  683. }
  684. class QueryMessageListRequest extends PageRequest{
  685. TransactionTypeEnum transactionType;
  686. String? keyword;
  687. QueryMessageListRequest({
  688. this.transactionType = TransactionTypeEnum.Consultion,
  689. this.keyword,
  690. int pageIndex = 0,
  691. int pageSize = 0,
  692. String? token,
  693. }) : super(
  694. pageIndex: pageIndex,
  695. pageSize: pageSize,
  696. token: token,
  697. );
  698. factory QueryMessageListRequest.fromJson(Map<String, dynamic> map) {
  699. return QueryMessageListRequest(
  700. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  701. keyword: map['Keyword'],
  702. pageIndex: map['PageIndex'],
  703. pageSize: map['PageSize'],
  704. token: map['Token'],
  705. );
  706. }
  707. Map<String, dynamic> toJson() {
  708. final map = super.toJson();
  709. map['TransactionType'] = transactionType.index;
  710. if(keyword != null)
  711. map['Keyword'] = keyword;
  712. return map;
  713. }
  714. }
  715. class SetMessageDeliveryRequest extends TokenRequest{
  716. String? messageCode;
  717. bool isReaded;
  718. SetMessageDeliveryRequest({
  719. this.messageCode,
  720. this.isReaded = false,
  721. String? token,
  722. }) : super(
  723. token: token,
  724. );
  725. factory SetMessageDeliveryRequest.fromJson(Map<String, dynamic> map) {
  726. return SetMessageDeliveryRequest(
  727. messageCode: map['MessageCode'],
  728. isReaded: map['IsReaded'],
  729. token: map['Token'],
  730. );
  731. }
  732. Map<String, dynamic> toJson() {
  733. final map = super.toJson();
  734. if(messageCode != null)
  735. map['MessageCode'] = messageCode;
  736. map['IsReaded'] = isReaded;
  737. return map;
  738. }
  739. }
  740. class SetMessageInfoReqeust extends TokenRequest{
  741. List<String >? messageCodes;
  742. SetMessageInfoReqeust({
  743. this.messageCodes,
  744. String? token,
  745. }) : super(
  746. token: token,
  747. );
  748. factory SetMessageInfoReqeust.fromJson(Map<String, dynamic> map) {
  749. return SetMessageInfoReqeust(
  750. messageCodes: map['MessageCodes'] != null ? map['MessageCodes'].cast<String>().toList() : null,
  751. token: map['Token'],
  752. );
  753. }
  754. Map<String, dynamic> toJson() {
  755. final map = super.toJson();
  756. if(messageCodes != null)
  757. map['MessageCodes'] = messageCodes;
  758. return map;
  759. }
  760. }
  761. class AnnouncementExtendInfoDTO extends BaseDTO{
  762. String? announcementCode;
  763. AnnouncementTypeEnum announcementType;
  764. String? language;
  765. String? title;
  766. String? content;
  767. AnnouncementExtendInfoDTO({
  768. this.announcementCode,
  769. this.announcementType = AnnouncementTypeEnum.Broadcast,
  770. this.language,
  771. this.title,
  772. this.content,
  773. DateTime? createTime,
  774. DateTime? updateTime,
  775. }) : super(
  776. createTime: createTime,
  777. updateTime: updateTime,
  778. );
  779. factory AnnouncementExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  780. return AnnouncementExtendInfoDTO(
  781. announcementCode: map['AnnouncementCode'],
  782. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  783. language: map['Language'],
  784. title: map['Title'],
  785. content: map['Content'],
  786. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  787. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  788. );
  789. }
  790. Map<String, dynamic> toJson() {
  791. final map = super.toJson();
  792. if(announcementCode != null)
  793. map['AnnouncementCode'] = announcementCode;
  794. map['AnnouncementType'] = announcementType.index;
  795. if(language != null)
  796. map['Language'] = language;
  797. if(title != null)
  798. map['Title'] = title;
  799. if(content != null)
  800. map['Content'] = content;
  801. return map;
  802. }
  803. }
  804. class QueryAnnouncementListRequest extends PageRequest{
  805. AnnouncementTypeEnum announcementType;
  806. String? language;
  807. String? keyword;
  808. DateTime? startTime;
  809. DateTime? endTime;
  810. QueryAnnouncementListRequest({
  811. this.announcementType = AnnouncementTypeEnum.Broadcast,
  812. this.language,
  813. this.keyword,
  814. this.startTime,
  815. this.endTime,
  816. int pageIndex = 0,
  817. int pageSize = 0,
  818. String? token,
  819. }) : super(
  820. pageIndex: pageIndex,
  821. pageSize: pageSize,
  822. token: token,
  823. );
  824. factory QueryAnnouncementListRequest.fromJson(Map<String, dynamic> map) {
  825. return QueryAnnouncementListRequest(
  826. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  827. language: map['Language'],
  828. keyword: map['Keyword'],
  829. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  830. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  831. pageIndex: map['PageIndex'],
  832. pageSize: map['PageSize'],
  833. token: map['Token'],
  834. );
  835. }
  836. Map<String, dynamic> toJson() {
  837. final map = super.toJson();
  838. map['AnnouncementType'] = announcementType.index;
  839. if(language != null)
  840. map['Language'] = language;
  841. if(keyword != null)
  842. map['Keyword'] = keyword;
  843. if(startTime != null)
  844. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  845. if(endTime != null)
  846. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  847. return map;
  848. }
  849. }
  850. class GetAnnouncementRequest extends TokenRequest{
  851. String? announcementCode;
  852. String? language;
  853. GetAnnouncementRequest({
  854. this.announcementCode,
  855. this.language,
  856. String? token,
  857. }) : super(
  858. token: token,
  859. );
  860. factory GetAnnouncementRequest.fromJson(Map<String, dynamic> map) {
  861. return GetAnnouncementRequest(
  862. announcementCode: map['AnnouncementCode'],
  863. language: map['Language'],
  864. token: map['Token'],
  865. );
  866. }
  867. Map<String, dynamic> toJson() {
  868. final map = super.toJson();
  869. if(announcementCode != null)
  870. map['AnnouncementCode'] = announcementCode;
  871. if(language != null)
  872. map['Language'] = language;
  873. return map;
  874. }
  875. }
  876. class NoReadMessagesDTO {
  877. int count;
  878. List<String >? noReadCodes;
  879. NoReadMessagesDTO({
  880. this.count = 0,
  881. this.noReadCodes,
  882. });
  883. factory NoReadMessagesDTO.fromJson(Map<String, dynamic> map) {
  884. return NoReadMessagesDTO(
  885. count: map['Count'],
  886. noReadCodes: map['NoReadCodes'] != null ? map['NoReadCodes'].cast<String>().toList() : null,
  887. );
  888. }
  889. Map<String, dynamic> toJson() {
  890. final map = Map<String, dynamic>();
  891. map['Count'] = count;
  892. if(noReadCodes != null)
  893. map['NoReadCodes'] = noReadCodes;
  894. return map;
  895. }
  896. }
  897. class GetNoReadMessagesRequest extends TokenRequest{
  898. TransactionTypeEnum transactionType;
  899. GetNoReadMessagesRequest({
  900. this.transactionType = TransactionTypeEnum.Consultion,
  901. String? token,
  902. }) : super(
  903. token: token,
  904. );
  905. factory GetNoReadMessagesRequest.fromJson(Map<String, dynamic> map) {
  906. return GetNoReadMessagesRequest(
  907. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  908. token: map['Token'],
  909. );
  910. }
  911. Map<String, dynamic> toJson() {
  912. final map = super.toJson();
  913. map['TransactionType'] = transactionType.index;
  914. return map;
  915. }
  916. }
  917. class RemoveUserSingleTokenRequest extends TokenRequest{
  918. String? wSToken;
  919. RemoveUserSingleTokenRequest({
  920. this.wSToken,
  921. String? token,
  922. }) : super(
  923. token: token,
  924. );
  925. factory RemoveUserSingleTokenRequest.fromJson(Map<String, dynamic> map) {
  926. return RemoveUserSingleTokenRequest(
  927. wSToken: map['WSToken'],
  928. token: map['Token'],
  929. );
  930. }
  931. Map<String, dynamic> toJson() {
  932. final map = super.toJson();
  933. if(wSToken != null)
  934. map['WSToken'] = wSToken;
  935. return map;
  936. }
  937. }