user.m.dart 25 KB

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