user.m.dart 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  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. List<String>? userFeatureCodes,
  411. String? phone,
  412. String? email,
  413. String? userCode,
  414. String? userName,
  415. String? fullName,
  416. String? headImageUrl,
  417. String? displayName,
  418. DateTime? createTime,
  419. DateTime? updateTime,
  420. }) : super(
  421. nickName: nickName,
  422. organizationCode: organizationCode,
  423. organizationName: organizationName,
  424. departmentCode: departmentCode,
  425. departmentName: departmentName,
  426. departmentShortCode: departmentShortCode,
  427. rootOrganizationCode: rootOrganizationCode,
  428. rootOrganizationName: rootOrganizationName,
  429. authorityGroups: authorityGroups,
  430. bindDevices: bindDevices,
  431. bindDeviceOrganizations: bindDeviceOrganizations,
  432. lastIP: lastIP,
  433. logintimes: logintimes,
  434. userState: userState,
  435. roleCodes: roleCodes,
  436. rankCodes: rankCodes,
  437. positionCodes: positionCodes,
  438. applyState: applyState,
  439. rankName: rankName,
  440. positionName: positionName,
  441. isDirector: isDirector,
  442. fieldList: fieldList,
  443. deletePatientCodes: deletePatientCodes,
  444. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  445. bindAssistantUserCode: bindAssistantUserCode,
  446. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  447. loginLockInfo: loginLockInfo,
  448. signature: signature,
  449. language: language,
  450. enableReportLabel: enableReportLabel,
  451. associatedInfos: associatedInfos,
  452. commonPlatformUserId: commonPlatformUserId,
  453. bindEmergencyDeviceCode: bindEmergencyDeviceCode,
  454. bindEmergencyExpertCode: bindEmergencyExpertCode,
  455. dashboardOrgCodes: dashboardOrgCodes,
  456. organizationShortCode: organizationShortCode,
  457. rootOrganizationShortCode: rootOrganizationShortCode,
  458. isOldAgent: isOldAgent,
  459. userFeatureCodes: userFeatureCodes,
  460. phone: phone,
  461. email: email,
  462. userCode: userCode,
  463. userName: userName,
  464. fullName: fullName,
  465. headImageUrl: headImageUrl,
  466. displayName: displayName,
  467. createTime: createTime,
  468. updateTime: updateTime,
  469. );
  470. factory UserInfoByCodeDTO.fromJson(Map<String, dynamic> map) {
  471. return UserInfoByCodeDTO(
  472. bindAssistantUserName: map['BindAssistantUserName'],
  473. bindAssistantDoctorUserName: map['BindAssistantDoctorUserName'],
  474. nickName: map['NickName'],
  475. organizationCode: map['OrganizationCode'],
  476. organizationName: map['OrganizationName'],
  477. departmentCode: map['DepartmentCode'],
  478. departmentName: map['DepartmentName'],
  479. departmentShortCode: map['DepartmentShortCode'],
  480. rootOrganizationCode: map['RootOrganizationCode'],
  481. rootOrganizationName: map['RootOrganizationName'],
  482. authorityGroups: map['AuthorityGroups']?.cast<String>().toList(),
  483. bindDevices: map['BindDevices']?.cast<String>().toList(),
  484. bindDeviceOrganizations: map['BindDeviceOrganizations']?.cast<String>().toList(),
  485. lastIP: map['LastIP'],
  486. logintimes: map['Logintimes'],
  487. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  488. roleCodes: map['RoleCodes']?.cast<String>().toList(),
  489. rankCodes: map['RankCodes']?.cast<String>().toList(),
  490. positionCodes: map['PositionCodes']?.cast<String>().toList(),
  491. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  492. rankName: map['RankName'],
  493. positionName: map['PositionName'],
  494. isDirector: map['IsDirector'],
  495. fieldList: map['FieldList']?.cast<String>().toList(),
  496. deletePatientCodes: map['DeletePatientCodes']?.cast<String>().toList(),
  497. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  498. bindAssistantUserCode: map['BindAssistantUserCode'],
  499. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  500. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  501. signature: map['Signature'],
  502. language: map['Language'],
  503. enableReportLabel: map['EnableReportLabel'],
  504. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  505. commonPlatformUserId: map['CommonPlatformUserId'],
  506. bindEmergencyDeviceCode: map['BindEmergencyDeviceCode'],
  507. bindEmergencyExpertCode: map['BindEmergencyExpertCode'],
  508. dashboardOrgCodes: map['DashboardOrgCodes']?.cast<String>().toList(),
  509. organizationShortCode: map['OrganizationShortCode'],
  510. rootOrganizationShortCode: map['RootOrganizationShortCode'],
  511. isOldAgent: map['IsOldAgent'],
  512. userFeatureCodes: map['UserFeatureCodes']?.cast<String>().toList(),
  513. phone: map['Phone'],
  514. email: map['Email'],
  515. userCode: map['UserCode'],
  516. userName: map['UserName'],
  517. fullName: map['FullName'],
  518. headImageUrl: map['HeadImageUrl'],
  519. displayName: map['DisplayName'],
  520. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  521. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  522. );
  523. }
  524. Map<String, dynamic> toJson() {
  525. final map = super.toJson();
  526. if (bindAssistantUserName != null)
  527. map['BindAssistantUserName'] = bindAssistantUserName;
  528. if (bindAssistantDoctorUserName != null)
  529. map['BindAssistantDoctorUserName'] = bindAssistantDoctorUserName;
  530. return map;
  531. }
  532. }
  533. class GetUserByCodeRequest extends TokenRequest{
  534. String? userCode;
  535. GetUserByCodeRequest({
  536. this.userCode,
  537. String? token,
  538. }) : super(
  539. token: token,
  540. );
  541. factory GetUserByCodeRequest.fromJson(Map<String, dynamic> map) {
  542. return GetUserByCodeRequest(
  543. userCode: map['UserCode'],
  544. token: map['Token'],
  545. );
  546. }
  547. Map<String, dynamic> toJson() {
  548. final map = super.toJson();
  549. if (userCode != null)
  550. map['UserCode'] = userCode;
  551. return map;
  552. }
  553. }
  554. enum CommonSettingsEnum {
  555. Signature,
  556. Language,
  557. EnableReportLabel,
  558. }
  559. class CommonSettingsRequest extends TokenRequest{
  560. CommonSettingsEnum settingType;
  561. String? value;
  562. CommonSettingsRequest({
  563. this.settingType = CommonSettingsEnum.Signature,
  564. this.value,
  565. String? token,
  566. }) : super(
  567. token: token,
  568. );
  569. factory CommonSettingsRequest.fromJson(Map<String, dynamic> map) {
  570. return CommonSettingsRequest(
  571. settingType: CommonSettingsEnum.values.firstWhere((e) => e.index == map['SettingType']),
  572. value: map['Value'],
  573. token: map['Token'],
  574. );
  575. }
  576. Map<String, dynamic> toJson() {
  577. final map = super.toJson();
  578. map['SettingType'] = settingType.index;
  579. if (value != null)
  580. map['Value'] = value;
  581. return map;
  582. }
  583. }
  584. class RefreshStaticticRecordsRequest {
  585. String? userCode;
  586. bool inExecutor;
  587. RefreshStaticticRecordsRequest({
  588. this.userCode,
  589. this.inExecutor = false,
  590. });
  591. factory RefreshStaticticRecordsRequest.fromJson(Map<String, dynamic> map) {
  592. return RefreshStaticticRecordsRequest(
  593. userCode: map['UserCode'],
  594. inExecutor: map['InExecutor'],
  595. );
  596. }
  597. Map<String, dynamic> toJson() {
  598. final map = Map<String, dynamic>();
  599. if (userCode != null) {
  600. map['UserCode'] = userCode;
  601. }
  602. map['InExecutor'] = inExecutor;
  603. return map;
  604. }
  605. }
  606. enum ScheduleTypeEnum {
  607. Consultation,
  608. Training,
  609. }
  610. class ClientScheduleDTO {
  611. String? title;
  612. TransactionStatusEnum status;
  613. ScheduleTypeEnum scheduleType;
  614. DateTime? startTime;
  615. DateTime? endTime;
  616. String? relevanceCode;
  617. ClientScheduleDTO({
  618. this.title,
  619. this.status = TransactionStatusEnum.Applied,
  620. this.scheduleType = ScheduleTypeEnum.Consultation,
  621. this.startTime,
  622. this.endTime,
  623. this.relevanceCode,
  624. });
  625. factory ClientScheduleDTO.fromJson(Map<String, dynamic> map) {
  626. return ClientScheduleDTO(
  627. title: map['Title'],
  628. status: TransactionStatusEnum.values.firstWhere((e) => e.index == map['Status']),
  629. scheduleType: ScheduleTypeEnum.values.firstWhere((e) => e.index == map['ScheduleType']),
  630. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  631. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  632. relevanceCode: map['RelevanceCode'],
  633. );
  634. }
  635. Map<String, dynamic> toJson() {
  636. final map = Map<String, dynamic>();
  637. if (title != null) {
  638. map['Title'] = title;
  639. }
  640. map['Status'] = status.index;
  641. map['ScheduleType'] = scheduleType.index;
  642. if (startTime != null) {
  643. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  644. }
  645. if (endTime != null) {
  646. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  647. }
  648. if (relevanceCode != null) {
  649. map['RelevanceCode'] = relevanceCode;
  650. }
  651. return map;
  652. }
  653. }
  654. class FindSchedulesRequest extends TokenRequest{
  655. DateTime? startTime;
  656. DateTime? endTime;
  657. FindSchedulesRequest({
  658. this.startTime,
  659. this.endTime,
  660. String? token,
  661. }) : super(
  662. token: token,
  663. );
  664. factory FindSchedulesRequest.fromJson(Map<String, dynamic> map) {
  665. return FindSchedulesRequest(
  666. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  667. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  668. token: map['Token'],
  669. );
  670. }
  671. Map<String, dynamic> toJson() {
  672. final map = super.toJson();
  673. if (startTime != null)
  674. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  675. if (endTime != null)
  676. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  677. return map;
  678. }
  679. }
  680. enum ApplicantTypeEnum {
  681. Client,
  682. Device,
  683. Management,
  684. ThirdParty,
  685. Server,
  686. }
  687. class MessageExtendInfoDTO extends BaseDTO{
  688. String? messageCode;
  689. NotificationTypeEnum notificationType;
  690. String? content;
  691. DateTime? notifyTime;
  692. ApplicantTypeEnum receiverType;
  693. String? relevanceCode;
  694. bool isReaded;
  695. DateTime? deliveryTime;
  696. DateTime? readTime;
  697. MessageExtendInfoDTO({
  698. this.messageCode,
  699. this.notificationType = NotificationTypeEnum.Unknown,
  700. this.content,
  701. this.notifyTime,
  702. this.receiverType = ApplicantTypeEnum.Client,
  703. this.relevanceCode,
  704. this.isReaded = false,
  705. this.deliveryTime,
  706. this.readTime,
  707. DateTime? createTime,
  708. DateTime? updateTime,
  709. }) : super(
  710. createTime: createTime,
  711. updateTime: updateTime,
  712. );
  713. factory MessageExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  714. return MessageExtendInfoDTO(
  715. messageCode: map['MessageCode'],
  716. notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
  717. content: map['Content'],
  718. notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
  719. receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
  720. relevanceCode: map['RelevanceCode'],
  721. isReaded: map['IsReaded'],
  722. deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
  723. readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
  724. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  725. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  726. );
  727. }
  728. Map<String, dynamic> toJson() {
  729. final map = super.toJson();
  730. if (messageCode != null)
  731. map['MessageCode'] = messageCode;
  732. map['NotificationType'] = notificationType.index;
  733. if (content != null)
  734. map['Content'] = content;
  735. if (notifyTime != null)
  736. map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
  737. map['ReceiverType'] = receiverType.index;
  738. if (relevanceCode != null)
  739. map['RelevanceCode'] = relevanceCode;
  740. map['IsReaded'] = isReaded;
  741. if (deliveryTime != null)
  742. map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
  743. if (readTime != null)
  744. map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
  745. return map;
  746. }
  747. }
  748. class QueryMessageListRequest extends PageRequest{
  749. TransactionTypeEnum transactionType;
  750. String? keyword;
  751. QueryMessageListRequest({
  752. this.transactionType = TransactionTypeEnum.Consultion,
  753. this.keyword,
  754. int pageIndex = 0,
  755. int pageSize = 0,
  756. String? token,
  757. }) : super(
  758. pageIndex: pageIndex,
  759. pageSize: pageSize,
  760. token: token,
  761. );
  762. factory QueryMessageListRequest.fromJson(Map<String, dynamic> map) {
  763. return QueryMessageListRequest(
  764. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  765. keyword: map['Keyword'],
  766. pageIndex: map['PageIndex'],
  767. pageSize: map['PageSize'],
  768. token: map['Token'],
  769. );
  770. }
  771. Map<String, dynamic> toJson() {
  772. final map = super.toJson();
  773. map['TransactionType'] = transactionType.index;
  774. if (keyword != null)
  775. map['Keyword'] = keyword;
  776. return map;
  777. }
  778. }
  779. class SetMessageDeliveryRequest extends TokenRequest{
  780. String? messageCode;
  781. bool isReaded;
  782. SetMessageDeliveryRequest({
  783. this.messageCode,
  784. this.isReaded = false,
  785. String? token,
  786. }) : super(
  787. token: token,
  788. );
  789. factory SetMessageDeliveryRequest.fromJson(Map<String, dynamic> map) {
  790. return SetMessageDeliveryRequest(
  791. messageCode: map['MessageCode'],
  792. isReaded: map['IsReaded'],
  793. token: map['Token'],
  794. );
  795. }
  796. Map<String, dynamic> toJson() {
  797. final map = super.toJson();
  798. if (messageCode != null)
  799. map['MessageCode'] = messageCode;
  800. map['IsReaded'] = isReaded;
  801. return map;
  802. }
  803. }
  804. class SetMessageInfoReqeust extends TokenRequest{
  805. List<String>? messageCodes;
  806. SetMessageInfoReqeust({
  807. this.messageCodes,
  808. String? token,
  809. }) : super(
  810. token: token,
  811. );
  812. factory SetMessageInfoReqeust.fromJson(Map<String, dynamic> map) {
  813. return SetMessageInfoReqeust(
  814. messageCodes: map['MessageCodes']?.cast<String>().toList(),
  815. token: map['Token'],
  816. );
  817. }
  818. Map<String, dynamic> toJson() {
  819. final map = super.toJson();
  820. if (messageCodes != null)
  821. map['MessageCodes'] = messageCodes;
  822. return map;
  823. }
  824. }
  825. class AnnouncementExtendInfoDTO extends BaseDTO{
  826. String? announcementCode;
  827. AnnouncementTypeEnum announcementType;
  828. String? language;
  829. String? title;
  830. String? content;
  831. AnnouncementExtendInfoDTO({
  832. this.announcementCode,
  833. this.announcementType = AnnouncementTypeEnum.Broadcast,
  834. this.language,
  835. this.title,
  836. this.content,
  837. DateTime? createTime,
  838. DateTime? updateTime,
  839. }) : super(
  840. createTime: createTime,
  841. updateTime: updateTime,
  842. );
  843. factory AnnouncementExtendInfoDTO.fromJson(Map<String, dynamic> map) {
  844. return AnnouncementExtendInfoDTO(
  845. announcementCode: map['AnnouncementCode'],
  846. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  847. language: map['Language'],
  848. title: map['Title'],
  849. content: map['Content'],
  850. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  851. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  852. );
  853. }
  854. Map<String, dynamic> toJson() {
  855. final map = super.toJson();
  856. if (announcementCode != null)
  857. map['AnnouncementCode'] = announcementCode;
  858. map['AnnouncementType'] = announcementType.index;
  859. if (language != null)
  860. map['Language'] = language;
  861. if (title != null)
  862. map['Title'] = title;
  863. if (content != null)
  864. map['Content'] = content;
  865. return map;
  866. }
  867. }
  868. class QueryAnnouncementListRequest extends PageRequest{
  869. AnnouncementTypeEnum announcementType;
  870. String? language;
  871. String? keyword;
  872. DateTime? startTime;
  873. DateTime? endTime;
  874. QueryAnnouncementListRequest({
  875. this.announcementType = AnnouncementTypeEnum.Broadcast,
  876. this.language,
  877. this.keyword,
  878. this.startTime,
  879. this.endTime,
  880. int pageIndex = 0,
  881. int pageSize = 0,
  882. String? token,
  883. }) : super(
  884. pageIndex: pageIndex,
  885. pageSize: pageSize,
  886. token: token,
  887. );
  888. factory QueryAnnouncementListRequest.fromJson(Map<String, dynamic> map) {
  889. return QueryAnnouncementListRequest(
  890. announcementType: AnnouncementTypeEnum.values.firstWhere((e) => e.index == map['AnnouncementType']),
  891. language: map['Language'],
  892. keyword: map['Keyword'],
  893. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  894. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  895. pageIndex: map['PageIndex'],
  896. pageSize: map['PageSize'],
  897. token: map['Token'],
  898. );
  899. }
  900. Map<String, dynamic> toJson() {
  901. final map = super.toJson();
  902. map['AnnouncementType'] = announcementType.index;
  903. if (language != null)
  904. map['Language'] = language;
  905. if (keyword != null)
  906. map['Keyword'] = keyword;
  907. if (startTime != null)
  908. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  909. if (endTime != null)
  910. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  911. return map;
  912. }
  913. }
  914. class GetAnnouncementRequest extends TokenRequest{
  915. String? announcementCode;
  916. String? language;
  917. GetAnnouncementRequest({
  918. this.announcementCode,
  919. this.language,
  920. String? token,
  921. }) : super(
  922. token: token,
  923. );
  924. factory GetAnnouncementRequest.fromJson(Map<String, dynamic> map) {
  925. return GetAnnouncementRequest(
  926. announcementCode: map['AnnouncementCode'],
  927. language: map['Language'],
  928. token: map['Token'],
  929. );
  930. }
  931. Map<String, dynamic> toJson() {
  932. final map = super.toJson();
  933. if (announcementCode != null)
  934. map['AnnouncementCode'] = announcementCode;
  935. if (language != null)
  936. map['Language'] = language;
  937. return map;
  938. }
  939. }
  940. class NoReadMessagesDTO {
  941. int count;
  942. List<String>? noReadCodes;
  943. NoReadMessagesDTO({
  944. this.count = 0,
  945. this.noReadCodes,
  946. });
  947. factory NoReadMessagesDTO.fromJson(Map<String, dynamic> map) {
  948. return NoReadMessagesDTO(
  949. count: map['Count'],
  950. noReadCodes: map['NoReadCodes']?.cast<String>().toList(),
  951. );
  952. }
  953. Map<String, dynamic> toJson() {
  954. final map = Map<String, dynamic>();
  955. map['Count'] = count;
  956. if (noReadCodes != null) {
  957. map['NoReadCodes'] = noReadCodes;
  958. }
  959. return map;
  960. }
  961. }
  962. class GetNoReadMessagesRequest extends TokenRequest{
  963. TransactionTypeEnum transactionType;
  964. GetNoReadMessagesRequest({
  965. this.transactionType = TransactionTypeEnum.Consultion,
  966. String? token,
  967. }) : super(
  968. token: token,
  969. );
  970. factory GetNoReadMessagesRequest.fromJson(Map<String, dynamic> map) {
  971. return GetNoReadMessagesRequest(
  972. transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
  973. token: map['Token'],
  974. );
  975. }
  976. Map<String, dynamic> toJson() {
  977. final map = super.toJson();
  978. map['TransactionType'] = transactionType.index;
  979. return map;
  980. }
  981. }
  982. class RemoveUserSingleTokenRequest extends TokenRequest{
  983. String? wSToken;
  984. RemoveUserSingleTokenRequest({
  985. this.wSToken,
  986. String? token,
  987. }) : super(
  988. token: token,
  989. );
  990. factory RemoveUserSingleTokenRequest.fromJson(Map<String, dynamic> map) {
  991. return RemoveUserSingleTokenRequest(
  992. wSToken: map['WSToken'],
  993. token: map['Token'],
  994. );
  995. }
  996. Map<String, dynamic> toJson() {
  997. final map = super.toJson();
  998. if (wSToken != null)
  999. map['WSToken'] = wSToken;
  1000. return map;
  1001. }
  1002. }
  1003. enum UserMigratoryRoleEnum {
  1004. Role_ExpertAssistant,
  1005. Role_CertifiedExpert,
  1006. Role_CertifiedPhysician,
  1007. Role_RemoteManager,
  1008. Role_UnSet,
  1009. }
  1010. class UserMigratoryInfo extends UserDTO{
  1011. bool isDelete;
  1012. String? secretPassword;
  1013. DateTime? passwordUpdateTime;
  1014. List<String>? passwordRecords;
  1015. UserMigratoryRoleEnum userRole;
  1016. String? remoteMainFeature;
  1017. UserMigratoryInfo({
  1018. this.isDelete = false,
  1019. this.secretPassword,
  1020. this.passwordUpdateTime,
  1021. this.passwordRecords,
  1022. this.userRole = UserMigratoryRoleEnum.Role_ExpertAssistant,
  1023. this.remoteMainFeature,
  1024. String? nickName,
  1025. String? organizationCode,
  1026. String? organizationName,
  1027. String? departmentCode,
  1028. String? departmentName,
  1029. String? departmentShortCode,
  1030. String? rootOrganizationCode,
  1031. String? rootOrganizationName,
  1032. List<String>? authorityGroups,
  1033. List<String>? bindDevices,
  1034. List<String>? bindDeviceOrganizations,
  1035. String? lastIP,
  1036. int logintimes = 0,
  1037. UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
  1038. List<String>? roleCodes,
  1039. List<String>? rankCodes,
  1040. List<String>? positionCodes,
  1041. ApplyStateEnum applyState = ApplyStateEnum.NotApply,
  1042. String? rankName,
  1043. String? positionName,
  1044. bool isDirector = false,
  1045. List<String>? fieldList,
  1046. List<String>? deletePatientCodes,
  1047. bool isBatchExportDiagnoseData = false,
  1048. String? bindAssistantUserCode,
  1049. String? bindAssistantDoctorUserCode,
  1050. LoginLockInfoDTO? loginLockInfo,
  1051. String? signature,
  1052. String? language,
  1053. bool enableReportLabel = false,
  1054. List<AssociatedInfoDTO>? associatedInfos,
  1055. String? commonPlatformUserId,
  1056. String? bindEmergencyDeviceCode,
  1057. String? bindEmergencyExpertCode,
  1058. List<String>? dashboardOrgCodes,
  1059. String? organizationShortCode,
  1060. String? rootOrganizationShortCode,
  1061. bool isOldAgent = false,
  1062. List<String>? userFeatureCodes,
  1063. String? phone,
  1064. String? email,
  1065. String? userCode,
  1066. String? userName,
  1067. String? fullName,
  1068. String? headImageUrl,
  1069. String? displayName,
  1070. DateTime? createTime,
  1071. DateTime? updateTime,
  1072. }) : super(
  1073. nickName: nickName,
  1074. organizationCode: organizationCode,
  1075. organizationName: organizationName,
  1076. departmentCode: departmentCode,
  1077. departmentName: departmentName,
  1078. departmentShortCode: departmentShortCode,
  1079. rootOrganizationCode: rootOrganizationCode,
  1080. rootOrganizationName: rootOrganizationName,
  1081. authorityGroups: authorityGroups,
  1082. bindDevices: bindDevices,
  1083. bindDeviceOrganizations: bindDeviceOrganizations,
  1084. lastIP: lastIP,
  1085. logintimes: logintimes,
  1086. userState: userState,
  1087. roleCodes: roleCodes,
  1088. rankCodes: rankCodes,
  1089. positionCodes: positionCodes,
  1090. applyState: applyState,
  1091. rankName: rankName,
  1092. positionName: positionName,
  1093. isDirector: isDirector,
  1094. fieldList: fieldList,
  1095. deletePatientCodes: deletePatientCodes,
  1096. isBatchExportDiagnoseData: isBatchExportDiagnoseData,
  1097. bindAssistantUserCode: bindAssistantUserCode,
  1098. bindAssistantDoctorUserCode: bindAssistantDoctorUserCode,
  1099. loginLockInfo: loginLockInfo,
  1100. signature: signature,
  1101. language: language,
  1102. enableReportLabel: enableReportLabel,
  1103. associatedInfos: associatedInfos,
  1104. commonPlatformUserId: commonPlatformUserId,
  1105. bindEmergencyDeviceCode: bindEmergencyDeviceCode,
  1106. bindEmergencyExpertCode: bindEmergencyExpertCode,
  1107. dashboardOrgCodes: dashboardOrgCodes,
  1108. organizationShortCode: organizationShortCode,
  1109. rootOrganizationShortCode: rootOrganizationShortCode,
  1110. isOldAgent: isOldAgent,
  1111. userFeatureCodes: userFeatureCodes,
  1112. phone: phone,
  1113. email: email,
  1114. userCode: userCode,
  1115. userName: userName,
  1116. fullName: fullName,
  1117. headImageUrl: headImageUrl,
  1118. displayName: displayName,
  1119. createTime: createTime,
  1120. updateTime: updateTime,
  1121. );
  1122. factory UserMigratoryInfo.fromJson(Map<String, dynamic> map) {
  1123. return UserMigratoryInfo(
  1124. isDelete: map['IsDelete'],
  1125. secretPassword: map['SecretPassword'],
  1126. passwordUpdateTime: map['PasswordUpdateTime'] != null ? DateTime.parse(map['PasswordUpdateTime']) : null,
  1127. passwordRecords: map['PasswordRecords']?.cast<String>().toList(),
  1128. userRole: UserMigratoryRoleEnum.values.firstWhere((e) => e.index == map['UserRole']),
  1129. remoteMainFeature: map['RemoteMainFeature'],
  1130. nickName: map['NickName'],
  1131. organizationCode: map['OrganizationCode'],
  1132. organizationName: map['OrganizationName'],
  1133. departmentCode: map['DepartmentCode'],
  1134. departmentName: map['DepartmentName'],
  1135. departmentShortCode: map['DepartmentShortCode'],
  1136. rootOrganizationCode: map['RootOrganizationCode'],
  1137. rootOrganizationName: map['RootOrganizationName'],
  1138. authorityGroups: map['AuthorityGroups']?.cast<String>().toList(),
  1139. bindDevices: map['BindDevices']?.cast<String>().toList(),
  1140. bindDeviceOrganizations: map['BindDeviceOrganizations']?.cast<String>().toList(),
  1141. lastIP: map['LastIP'],
  1142. logintimes: map['Logintimes'],
  1143. userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
  1144. roleCodes: map['RoleCodes']?.cast<String>().toList(),
  1145. rankCodes: map['RankCodes']?.cast<String>().toList(),
  1146. positionCodes: map['PositionCodes']?.cast<String>().toList(),
  1147. applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
  1148. rankName: map['RankName'],
  1149. positionName: map['PositionName'],
  1150. isDirector: map['IsDirector'],
  1151. fieldList: map['FieldList']?.cast<String>().toList(),
  1152. deletePatientCodes: map['DeletePatientCodes']?.cast<String>().toList(),
  1153. isBatchExportDiagnoseData: map['IsBatchExportDiagnoseData'],
  1154. bindAssistantUserCode: map['BindAssistantUserCode'],
  1155. bindAssistantDoctorUserCode: map['BindAssistantDoctorUserCode'],
  1156. loginLockInfo: map['LoginLockInfo'] != null ? LoginLockInfoDTO.fromJson(map['LoginLockInfo']) : null,
  1157. signature: map['Signature'],
  1158. language: map['Language'],
  1159. enableReportLabel: map['EnableReportLabel'],
  1160. associatedInfos: map['AssociatedInfos'] != null ? (map['AssociatedInfos'] as List).map((e)=>AssociatedInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  1161. commonPlatformUserId: map['CommonPlatformUserId'],
  1162. bindEmergencyDeviceCode: map['BindEmergencyDeviceCode'],
  1163. bindEmergencyExpertCode: map['BindEmergencyExpertCode'],
  1164. dashboardOrgCodes: map['DashboardOrgCodes']?.cast<String>().toList(),
  1165. organizationShortCode: map['OrganizationShortCode'],
  1166. rootOrganizationShortCode: map['RootOrganizationShortCode'],
  1167. isOldAgent: map['IsOldAgent'],
  1168. userFeatureCodes: map['UserFeatureCodes']?.cast<String>().toList(),
  1169. phone: map['Phone'],
  1170. email: map['Email'],
  1171. userCode: map['UserCode'],
  1172. userName: map['UserName'],
  1173. fullName: map['FullName'],
  1174. headImageUrl: map['HeadImageUrl'],
  1175. displayName: map['DisplayName'],
  1176. createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
  1177. updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
  1178. );
  1179. }
  1180. Map<String, dynamic> toJson() {
  1181. final map = super.toJson();
  1182. map['IsDelete'] = isDelete;
  1183. if (secretPassword != null)
  1184. map['SecretPassword'] = secretPassword;
  1185. if (passwordUpdateTime != null)
  1186. map['PasswordUpdateTime'] = JsonRpcUtils.dateFormat(passwordUpdateTime!);
  1187. if (passwordRecords != null)
  1188. map['PasswordRecords'] = passwordRecords;
  1189. map['UserRole'] = userRole.index;
  1190. if (remoteMainFeature != null)
  1191. map['RemoteMainFeature'] = remoteMainFeature;
  1192. return map;
  1193. }
  1194. }
  1195. class BatchInsertUserRequest extends TokenRequest{
  1196. SyncDBEnum syncType;
  1197. List<UserMigratoryInfo>? userMigratorys;
  1198. BatchInsertUserRequest({
  1199. this.syncType = SyncDBEnum.Migrate,
  1200. this.userMigratorys,
  1201. String? token,
  1202. }) : super(
  1203. token: token,
  1204. );
  1205. factory BatchInsertUserRequest.fromJson(Map<String, dynamic> map) {
  1206. return BatchInsertUserRequest(
  1207. syncType: SyncDBEnum.values.firstWhere((e) => e.index == map['SyncType']),
  1208. userMigratorys: map['UserMigratorys'] != null ? (map['UserMigratorys'] as List).map((e)=>UserMigratoryInfo.fromJson(e as Map<String,dynamic>)).toList() : null,
  1209. token: map['Token'],
  1210. );
  1211. }
  1212. Map<String, dynamic> toJson() {
  1213. final map = super.toJson();
  1214. map['SyncType'] = syncType.index;
  1215. if (userMigratorys != null)
  1216. map['UserMigratorys'] = userMigratorys;
  1217. return map;
  1218. }
  1219. }
  1220. enum MigrateRecordType {
  1221. Default,
  1222. MigrateDataCenter,
  1223. }
  1224. class MigrateRecordDTO {
  1225. DateTime? startTime;
  1226. DateTime? endTime;
  1227. MigrateRecordType type;
  1228. MigrateRecordDTO({
  1229. this.startTime,
  1230. this.endTime,
  1231. this.type = MigrateRecordType.Default,
  1232. });
  1233. factory MigrateRecordDTO.fromJson(Map<String, dynamic> map) {
  1234. return MigrateRecordDTO(
  1235. startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
  1236. endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
  1237. type: MigrateRecordType.values.firstWhere((e) => e.index == map['Type']),
  1238. );
  1239. }
  1240. Map<String, dynamic> toJson() {
  1241. final map = Map<String, dynamic>();
  1242. if (startTime != null) {
  1243. map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
  1244. }
  1245. if (endTime != null) {
  1246. map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
  1247. }
  1248. map['Type'] = type.index;
  1249. return map;
  1250. }
  1251. }
  1252. class QueryMigrateTimeRequest extends TokenRequest{
  1253. bool isInitMigreate;
  1254. QueryMigrateTimeRequest({
  1255. this.isInitMigreate = false,
  1256. String? token,
  1257. }) : super(
  1258. token: token,
  1259. );
  1260. factory QueryMigrateTimeRequest.fromJson(Map<String, dynamic> map) {
  1261. return QueryMigrateTimeRequest(
  1262. isInitMigreate: map['IsInitMigreate'],
  1263. token: map['Token'],
  1264. );
  1265. }
  1266. Map<String, dynamic> toJson() {
  1267. final map = super.toJson();
  1268. map['IsInitMigreate'] = isInitMigreate;
  1269. return map;
  1270. }
  1271. }
  1272. enum VerificationTypeEnum {
  1273. Password,
  1274. PhoneVerificationCode,
  1275. EmailVerificationCode,
  1276. }
  1277. class CommonLogOffRequest extends TokenRequest{
  1278. VerificationTypeEnum verificationType;
  1279. String? anyCode;
  1280. CommonLogOffRequest({
  1281. this.verificationType = VerificationTypeEnum.Password,
  1282. this.anyCode,
  1283. String? token,
  1284. }) : super(
  1285. token: token,
  1286. );
  1287. factory CommonLogOffRequest.fromJson(Map<String, dynamic> map) {
  1288. return CommonLogOffRequest(
  1289. verificationType: VerificationTypeEnum.values.firstWhere((e) => e.index == map['VerificationType']),
  1290. anyCode: map['AnyCode'],
  1291. token: map['Token'],
  1292. );
  1293. }
  1294. Map<String, dynamic> toJson() {
  1295. final map = super.toJson();
  1296. map['VerificationType'] = verificationType.index;
  1297. if (anyCode != null)
  1298. map['AnyCode'] = anyCode;
  1299. return map;
  1300. }
  1301. }