user.m.dart 38 KB

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