user.m.dart 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353
  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 GetUserPageRequest extends PageRequest{
  73. String? keyword;
  74. OrganizationQueryTypeEnum organizationQueryType;
  75. String? organizationCode;
  76. String? rankCode;
  77. String? positionCode;
  78. bool exceptSelf;
  79. String? language;
  80. List<String >? roleCodes;
  81. GetUserPageRequest({
  82. this.keyword,
  83. this.organizationQueryType = OrganizationQueryTypeEnum.Wait,
  84. this.organizationCode,
  85. this.rankCode,
  86. this.positionCode,
  87. this.exceptSelf = false,
  88. this.language,
  89. this.roleCodes,
  90. int pageIndex = 0,
  91. int pageSize = 0,
  92. String? token,
  93. }) : super(
  94. pageIndex: pageIndex,
  95. pageSize: pageSize,
  96. token: token,
  97. );
  98. factory GetUserPageRequest.fromJson(Map<String, dynamic> map) {
  99. return GetUserPageRequest(
  100. keyword: map['Keyword'],
  101. organizationQueryType: OrganizationQueryTypeEnum.values.firstWhere((e) => e.index == map['OrganizationQueryType']),
  102. organizationCode: map['OrganizationCode'],
  103. rankCode: map['RankCode'],
  104. positionCode: map['PositionCode'],
  105. exceptSelf: map['ExceptSelf'],
  106. language: map['Language'],
  107. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  108. pageIndex: map['PageIndex'],
  109. pageSize: map['PageSize'],
  110. token: map['Token'],
  111. );
  112. }
  113. Map<String, dynamic> toJson() {
  114. final map = super.toJson();
  115. if(keyword != null)
  116. map['Keyword'] = keyword;
  117. map['OrganizationQueryType'] = organizationQueryType.index;
  118. if(organizationCode != null)
  119. map['OrganizationCode'] = organizationCode;
  120. if(rankCode != null)
  121. map['RankCode'] = rankCode;
  122. if(positionCode != null)
  123. map['PositionCode'] = positionCode;
  124. map['ExceptSelf'] = exceptSelf;
  125. if(language != null)
  126. map['Language'] = language;
  127. if(roleCodes != null)
  128. map['RoleCodes'] = roleCodes;
  129. return map;
  130. }
  131. }
  132. class RemoveUsersFromOrganizationRequest extends TokenRequest{
  133. List<String >? userCodes;
  134. RemoveUsersFromOrganizationRequest({
  135. this.userCodes,
  136. String? token,
  137. }) : super(
  138. token: token,
  139. );
  140. factory RemoveUsersFromOrganizationRequest.fromJson(Map<String, dynamic> map) {
  141. return RemoveUsersFromOrganizationRequest(
  142. userCodes: map['UserCodes'] != null ? map['UserCodes'].cast<String>().toList() : null,
  143. token: map['Token'],
  144. );
  145. }
  146. Map<String, dynamic> toJson() {
  147. final map = super.toJson();
  148. if(userCodes != null)
  149. map['UserCodes'] = userCodes;
  150. return map;
  151. }
  152. }
  153. class SetUserOrganizationInfoRequest extends TokenRequest{
  154. String? userCode;
  155. List<String >? roleCodes;
  156. List<String >? rankCodes;
  157. List<String >? positionCodes;
  158. String? organizationCode;
  159. SetUserOrganizationInfoRequest({
  160. this.userCode,
  161. this.roleCodes,
  162. this.rankCodes,
  163. this.positionCodes,
  164. this.organizationCode,
  165. String? token,
  166. }) : super(
  167. token: token,
  168. );
  169. factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
  170. return SetUserOrganizationInfoRequest(
  171. userCode: map['UserCode'],
  172. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  173. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  174. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  175. organizationCode: map['OrganizationCode'],
  176. token: map['Token'],
  177. );
  178. }
  179. Map<String, dynamic> toJson() {
  180. final map = super.toJson();
  181. if(userCode != null)
  182. map['UserCode'] = userCode;
  183. if(roleCodes != null)
  184. map['RoleCodes'] = roleCodes;
  185. if(rankCodes != null)
  186. map['RankCodes'] = rankCodes;
  187. if(positionCodes != null)
  188. map['PositionCodes'] = positionCodes;
  189. if(organizationCode != null)
  190. map['OrganizationCode'] = organizationCode;
  191. return map;
  192. }
  193. }
  194. class AlterPersonInfoRequest {
  195. String? token;
  196. String? nickName;
  197. String? headImageUrl;
  198. AlterPersonInfoRequest({
  199. this.token,
  200. this.nickName,
  201. this.headImageUrl,
  202. });
  203. factory AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
  204. return AlterPersonInfoRequest(
  205. token: map['Token'],
  206. nickName: map['NickName'],
  207. headImageUrl: map['HeadImageUrl'],
  208. );
  209. }
  210. Map<String, dynamic> toJson() {
  211. final map = Map<String, dynamic>();
  212. if(token != null)
  213. map['Token'] = token;
  214. if(nickName != null)
  215. map['NickName'] = nickName;
  216. if(headImageUrl != null)
  217. map['HeadImageUrl'] = headImageUrl;
  218. return map;
  219. }
  220. }
  221. class ShareDeviceUserDTO extends BaseDTO{
  222. String? userCode;
  223. String? fullName;
  224. String? userName;
  225. String? displayName;
  226. String? phone;
  227. String? headImageUrl;
  228. List<String >? rankNames;
  229. String? rootOrganizationCode;
  230. String? rootOrganizationName;
  231. ShareDeviceUserDTO({
  232. this.userCode,
  233. this.fullName,
  234. this.userName,
  235. this.displayName,
  236. this.phone,
  237. this.headImageUrl,
  238. this.rankNames,
  239. this.rootOrganizationCode,
  240. this.rootOrganizationName,
  241. DateTime? createTime,
  242. DateTime? updateTime,
  243. }) : super(
  244. createTime: createTime,
  245. updateTime: updateTime,
  246. );
  247. factory ShareDeviceUserDTO.fromJson(Map<String, dynamic> map) {
  248. return ShareDeviceUserDTO(
  249. userCode: map['UserCode'],
  250. fullName: map['FullName'],
  251. userName: map['UserName'],
  252. displayName: map['DisplayName'],
  253. phone: map['Phone'],
  254. headImageUrl: map['HeadImageUrl'],
  255. rankNames: map['RankNames'] != null ? map['RankNames'].cast<String>().toList() : null,
  256. rootOrganizationCode: map['RootOrganizationCode'],
  257. rootOrganizationName: map['RootOrganizationName'],
  258. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  259. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  260. );
  261. }
  262. Map<String, dynamic> toJson() {
  263. final map = super.toJson();
  264. if(userCode != null)
  265. map['UserCode'] = userCode;
  266. if(fullName != null)
  267. map['FullName'] = fullName;
  268. if(userName != null)
  269. map['UserName'] = userName;
  270. if(displayName != null)
  271. map['DisplayName'] = displayName;
  272. if(phone != null)
  273. map['Phone'] = phone;
  274. if(headImageUrl != null)
  275. map['HeadImageUrl'] = headImageUrl;
  276. if(rankNames != null)
  277. map['RankNames'] = rankNames;
  278. if(rootOrganizationCode != null)
  279. map['RootOrganizationCode'] = rootOrganizationCode;
  280. if(rootOrganizationName != null)
  281. map['RootOrganizationName'] = rootOrganizationName;
  282. return map;
  283. }
  284. }
  285. class GetShareDeviceUsersPageRequest extends PageRequest{
  286. String? deviceCode;
  287. GetShareDeviceUsersPageRequest({
  288. this.deviceCode,
  289. int pageIndex = 0,
  290. int pageSize = 0,
  291. String? token,
  292. }) : super(
  293. pageIndex: pageIndex,
  294. pageSize: pageSize,
  295. token: token,
  296. );
  297. factory GetShareDeviceUsersPageRequest.fromJson(Map<String, dynamic> map) {
  298. return GetShareDeviceUsersPageRequest(
  299. deviceCode: map['DeviceCode'],
  300. pageIndex: map['PageIndex'],
  301. pageSize: map['PageSize'],
  302. token: map['Token'],
  303. );
  304. }
  305. Map<String, dynamic> toJson() {
  306. final map = super.toJson();
  307. if(deviceCode != null)
  308. map['DeviceCode'] = deviceCode;
  309. return map;
  310. }
  311. }
  312. class UserFeatureInfoResult {
  313. String? featureCode;
  314. String? featureName;
  315. String? fatherCode;
  316. String? uniqueCode;
  317. UserFeatureInfoResult({
  318. this.featureCode,
  319. this.featureName,
  320. this.fatherCode,
  321. this.uniqueCode,
  322. });
  323. factory UserFeatureInfoResult.fromJson(Map<String, dynamic> map) {
  324. return UserFeatureInfoResult(
  325. featureCode: map['FeatureCode'],
  326. featureName: map['FeatureName'],
  327. fatherCode: map['FatherCode'],
  328. uniqueCode: map['UniqueCode'],
  329. );
  330. }
  331. Map<String, dynamic> toJson() {
  332. final map = Map<String, dynamic>();
  333. if(featureCode != null)
  334. map['FeatureCode'] = featureCode;
  335. if(featureName != null)
  336. map['FeatureName'] = featureName;
  337. if(fatherCode != null)
  338. map['FatherCode'] = fatherCode;
  339. if(uniqueCode != null)
  340. map['UniqueCode'] = uniqueCode;
  341. return map;
  342. }
  343. }
  344. class UserInfoByCodeDTO extends UserDTO{
  345. String? bindAssistantUserName;
  346. String? bindAssistantDoctorUserName;
  347. UserInfoByCodeDTO({
  348. this.bindAssistantUserName,
  349. this.bindAssistantDoctorUserName,
  350. String? nickName,
  351. String? organizationCode,
  352. String? organizationName,
  353. String? rootOrganizationCode,
  354. String? rootOrganizationName,
  355. List<String >? authorityGroups,
  356. List<String >? bindDevices,
  357. List<String >? bindDeviceOrganizations,
  358. String? lastIP,
  359. int logintimes = 0,
  360. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  361. List<String >? roleCodes,
  362. List<String >? rankCodes,
  363. List<String >? positionCodes,
  364. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  365. String? rankName,
  366. String? positionName,
  367. bool isDirector = false,
  368. List<String >? fieldList,
  369. List<String >? deletePatientCodes,
  370. bool isBatchExportDiagnoseData = false,
  371. String? bindAssistantUserCode,
  372. String? bindAssistantDoctorUserCode,
  373. LoginLockInfoDTO? loginLockInfo,
  374. String? signature,
  375. String? language,
  376. bool enableReportLabel = false,
  377. List<AssociatedInfoDTO >? associatedInfos,
  378. String? commonPlatformUserId,
  379. String? bindEmergencyDeviceCode,
  380. String? bindEmergencyExpertCode,
  381. List<String >? dashboardOrgCodes,
  382. String? phone,
  383. String? email,
  384. String? userCode,
  385. String? userName,
  386. String? fullName,
  387. String? headImageUrl,
  388. String? displayName,
  389. DateTime? createTime,
  390. DateTime? updateTime,
  391. }) : super(
  392. nickName: nickName,
  393. organizationCode: organizationCode,
  394. organizationName: organizationName,
  395. rootOrganizationCode: rootOrganizationCode,
  396. rootOrganizationName: rootOrganizationName,
  397. authorityGroups: authorityGroups,
  398. bindDevices: bindDevices,
  399. bindDeviceOrganizations: bindDeviceOrganizations,
  400. lastIP: lastIP,
  401. logintimes: logintimes,
  402. userState: userState,
  403. roleCodes: roleCodes,
  404. rankCodes: rankCodes,
  405. positionCodes: positionCodes,
  406. applyState: applyState,
  407. rankName: rankName,
  408. positionName: positionName,
  409. isDirector: isDirector,
  410. fieldList: fieldList,
  411. deletePatientCodes: deletePatientCodes,
  412. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  413. bindAssistantUserCode: bindAssistantUserCode,
  414. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  415. loginLockInfo: loginLockInfo,
  416. signature: signature,
  417. language: language,
  418. enableReportLabel: enableReportLabel,
  419. associatedInfos: associatedInfos,
  420. commonPlatformUserId: commonPlatformUserId,
  421. bindEmergencyDeviceCode: bindEmergencyDeviceCode,
  422. bindEmergencyExpertCode: bindEmergencyExpertCode,
  423. dashboardOrgCodes: dashboardOrgCodes,
  424. phone: phone,
  425. email: email,
  426. userCode: userCode,
  427. userName: userName,
  428. fullName: fullName,
  429. headImageUrl: headImageUrl,
  430. displayName: displayName,
  431. createTime: createTime,
  432. updateTime: updateTime,
  433. );
  434. factory UserInfoByCodeDTO.fromJson(Map<String, dynamic> map) {
  435. return UserInfoByCodeDTO(
  436. bindAssistantUserName: map['BindAssistantUserName'],
  437. bindAssistantDoctorUserName: map['BindAssistantDoctorUserName'],
  438. nickName: map['NickName'],
  439. organizationCode: map['OrganizationCode'],
  440. organizationName: map['OrganizationName'],
  441. rootOrganizationCode: map['RootOrganizationCode'],
  442. rootOrganizationName: map['RootOrganizationName'],
  443. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  444. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  445. bindDeviceOrganizations: map['BindDeviceOrganizations'] != null ? map['BindDeviceOrganizations'].cast<String>().toList() : null,
  446. lastIP: map['LastIP'],
  447. logintimes: map['Logintimes'],
  448. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  449. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  450. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  451. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  452. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  453. rankName: map['RankName'],
  454. positionName: map['PositionName'],
  455. isDirector: map['IsDirector'],
  456. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  457. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  458. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  459. bindAssistantUserCode: map['BindAssistantUserCode'],
  460. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  461. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  462. signature: map['Signature'],
  463. language: map['Language'],
  464. enableReportLabel: map['EnableReportLabel'],
  465. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  466. commonPlatformUserId: map['CommonPlatformUserId'],
  467. bindEmergencyDeviceCode: map['BindEmergencyDeviceCode'],
  468. bindEmergencyExpertCode: map['BindEmergencyExpertCode'],
  469. dashboardOrgCodes: map['DashboardOrgCodes'] != null ? map['DashboardOrgCodes'].cast<String>().toList() : null,
  470. phone: map['Phone'],
  471. email: map['Email'],
  472. userCode: map['UserCode'],
  473. userName: map['UserName'],
  474. fullName: map['FullName'],
  475. headImageUrl: map['HeadImageUrl'],
  476. displayName: map['DisplayName'],
  477. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  478. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  479. );
  480. }
  481. Map<String, dynamic> toJson() {
  482. final map = super.toJson();
  483. if(bindAssistantUserName != null)
  484. map['BindAssistantUserName'] = bindAssistantUserName;
  485. if(bindAssistantDoctorUserName != null)
  486. map['BindAssistantDoctorUserName'] = bindAssistantDoctorUserName;
  487. return map;
  488. }
  489. }
  490. class GetUserByCodeRequest extends TokenRequest{
  491. String? userCode;
  492. GetUserByCodeRequest({
  493. this.userCode,
  494. String? token,
  495. }) : super(
  496. token: token,
  497. );
  498. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  499. return GetUserByCodeRequest(
  500. userCode: map['UserCode'],
  501. token: map['Token'],
  502. );
  503. }
  504. Map<String, dynamic> toJson() {
  505. final map = super.toJson();
  506. if(userCode != null)
  507. map['UserCode'] = userCode;
  508. return map;
  509. }
  510. }
  511. enum CommonSettingsEnum {
  512. Signature,
  513. Language,
  514. EnableReportLabel,
  515. }
  516. class CommonSettingsRequest extends TokenRequest{
  517. CommonSettingsEnum settingType;
  518. String? value;
  519. CommonSettingsRequest({
  520. this.settingType = CommonSettingsEnum.Signature,
  521. this.value,
  522. String? token,
  523. }) : super(
  524. token: token,
  525. );
  526. factory CommonSettingsRequest.fromJson(Map<String, dynamic> map) {
  527. return CommonSettingsRequest(
  528. settingType: CommonSettingsEnum.values.firstWhere((e) => e.index == map['SettingType']),
  529. value: map['Value'],
  530. token: map['Token'],
  531. );
  532. }
  533. Map<String, dynamic> toJson() {
  534. final map = super.toJson();
  535. map['SettingType'] = settingType.index;
  536. if(value != null)
  537. map['Value'] = value;
  538. return map;
  539. }
  540. }
  541. class RefreshStaticticRecordsRequest {
  542. String? userCode;
  543. bool inExecutor;
  544. RefreshStaticticRecordsRequest({
  545. this.userCode,
  546. this.inExecutor = false,
  547. });
  548. factory RefreshStaticticRecordsRequest.fromJson(Map<String, dynamic> map) {
  549. return RefreshStaticticRecordsRequest(
  550. userCode: map['UserCode'],
  551. inExecutor: map['InExecutor'],
  552. );
  553. }
  554. Map<String, dynamic> toJson() {
  555. final map = Map<String, dynamic>();
  556. if(userCode != null)
  557. map['UserCode'] = userCode;
  558. map['InExecutor'] = inExecutor;
  559. return map;
  560. }
  561. }
  562. enum ScheduleTypeEnum {
  563. Consultation,
  564. Training,
  565. }
  566. class ClientScheduleDTO {
  567. String? title;
  568. TransactionStatusEnum status;
  569. ScheduleTypeEnum scheduleType;
  570. DateTime? startTime;
  571. DateTime? endTime;
  572. String? relevanceCode;
  573. ClientScheduleDTO({
  574. this.title,
  575. this.status = TransactionStatusEnum.Applied,
  576. this.scheduleType = ScheduleTypeEnum.Consultation,
  577. this.startTime,
  578. this.endTime,
  579. this.relevanceCode,
  580. });
  581. factory ClientScheduleDTO.fromJson(Map<String, dynamic> map) {
  582. return ClientScheduleDTO(
  583. title: map['Title'],
  584. status: TransactionStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  585. scheduleType: ScheduleTypeEnum.values.firstWhere((e) => e.index == map['ScheduleType']),
  586. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  587. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  588. relevanceCode: map['RelevanceCode'],
  589. );
  590. }
  591. Map<String, dynamic> toJson() {
  592. final map = Map<String, dynamic>();
  593. if(title != null)
  594. map['Title'] = title;
  595. map['Status'] = status.index;
  596. map['ScheduleType'] = scheduleType.index;
  597. if(startTime != null)
  598. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  599. if(endTime != null)
  600. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  601. if(relevanceCode != null)
  602. map['RelevanceCode'] = relevanceCode;
  603. return map;
  604. }
  605. }
  606. class FindSchedulesRequest extends TokenRequest{
  607. DateTime? startTime;
  608. DateTime? endTime;
  609. FindSchedulesRequest({
  610. this.startTime,
  611. this.endTime,
  612. String? token,
  613. }) : super(
  614. token: token,
  615. );
  616. factory FindSchedulesRequest.fromJson(Map<String, dynamic> map) {
  617. return FindSchedulesRequest(
  618. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  619. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  620. token: map['Token'],
  621. );
  622. }
  623. Map<String, dynamic> toJson() {
  624. final map = super.toJson();
  625. if(startTime != null)
  626. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  627. if(endTime != null)
  628. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  629. return map;
  630. }
  631. }
  632. enum ApplicantTypeEnum {
  633. Client,
  634. Device,
  635. Management,
  636. ThirdParty,
  637. Server,
  638. }
  639. class MessageExtendInfoDTO extends BaseDTO{
  640. String? messageCode;
  641. NotificationTypeEnum notificationType;
  642. String? content;
  643. DateTime? notifyTime;
  644. ApplicantTypeEnum receiverType;
  645. String? relevanceCode;
  646. bool isReaded;
  647. DateTime? deliveryTime;
  648. DateTime? readTime;
  649. MessageExtendInfoDTO({
  650. this.messageCode,
  651. this.notificationType = NotificationTypeEnum.Unknown,
  652. this.content,
  653. this.notifyTime,
  654. this.receiverType = ApplicantTypeEnum.Client,
  655. this.relevanceCode,
  656. this.isReaded = false,
  657. this.deliveryTime,
  658. this.readTime,
  659. DateTime? createTime,
  660. DateTime? updateTime,
  661. }) : super(
  662. createTime: createTime,
  663. updateTime: updateTime,
  664. );
  665. factory MessageExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  666. return MessageExtendInfoDTO(
  667. messageCode: map['MessageCode'],
  668. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  669. content: map['Content'],
  670. notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
  671. receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
  672. relevanceCode: map['RelevanceCode'],
  673. isReaded: map['IsReaded'],
  674. deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
  675. readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
  676. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  677. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  678. );
  679. }
  680. Map<String, dynamic> toJson() {
  681. final map = super.toJson();
  682. if(messageCode != null)
  683. map['MessageCode'] = messageCode;
  684. map['NotificationType'] = notificationType.index;
  685. if(content != null)
  686. map['Content'] = content;
  687. if(notifyTime != null)
  688. map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
  689. map['ReceiverType'] = receiverType.index;
  690. if(relevanceCode != null)
  691. map['RelevanceCode'] = relevanceCode;
  692. map['IsReaded'] = isReaded;
  693. if(deliveryTime != null)
  694. map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
  695. if(readTime != null)
  696. map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
  697. return map;
  698. }
  699. }
  700. class QueryMessageListRequest extends PageRequest{
  701. TransactionTypeEnum transactionType;
  702. String? keyword;
  703. QueryMessageListRequest({
  704. this.transactionType = TransactionTypeEnum.Consultion,
  705. this.keyword,
  706. int pageIndex = 0,
  707. int pageSize = 0,
  708. String? token,
  709. }) : super(
  710. pageIndex: pageIndex,
  711. pageSize: pageSize,
  712. token: token,
  713. );
  714. factory QueryMessageListRequest.fromJson(Map<String, dynamic> map) {
  715. return QueryMessageListRequest(
  716. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  717. keyword: map['Keyword'],
  718. pageIndex: map['PageIndex'],
  719. pageSize: map['PageSize'],
  720. token: map['Token'],
  721. );
  722. }
  723. Map<String, dynamic> toJson() {
  724. final map = super.toJson();
  725. map['TransactionType'] = transactionType.index;
  726. if(keyword != null)
  727. map['Keyword'] = keyword;
  728. return map;
  729. }
  730. }
  731. class SetMessageDeliveryRequest extends TokenRequest{
  732. String? messageCode;
  733. bool isReaded;
  734. SetMessageDeliveryRequest({
  735. this.messageCode,
  736. this.isReaded = false,
  737. String? token,
  738. }) : super(
  739. token: token,
  740. );
  741. factory SetMessageDeliveryRequest.fromJson(Map<String, dynamic> map) {
  742. return SetMessageDeliveryRequest(
  743. messageCode: map['MessageCode'],
  744. isReaded: map['IsReaded'],
  745. token: map['Token'],
  746. );
  747. }
  748. Map<String, dynamic> toJson() {
  749. final map = super.toJson();
  750. if(messageCode != null)
  751. map['MessageCode'] = messageCode;
  752. map['IsReaded'] = isReaded;
  753. return map;
  754. }
  755. }
  756. class SetMessageInfoReqeust extends TokenRequest{
  757. List<String >? messageCodes;
  758. SetMessageInfoReqeust({
  759. this.messageCodes,
  760. String? token,
  761. }) : super(
  762. token: token,
  763. );
  764. factory SetMessageInfoReqeust.fromJson(Map<String, dynamic> map) {
  765. return SetMessageInfoReqeust(
  766. messageCodes: map['MessageCodes'] != null ? map['MessageCodes'].cast<String>().toList() : null,
  767. token: map['Token'],
  768. );
  769. }
  770. Map<String, dynamic> toJson() {
  771. final map = super.toJson();
  772. if(messageCodes != null)
  773. map['MessageCodes'] = messageCodes;
  774. return map;
  775. }
  776. }
  777. class AnnouncementExtendInfoDTO extends BaseDTO{
  778. String? announcementCode;
  779. AnnouncementTypeEnum announcementType;
  780. String? language;
  781. String? title;
  782. String? content;
  783. AnnouncementExtendInfoDTO({
  784. this.announcementCode,
  785. this.announcementType = AnnouncementTypeEnum.Broadcast,
  786. this.language,
  787. this.title,
  788. this.content,
  789. DateTime? createTime,
  790. DateTime? updateTime,
  791. }) : super(
  792. createTime: createTime,
  793. updateTime: updateTime,
  794. );
  795. factory AnnouncementExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  796. return AnnouncementExtendInfoDTO(
  797. announcementCode: map['AnnouncementCode'],
  798. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  799. language: map['Language'],
  800. title: map['Title'],
  801. content: map['Content'],
  802. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  803. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  804. );
  805. }
  806. Map<String, dynamic> toJson() {
  807. final map = super.toJson();
  808. if(announcementCode != null)
  809. map['AnnouncementCode'] = announcementCode;
  810. map['AnnouncementType'] = announcementType.index;
  811. if(language != null)
  812. map['Language'] = language;
  813. if(title != null)
  814. map['Title'] = title;
  815. if(content != null)
  816. map['Content'] = content;
  817. return map;
  818. }
  819. }
  820. class QueryAnnouncementListRequest extends PageRequest{
  821. AnnouncementTypeEnum announcementType;
  822. String? language;
  823. String? keyword;
  824. DateTime? startTime;
  825. DateTime? endTime;
  826. QueryAnnouncementListRequest({
  827. this.announcementType = AnnouncementTypeEnum.Broadcast,
  828. this.language,
  829. this.keyword,
  830. this.startTime,
  831. this.endTime,
  832. int pageIndex = 0,
  833. int pageSize = 0,
  834. String? token,
  835. }) : super(
  836. pageIndex: pageIndex,
  837. pageSize: pageSize,
  838. token: token,
  839. );
  840. factory QueryAnnouncementListRequest.fromJson(Map<String, dynamic> map) {
  841. return QueryAnnouncementListRequest(
  842. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  843. language: map['Language'],
  844. keyword: map['Keyword'],
  845. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  846. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  847. pageIndex: map['PageIndex'],
  848. pageSize: map['PageSize'],
  849. token: map['Token'],
  850. );
  851. }
  852. Map<String, dynamic> toJson() {
  853. final map = super.toJson();
  854. map['AnnouncementType'] = announcementType.index;
  855. if(language != null)
  856. map['Language'] = language;
  857. if(keyword != null)
  858. map['Keyword'] = keyword;
  859. if(startTime != null)
  860. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  861. if(endTime != null)
  862. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  863. return map;
  864. }
  865. }
  866. class GetAnnouncementRequest extends TokenRequest{
  867. String? announcementCode;
  868. String? language;
  869. GetAnnouncementRequest({
  870. this.announcementCode,
  871. this.language,
  872. String? token,
  873. }) : super(
  874. token: token,
  875. );
  876. factory GetAnnouncementRequest.fromJson(Map<String, dynamic> map) {
  877. return GetAnnouncementRequest(
  878. announcementCode: map['AnnouncementCode'],
  879. language: map['Language'],
  880. token: map['Token'],
  881. );
  882. }
  883. Map<String, dynamic> toJson() {
  884. final map = super.toJson();
  885. if(announcementCode != null)
  886. map['AnnouncementCode'] = announcementCode;
  887. if(language != null)
  888. map['Language'] = language;
  889. return map;
  890. }
  891. }
  892. class NoReadMessagesDTO {
  893. int count;
  894. List<String >? noReadCodes;
  895. NoReadMessagesDTO({
  896. this.count = 0,
  897. this.noReadCodes,
  898. });
  899. factory NoReadMessagesDTO.fromJson(Map<String, dynamic> map) {
  900. return NoReadMessagesDTO(
  901. count: map['Count'],
  902. noReadCodes: map['NoReadCodes'] != null ? map['NoReadCodes'].cast<String>().toList() : null,
  903. );
  904. }
  905. Map<String, dynamic> toJson() {
  906. final map = Map<String, dynamic>();
  907. map['Count'] = count;
  908. if(noReadCodes != null)
  909. map['NoReadCodes'] = noReadCodes;
  910. return map;
  911. }
  912. }
  913. class GetNoReadMessagesRequest extends TokenRequest{
  914. TransactionTypeEnum transactionType;
  915. GetNoReadMessagesRequest({
  916. this.transactionType = TransactionTypeEnum.Consultion,
  917. String? token,
  918. }) : super(
  919. token: token,
  920. );
  921. factory GetNoReadMessagesRequest.fromJson(Map<String, dynamic> map) {
  922. return GetNoReadMessagesRequest(
  923. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  924. token: map['Token'],
  925. );
  926. }
  927. Map<String, dynamic> toJson() {
  928. final map = super.toJson();
  929. map['TransactionType'] = transactionType.index;
  930. return map;
  931. }
  932. }
  933. class RemoveUserSingleTokenRequest extends TokenRequest{
  934. String? wSToken;
  935. RemoveUserSingleTokenRequest({
  936. this.wSToken,
  937. String? token,
  938. }) : super(
  939. token: token,
  940. );
  941. factory RemoveUserSingleTokenRequest.fromJson(Map<String, dynamic> map) {
  942. return RemoveUserSingleTokenRequest(
  943. wSToken: map['WSToken'],
  944. token: map['Token'],
  945. );
  946. }
  947. Map<String, dynamic> toJson() {
  948. final map = super.toJson();
  949. if(wSToken != null)
  950. map['WSToken'] = wSToken;
  951. return map;
  952. }
  953. }
  954. enum UserMigratoryRoleEnum {
  955. Role_ExpertAssistant,
  956. Role_CertifiedExpert,
  957. Role_CertifiedPhysician,
  958. Role_RemoteManager,
  959. Role_UnSet,
  960. }
  961. class UserMigratoryInfo extends UserDTO{
  962. bool isDelete;
  963. String? secretPassword;
  964. DateTime? passwordUpdateTime;
  965. List<String >? passwordRecords;
  966. UserMigratoryRoleEnum userRole;
  967. UserMigratoryInfo({
  968. this.isDelete = false,
  969. this.secretPassword,
  970. this.passwordUpdateTime,
  971. this.passwordRecords,
  972. this.userRole = UserMigratoryRoleEnum.Role_ExpertAssistant,
  973. String? nickName,
  974. String? organizationCode,
  975. String? organizationName,
  976. String? rootOrganizationCode,
  977. String? rootOrganizationName,
  978. List<String >? authorityGroups,
  979. List<String >? bindDevices,
  980. List<String >? bindDeviceOrganizations,
  981. String? lastIP,
  982. int logintimes = 0,
  983. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  984. List<String >? roleCodes,
  985. List<String >? rankCodes,
  986. List<String >? positionCodes,
  987. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  988. String? rankName,
  989. String? positionName,
  990. bool isDirector = false,
  991. List<String >? fieldList,
  992. List<String >? deletePatientCodes,
  993. bool isBatchExportDiagnoseData = false,
  994. String? bindAssistantUserCode,
  995. String? bindAssistantDoctorUserCode,
  996. LoginLockInfoDTO? loginLockInfo,
  997. String? signature,
  998. String? language,
  999. bool enableReportLabel = false,
  1000. List<AssociatedInfoDTO >? associatedInfos,
  1001. String? commonPlatformUserId,
  1002. String? bindEmergencyDeviceCode,
  1003. String? bindEmergencyExpertCode,
  1004. List<String >? dashboardOrgCodes,
  1005. String? phone,
  1006. String? email,
  1007. String? userCode,
  1008. String? userName,
  1009. String? fullName,
  1010. String? headImageUrl,
  1011. String? displayName,
  1012. DateTime? createTime,
  1013. DateTime? updateTime,
  1014. }) : super(
  1015. nickName: nickName,
  1016. organizationCode: organizationCode,
  1017. organizationName: organizationName,
  1018. rootOrganizationCode: rootOrganizationCode,
  1019. rootOrganizationName: rootOrganizationName,
  1020. authorityGroups: authorityGroups,
  1021. bindDevices: bindDevices,
  1022. bindDeviceOrganizations: bindDeviceOrganizations,
  1023. lastIP: lastIP,
  1024. logintimes: logintimes,
  1025. userState: userState,
  1026. roleCodes: roleCodes,
  1027. rankCodes: rankCodes,
  1028. positionCodes: positionCodes,
  1029. applyState: applyState,
  1030. rankName: rankName,
  1031. positionName: positionName,
  1032. isDirector: isDirector,
  1033. fieldList: fieldList,
  1034. deletePatientCodes: deletePatientCodes,
  1035. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  1036. bindAssistantUserCode: bindAssistantUserCode,
  1037. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  1038. loginLockInfo: loginLockInfo,
  1039. signature: signature,
  1040. language: language,
  1041. enableReportLabel: enableReportLabel,
  1042. associatedInfos: associatedInfos,
  1043. commonPlatformUserId: commonPlatformUserId,
  1044. bindEmergencyDeviceCode: bindEmergencyDeviceCode,
  1045. bindEmergencyExpertCode: bindEmergencyExpertCode,
  1046. dashboardOrgCodes: dashboardOrgCodes,
  1047. phone: phone,
  1048. email: email,
  1049. userCode: userCode,
  1050. userName: userName,
  1051. fullName: fullName,
  1052. headImageUrl: headImageUrl,
  1053. displayName: displayName,
  1054. createTime: createTime,
  1055. updateTime: updateTime,
  1056. );
  1057. factory UserMigratoryInfo.fromJson(Map<String, dynamic> map) {
  1058. return UserMigratoryInfo(
  1059. isDelete: map['IsDelete'],
  1060. secretPassword: map['SecretPassword'],
  1061. passwordUpdateTime: map['PasswordUpdateTime'] != null ? DateTime.parse(map['PasswordUpdateTime']) : null,
  1062. passwordRecords: map['PasswordRecords'] != null ? map['PasswordRecords'].cast<String>().toList() : null,
  1063. userRole: UserMigratoryRoleEnum.values.firstWhere((e) => e.index == map['UserRole']),
  1064. nickName: map['NickName'],
  1065. organizationCode: map['OrganizationCode'],
  1066. organizationName: map['OrganizationName'],
  1067. rootOrganizationCode: map['RootOrganizationCode'],
  1068. rootOrganizationName: map['RootOrganizationName'],
  1069. authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast<String>().toList() : null,
  1070. bindDevices: map['BindDevices'] != null ? map['BindDevices'].cast<String>().toList() : null,
  1071. bindDeviceOrganizations: map['BindDeviceOrganizations'] != null ? map['BindDeviceOrganizations'].cast<String>().toList() : null,
  1072. lastIP: map['LastIP'],
  1073. logintimes: map['Logintimes'],
  1074. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  1075. roleCodes: map['RoleCodes'] != null ? map['RoleCodes'].cast<String>().toList() : null,
  1076. rankCodes: map['RankCodes'] != null ? map['RankCodes'].cast<String>().toList() : null,
  1077. positionCodes: map['PositionCodes'] != null ? map['PositionCodes'].cast<String>().toList() : null,
  1078. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  1079. rankName: map['RankName'],
  1080. positionName: map['PositionName'],
  1081. isDirector: map['IsDirector'],
  1082. fieldList: map['FieldList'] != null ? map['FieldList'].cast<String>().toList() : null,
  1083. deletePatientCodes: map['DeletePatientCodes'] != null ? map['DeletePatientCodes'].cast<String>().toList() : null,
  1084. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  1085. bindAssistantUserCode: map['BindAssistantUserCode'],
  1086. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  1087. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  1088. signature: map['Signature'],
  1089. language: map['Language'],
  1090. enableReportLabel: map['EnableReportLabel'],
  1091. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1092. commonPlatformUserId: map['CommonPlatformUserId'],
  1093. bindEmergencyDeviceCode: map['BindEmergencyDeviceCode'],
  1094. bindEmergencyExpertCode: map['BindEmergencyExpertCode'],
  1095. dashboardOrgCodes: map['DashboardOrgCodes'] != null ? map['DashboardOrgCodes'].cast<String>().toList() : null,
  1096. phone: map['Phone'],
  1097. email: map['Email'],
  1098. userCode: map['UserCode'],
  1099. userName: map['UserName'],
  1100. fullName: map['FullName'],
  1101. headImageUrl: map['HeadImageUrl'],
  1102. displayName: map['DisplayName'],
  1103. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1104. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1105. );
  1106. }
  1107. Map<String, dynamic> toJson() {
  1108. final map = super.toJson();
  1109. map['IsDelete'] = isDelete;
  1110. if(secretPassword != null)
  1111. map['SecretPassword'] = secretPassword;
  1112. if(passwordUpdateTime != null)
  1113. map['PasswordUpdateTime'] = JsonRpcUtils.dateFormat(passwordUpdateTime!);
  1114. if(passwordRecords != null)
  1115. map['PasswordRecords'] = passwordRecords;
  1116. map['UserRole'] = userRole.index;
  1117. return map;
  1118. }
  1119. }
  1120. class BatchInsertUserRequest extends TokenRequest{
  1121. SyncDBEnum syncType;
  1122. List<UserMigratoryInfo >? userMigratorys;
  1123. BatchInsertUserRequest({
  1124. this.syncType = SyncDBEnum.Migrate,
  1125. this.userMigratorys,
  1126. String? token,
  1127. }) : super(
  1128. token: token,
  1129. );
  1130. factory BatchInsertUserRequest.fromJson(Map<String, dynamic> map) {
  1131. return BatchInsertUserRequest(
  1132. syncType: SyncDBEnum.values.firstWhere((e) => e.index == map['SyncType']),
  1133. userMigratorys: map['UserMigratorys'] != null ? (map['UserMigratorys'] as List).map((e)=>UserMigratoryInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1134. token: map['Token'],
  1135. );
  1136. }
  1137. Map<String, dynamic> toJson() {
  1138. final map = super.toJson();
  1139. map['SyncType'] = syncType.index;
  1140. if(userMigratorys != null)
  1141. map['UserMigratorys'] = userMigratorys;
  1142. return map;
  1143. }
  1144. }
  1145. enum MigrateRecordType {
  1146. Default,
  1147. MigrateDataCenter,
  1148. }
  1149. class MigrateRecordDTO {
  1150. DateTime? startTime;
  1151. DateTime? endTime;
  1152. MigrateRecordType type;
  1153. MigrateRecordDTO({
  1154. this.startTime,
  1155. this.endTime,
  1156. this.type = MigrateRecordType.Default,
  1157. });
  1158. factory MigrateRecordDTO.fromJson(Map<String, dynamic> map) {
  1159. return MigrateRecordDTO(
  1160. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1161. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1162. type: MigrateRecordType.values.firstWhere((e) => e.index == map['Type']),
  1163. );
  1164. }
  1165. Map<String, dynamic> toJson() {
  1166. final map = Map<String, dynamic>();
  1167. if(startTime != null)
  1168. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1169. if(endTime != null)
  1170. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1171. map['Type'] = type.index;
  1172. return map;
  1173. }
  1174. }
  1175. class QueryMigrateTimeRequest extends TokenRequest{
  1176. bool isInitMigreate;
  1177. QueryMigrateTimeRequest({
  1178. this.isInitMigreate = false,
  1179. String? token,
  1180. }) : super(
  1181. token: token,
  1182. );
  1183. factory QueryMigrateTimeRequest.fromJson(Map<String, dynamic> map) {
  1184. return QueryMigrateTimeRequest(
  1185. isInitMigreate: map['IsInitMigreate'],
  1186. token: map['Token'],
  1187. );
  1188. }
  1189. Map<String, dynamic> toJson() {
  1190. final map = super.toJson();
  1191. map['IsInitMigreate'] = isInitMigreate;
  1192. return map;
  1193. }
  1194. }
  1195. enum VerificationTypeEnum {
  1196. Password,
  1197. PhoneVerificationCode,
  1198. EmailVerificationCode,
  1199. }
  1200. class CommonLogOffRequest extends TokenRequest{
  1201. VerificationTypeEnum verificationType;
  1202. String? anyCode;
  1203. CommonLogOffRequest({
  1204. this.verificationType = VerificationTypeEnum.Password,
  1205. this.anyCode,
  1206. String? token,
  1207. }) : super(
  1208. token: token,
  1209. );
  1210. factory CommonLogOffRequest.fromJson(Map<String, dynamic> map) {
  1211. return CommonLogOffRequest(
  1212. verificationType: VerificationTypeEnum.values.firstWhere((e) => e.index == map['VerificationType']),
  1213. anyCode: map['AnyCode'],
  1214. token: map['Token'],
  1215. );
  1216. }
  1217. Map<String, dynamic> toJson() {
  1218. final map = super.toJson();
  1219. map['VerificationType'] = verificationType.index;
  1220. if(anyCode != null)
  1221. map['AnyCode'] = anyCode;
  1222. return map;
  1223. }
  1224. }