user.m.dart 27 KB

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