login.m.dart 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. import 'authentication.m.dart';
  2. import 'notification.m.dart';
  3. import 'liveConsultation.m.dart';
  4. enum LoginStateEnum {
  5. Succeed,
  6. PasswordIncorrect,
  7. }
  8. class LoginResult {
  9. LoginStateEnum loginState;
  10. String? token;
  11. int? lockRemainingTimes;
  12. bool passwordExpired;
  13. String? accountName;
  14. LoginResult({
  15. this.loginState = LoginStateEnum.Succeed,
  16. this.token,
  17. this.lockRemainingTimes,
  18. this.passwordExpired = false,
  19. this.accountName,
  20. });
  21. factory LoginResult.fromJson(Map<String, dynamic> map) {
  22. return LoginResult(
  23. loginState: LoginStateEnum.values.firstWhere((e) => e.index == map['LoginState']),
  24. token: map['Token'],
  25. lockRemainingTimes: map['LockRemainingTimes'],
  26. passwordExpired: map['PasswordExpired'],
  27. accountName: map['AccountName'],
  28. );
  29. }
  30. Map<String, dynamic> toJson() {
  31. final map = Map<String, dynamic>();
  32. map['LoginState'] = loginState.index;
  33. if (token != null) {
  34. map['Token'] = token;
  35. }
  36. if (lockRemainingTimes != null) {
  37. map['LockRemainingTimes'] = lockRemainingTimes;
  38. }
  39. map['PasswordExpired'] = passwordExpired;
  40. if (accountName != null) {
  41. map['AccountName'] = accountName;
  42. }
  43. return map;
  44. }
  45. }
  46. class CommonLoginRequest {
  47. String? anyAccount;
  48. String? anyCode;
  49. String? password;
  50. Map<String,String>? headerMap;
  51. Platform platform;
  52. LoginSource loginSource;
  53. String? installVersion;
  54. CommonLoginRequest({
  55. this.anyAccount,
  56. this.anyCode,
  57. this.password,
  58. this.headerMap,
  59. this.platform = Platform.Windows,
  60. this.loginSource = LoginSource.PC,
  61. this.installVersion,
  62. });
  63. factory CommonLoginRequest.fromJson(Map<String, dynamic> map) {
  64. return CommonLoginRequest(
  65. anyAccount: map['AnyAccount'],
  66. anyCode: map['AnyCode'],
  67. password: map['Password'],
  68. headerMap: map['HeaderMap']?.cast<String,String>(),
  69. platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
  70. loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
  71. installVersion: map['InstallVersion'],
  72. );
  73. }
  74. Map<String, dynamic> toJson() {
  75. final map = Map<String, dynamic>();
  76. if (anyAccount != null) {
  77. map['AnyAccount'] = anyAccount;
  78. }
  79. if (anyCode != null) {
  80. map['AnyCode'] = anyCode;
  81. }
  82. if (password != null) {
  83. map['Password'] = password;
  84. }
  85. if (headerMap != null) {
  86. map['HeaderMap'] = headerMap;
  87. }
  88. map['Platform'] = platform.index;
  89. map['LoginSource'] = loginSource.index;
  90. if (installVersion != null) {
  91. map['InstallVersion'] = installVersion;
  92. }
  93. return map;
  94. }
  95. }
  96. class CheckLoginTypeRequest {
  97. String? anyAccount;
  98. CheckLoginTypeRequest({
  99. this.anyAccount,
  100. });
  101. factory CheckLoginTypeRequest.fromJson(Map<String, dynamic> map) {
  102. return CheckLoginTypeRequest(
  103. anyAccount: map['AnyAccount'],
  104. );
  105. }
  106. Map<String, dynamic> toJson() {
  107. final map = Map<String, dynamic>();
  108. if (anyAccount != null) {
  109. map['AnyAccount'] = anyAccount;
  110. }
  111. return map;
  112. }
  113. }
  114. class CommonSignUpRequest {
  115. String? anyAccount;
  116. String? anyCode;
  117. String? password;
  118. Map<String,String>? headerMap;
  119. CommonSignUpRequest({
  120. this.anyAccount,
  121. this.anyCode,
  122. this.password,
  123. this.headerMap,
  124. });
  125. factory CommonSignUpRequest.fromJson(Map<String, dynamic> map) {
  126. return CommonSignUpRequest(
  127. anyAccount: map['AnyAccount'],
  128. anyCode: map['AnyCode'],
  129. password: map['Password'],
  130. headerMap: map['HeaderMap']?.cast<String,String>(),
  131. );
  132. }
  133. Map<String, dynamic> toJson() {
  134. final map = Map<String, dynamic>();
  135. if (anyAccount != null) {
  136. map['AnyAccount'] = anyAccount;
  137. }
  138. if (anyCode != null) {
  139. map['AnyCode'] = anyCode;
  140. }
  141. if (password != null) {
  142. map['Password'] = password;
  143. }
  144. if (headerMap != null) {
  145. map['HeaderMap'] = headerMap;
  146. }
  147. return map;
  148. }
  149. }
  150. class CheckSMSVerificationCodeRequest {
  151. String? userPhone;
  152. String? verifyCode;
  153. CheckSMSVerificationCodeRequest({
  154. this.userPhone,
  155. this.verifyCode,
  156. });
  157. factory CheckSMSVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  158. return CheckSMSVerificationCodeRequest(
  159. userPhone: map['UserPhone'],
  160. verifyCode: map['VerifyCode'],
  161. );
  162. }
  163. Map<String, dynamic> toJson() {
  164. final map = Map<String, dynamic>();
  165. if (userPhone != null) {
  166. map['UserPhone'] = userPhone;
  167. }
  168. if (verifyCode != null) {
  169. map['VerifyCode'] = verifyCode;
  170. }
  171. return map;
  172. }
  173. }
  174. class SendSMSVerificationCodeRequest {
  175. String? userPhone;
  176. SendSMSVerificationCodeRequest({
  177. this.userPhone,
  178. });
  179. factory SendSMSVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  180. return SendSMSVerificationCodeRequest(
  181. userPhone: map['UserPhone'],
  182. );
  183. }
  184. Map<String, dynamic> toJson() {
  185. final map = Map<String, dynamic>();
  186. if (userPhone != null) {
  187. map['UserPhone'] = userPhone;
  188. }
  189. return map;
  190. }
  191. }
  192. class SendEmailVerificationCodeRequest {
  193. String? emailAddress;
  194. String? languageCode;
  195. SendEmailVerificationCodeRequest({
  196. this.emailAddress,
  197. this.languageCode,
  198. });
  199. factory SendEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  200. return SendEmailVerificationCodeRequest(
  201. emailAddress: map['EmailAddress'],
  202. languageCode: map['LanguageCode'],
  203. );
  204. }
  205. Map<String, dynamic> toJson() {
  206. final map = Map<String, dynamic>();
  207. if (emailAddress != null) {
  208. map['EmailAddress'] = emailAddress;
  209. }
  210. if (languageCode != null) {
  211. map['LanguageCode'] = languageCode;
  212. }
  213. return map;
  214. }
  215. }
  216. class CheckEmailVerificationCodeRequest {
  217. String? emailAddress;
  218. String? verifyCode;
  219. CheckEmailVerificationCodeRequest({
  220. this.emailAddress,
  221. this.verifyCode,
  222. });
  223. factory CheckEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
  224. return CheckEmailVerificationCodeRequest(
  225. emailAddress: map['EmailAddress'],
  226. verifyCode: map['VerifyCode'],
  227. );
  228. }
  229. Map<String, dynamic> toJson() {
  230. final map = Map<String, dynamic>();
  231. if (emailAddress != null) {
  232. map['EmailAddress'] = emailAddress;
  233. }
  234. if (verifyCode != null) {
  235. map['VerifyCode'] = verifyCode;
  236. }
  237. return map;
  238. }
  239. }
  240. class RetrievePasswordByPhoneRequest {
  241. String? phone;
  242. String? verifyCode;
  243. String? newPassword;
  244. RetrievePasswordByPhoneRequest({
  245. this.phone,
  246. this.verifyCode,
  247. this.newPassword,
  248. });
  249. factory RetrievePasswordByPhoneRequest.fromJson(Map<String, dynamic> map) {
  250. return RetrievePasswordByPhoneRequest(
  251. phone: map['Phone'],
  252. verifyCode: map['VerifyCode'],
  253. newPassword: map['NewPassword'],
  254. );
  255. }
  256. Map<String, dynamic> toJson() {
  257. final map = Map<String, dynamic>();
  258. if (phone != null) {
  259. map['Phone'] = phone;
  260. }
  261. if (verifyCode != null) {
  262. map['VerifyCode'] = verifyCode;
  263. }
  264. if (newPassword != null) {
  265. map['NewPassword'] = newPassword;
  266. }
  267. return map;
  268. }
  269. }
  270. class RetrievePasswordByEmailRequest {
  271. String? mail;
  272. String? verifyCode;
  273. String? newPassword;
  274. RetrievePasswordByEmailRequest({
  275. this.mail,
  276. this.verifyCode,
  277. this.newPassword,
  278. });
  279. factory RetrievePasswordByEmailRequest.fromJson(Map<String, dynamic> map) {
  280. return RetrievePasswordByEmailRequest(
  281. mail: map['Mail'],
  282. verifyCode: map['VerifyCode'],
  283. newPassword: map['NewPassword'],
  284. );
  285. }
  286. Map<String, dynamic> toJson() {
  287. final map = Map<String, dynamic>();
  288. if (mail != null) {
  289. map['Mail'] = mail;
  290. }
  291. if (verifyCode != null) {
  292. map['VerifyCode'] = verifyCode;
  293. }
  294. if (newPassword != null) {
  295. map['NewPassword'] = newPassword;
  296. }
  297. return map;
  298. }
  299. }
  300. class VerifyAccountRequest {
  301. String? userName;
  302. VerifyAccountRequest({
  303. this.userName,
  304. });
  305. factory VerifyAccountRequest.fromJson(Map<String, dynamic> map) {
  306. return VerifyAccountRequest(
  307. userName: map['UserName'],
  308. );
  309. }
  310. Map<String, dynamic> toJson() {
  311. final map = Map<String, dynamic>();
  312. if (userName != null) {
  313. map['UserName'] = userName;
  314. }
  315. return map;
  316. }
  317. }
  318. class ModifyPasswordRequest extends CommonSignUpRequest{
  319. String? token;
  320. String? newPassword;
  321. ModifyPasswordRequest({
  322. this.token,
  323. this.newPassword,
  324. String? anyAccount,
  325. String? anyCode,
  326. String? password,
  327. Map<String,String>? headerMap,
  328. }) : super(
  329. anyAccount: anyAccount,
  330. anyCode: anyCode,
  331. password: password,
  332. headerMap: headerMap,
  333. );
  334. factory ModifyPasswordRequest.fromJson(Map<String, dynamic> map) {
  335. return ModifyPasswordRequest(
  336. token: map['Token'],
  337. newPassword: map['NewPassword'],
  338. anyAccount: map['AnyAccount'],
  339. anyCode: map['AnyCode'],
  340. password: map['Password'],
  341. headerMap: map['HeaderMap']?.cast<String,String>(),
  342. );
  343. }
  344. Map<String, dynamic> toJson() {
  345. final map = super.toJson();
  346. if (token != null)
  347. map['Token'] = token;
  348. if (newPassword != null)
  349. map['NewPassword'] = newPassword;
  350. return map;
  351. }
  352. }
  353. class GenerateNewPasswordRequest extends TokenRequest{
  354. GenerateNewPasswordRequest({
  355. String? token,
  356. }) : super(
  357. token: token,
  358. );
  359. factory GenerateNewPasswordRequest.fromJson(Map<String, dynamic> map) {
  360. return GenerateNewPasswordRequest(
  361. token: map['Token'],
  362. );
  363. }
  364. Map<String, dynamic> toJson() {
  365. final map = super.toJson();
  366. return map;
  367. }
  368. }
  369. enum AssociatedAccountResultEnum {
  370. Success,
  371. UserNotFind,
  372. UserNameIsEmpty,
  373. Error,
  374. }
  375. class StartAssociatedWithAccountResult {
  376. bool isSuccess;
  377. AssociatedAccountResultEnum state;
  378. StartAssociatedWithAccountResult({
  379. this.isSuccess = false,
  380. this.state = AssociatedAccountResultEnum.Success,
  381. });
  382. factory StartAssociatedWithAccountResult.fromJson(Map<String, dynamic> map) {
  383. return StartAssociatedWithAccountResult(
  384. isSuccess: map['IsSuccess'],
  385. state: AssociatedAccountResultEnum.values.firstWhere((e) => e.index == map['State']),
  386. );
  387. }
  388. Map<String, dynamic> toJson() {
  389. final map = Map<String, dynamic>();
  390. map['IsSuccess'] = isSuccess;
  391. map['State'] = state.index;
  392. return map;
  393. }
  394. }
  395. enum AssociateTypeEnum {
  396. FeedbackSystem,
  397. AgentAssessmentSystem,
  398. All,
  399. }
  400. class StartAssociatedWithAccountRequest extends TokenRequest{
  401. String? wingUserName;
  402. String? thirdPartyUserId;
  403. String? languageCode;
  404. bool needPullData;
  405. AssociateTypeEnum? associateType;
  406. StartAssociatedWithAccountRequest({
  407. this.wingUserName,
  408. this.thirdPartyUserId,
  409. this.languageCode,
  410. this.needPullData = false,
  411. this.associateType,
  412. String? token,
  413. }) : super(
  414. token: token,
  415. );
  416. factory StartAssociatedWithAccountRequest.fromJson(Map<String, dynamic> map) {
  417. return StartAssociatedWithAccountRequest(
  418. wingUserName: map['WingUserName'],
  419. thirdPartyUserId: map['ThirdPartyUserId'],
  420. languageCode: map['LanguageCode'],
  421. needPullData: map['NeedPullData'],
  422. associateType: map['AssociateType'] != null ? AssociateTypeEnum.values.firstWhere((e) => e.index == map['AssociateType']) : null,
  423. token: map['Token'],
  424. );
  425. }
  426. Map<String, dynamic> toJson() {
  427. final map = super.toJson();
  428. if (wingUserName != null)
  429. map['WingUserName'] = wingUserName;
  430. if (thirdPartyUserId != null)
  431. map['ThirdPartyUserId'] = thirdPartyUserId;
  432. if (languageCode != null)
  433. map['LanguageCode'] = languageCode;
  434. map['NeedPullData'] = needPullData;
  435. if (associateType != null)
  436. map['AssociateType'] = associateType;
  437. return map;
  438. }
  439. }
  440. class AssociatedFeatureInfoDTO extends AssociatedInfoDTO{
  441. String? featureCode;
  442. String? associatedPosition;
  443. AssociatedFeatureInfoDTO({
  444. this.featureCode,
  445. this.associatedPosition,
  446. String? id,
  447. String? relationName,
  448. String? title,
  449. String? cTitle,
  450. String? eTitle,
  451. String? icon,
  452. String? description,
  453. String? url,
  454. int index = 0,
  455. }) : super(
  456. id: id,
  457. relationName: relationName,
  458. title: title,
  459. cTitle: cTitle,
  460. eTitle: eTitle,
  461. icon: icon,
  462. description: description,
  463. url: url,
  464. index: index,
  465. );
  466. factory AssociatedFeatureInfoDTO.fromJson(Map<String, dynamic> map) {
  467. return AssociatedFeatureInfoDTO(
  468. featureCode: map['FeatureCode'],
  469. associatedPosition: map['AssociatedPosition'],
  470. id: map['Id'],
  471. relationName: map['RelationName'],
  472. title: map['Title'],
  473. cTitle: map['CTitle'],
  474. eTitle: map['ETitle'],
  475. icon: map['Icon'],
  476. description: map['Description'],
  477. url: map['Url'],
  478. index: map['Index'],
  479. );
  480. }
  481. Map<String, dynamic> toJson() {
  482. final map = super.toJson();
  483. if (featureCode != null)
  484. map['FeatureCode'] = featureCode;
  485. if (associatedPosition != null)
  486. map['AssociatedPosition'] = associatedPosition;
  487. return map;
  488. }
  489. }
  490. class GetAssociatedAccountInfoResult {
  491. bool isSuccess;
  492. List<AssociatedFeatureInfoDTO>? accountInfoList;
  493. GetAssociatedAccountInfoResult({
  494. this.isSuccess = false,
  495. this.accountInfoList,
  496. });
  497. factory GetAssociatedAccountInfoResult.fromJson(Map<String, dynamic> map) {
  498. return GetAssociatedAccountInfoResult(
  499. isSuccess: map['IsSuccess'],
  500. accountInfoList: map['AccountInfoList'] != null ? (map['AccountInfoList'] as List).map((e)=>AssociatedFeatureInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
  501. );
  502. }
  503. Map<String, dynamic> toJson() {
  504. final map = Map<String, dynamic>();
  505. map['IsSuccess'] = isSuccess;
  506. if (accountInfoList != null) {
  507. map['AccountInfoList'] = accountInfoList;
  508. }
  509. return map;
  510. }
  511. }
  512. class GetAssociatedAccountInfoRequest extends TokenRequest{
  513. AssociateTypeEnum? associateType;
  514. GetAssociatedAccountInfoRequest({
  515. this.associateType,
  516. String? token,
  517. }) : super(
  518. token: token,
  519. );
  520. factory GetAssociatedAccountInfoRequest.fromJson(Map<String, dynamic> map) {
  521. return GetAssociatedAccountInfoRequest(
  522. associateType: map['AssociateType'] != null ? AssociateTypeEnum.values.firstWhere((e) => e.index == map['AssociateType']) : null,
  523. token: map['Token'],
  524. );
  525. }
  526. Map<String, dynamic> toJson() {
  527. final map = super.toJson();
  528. if (associateType != null)
  529. map['AssociateType'] = associateType;
  530. return map;
  531. }
  532. }
  533. class ClearAssociatedWithAccountResult {
  534. bool isSuccess;
  535. AssociatedAccountResultEnum state;
  536. ClearAssociatedWithAccountResult({
  537. this.isSuccess = false,
  538. this.state = AssociatedAccountResultEnum.Success,
  539. });
  540. factory ClearAssociatedWithAccountResult.fromJson(Map<String, dynamic> map) {
  541. return ClearAssociatedWithAccountResult(
  542. isSuccess: map['IsSuccess'],
  543. state: AssociatedAccountResultEnum.values.firstWhere((e) => e.index == map['State']),
  544. );
  545. }
  546. Map<String, dynamic> toJson() {
  547. final map = Map<String, dynamic>();
  548. map['IsSuccess'] = isSuccess;
  549. map['State'] = state.index;
  550. return map;
  551. }
  552. }
  553. class ClearAssociatedWithAccountRequest extends TokenRequest{
  554. String? thirdPartyUserId;
  555. ClearAssociatedWithAccountRequest({
  556. this.thirdPartyUserId,
  557. String? token,
  558. }) : super(
  559. token: token,
  560. );
  561. factory ClearAssociatedWithAccountRequest.fromJson(Map<String, dynamic> map) {
  562. return ClearAssociatedWithAccountRequest(
  563. thirdPartyUserId: map['ThirdPartyUserId'],
  564. token: map['Token'],
  565. );
  566. }
  567. Map<String, dynamic> toJson() {
  568. final map = super.toJson();
  569. if (thirdPartyUserId != null)
  570. map['ThirdPartyUserId'] = thirdPartyUserId;
  571. return map;
  572. }
  573. }
  574. class GetScanCodeResult {
  575. int validSeconds;
  576. String? scanCode;
  577. GetScanCodeResult({
  578. this.validSeconds = 0,
  579. this.scanCode,
  580. });
  581. factory GetScanCodeResult.fromJson(Map<String, dynamic> map) {
  582. return GetScanCodeResult(
  583. validSeconds: map['ValidSeconds'],
  584. scanCode: map['ScanCode'],
  585. );
  586. }
  587. Map<String, dynamic> toJson() {
  588. final map = Map<String, dynamic>();
  589. map['ValidSeconds'] = validSeconds;
  590. if (scanCode != null) {
  591. map['ScanCode'] = scanCode;
  592. }
  593. return map;
  594. }
  595. }
  596. enum ScanLoginSource {
  597. PC,
  598. Web,
  599. US,
  600. }
  601. class GetScanCodeRequest {
  602. ScanLoginSource scanLoginSource;
  603. Platform platform;
  604. String? installVersion;
  605. GetScanCodeRequest({
  606. this.scanLoginSource = ScanLoginSource.PC,
  607. this.platform = Platform.Windows,
  608. this.installVersion,
  609. });
  610. factory GetScanCodeRequest.fromJson(Map<String, dynamic> map) {
  611. return GetScanCodeRequest(
  612. scanLoginSource: ScanLoginSource.values.firstWhere((e) => e.index == map['ScanLoginSource']),
  613. platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
  614. installVersion: map['InstallVersion'],
  615. );
  616. }
  617. Map<String, dynamic> toJson() {
  618. final map = Map<String, dynamic>();
  619. map['ScanLoginSource'] = scanLoginSource.index;
  620. map['Platform'] = platform.index;
  621. if (installVersion != null) {
  622. map['InstallVersion'] = installVersion;
  623. }
  624. return map;
  625. }
  626. }
  627. class ConfirmScanRequest extends TokenRequest{
  628. String? scanCode;
  629. ConfirmScanRequest({
  630. this.scanCode,
  631. String? token,
  632. }) : super(
  633. token: token,
  634. );
  635. factory ConfirmScanRequest.fromJson(Map<String, dynamic> map) {
  636. return ConfirmScanRequest(
  637. scanCode: map['ScanCode'],
  638. token: map['Token'],
  639. );
  640. }
  641. Map<String, dynamic> toJson() {
  642. final map = super.toJson();
  643. if (scanCode != null)
  644. map['ScanCode'] = scanCode;
  645. return map;
  646. }
  647. }
  648. enum CheckConfirmScanState {
  649. Wait,
  650. Success,
  651. Expire,
  652. }
  653. class CheckConfirmScanStateResult {
  654. CheckConfirmScanState checkConfirmScanState;
  655. LoginResult? loginResult;
  656. CheckConfirmScanStateResult({
  657. this.checkConfirmScanState = CheckConfirmScanState.Wait,
  658. this.loginResult,
  659. });
  660. factory CheckConfirmScanStateResult.fromJson(Map<String, dynamic> map) {
  661. return CheckConfirmScanStateResult(
  662. checkConfirmScanState: CheckConfirmScanState.values.firstWhere((e) => e.index == map['CheckConfirmScanState']),
  663. loginResult: map['LoginResult'] != null ? LoginResult.fromJson(map['LoginResult']) : null,
  664. );
  665. }
  666. Map<String, dynamic> toJson() {
  667. final map = Map<String, dynamic>();
  668. map['CheckConfirmScanState'] = checkConfirmScanState.index;
  669. if (loginResult != null) {
  670. map['LoginResult'] = loginResult;
  671. }
  672. return map;
  673. }
  674. }
  675. class CheckConfirmScanStateRequest {
  676. String? scanCode;
  677. CheckConfirmScanStateRequest({
  678. this.scanCode,
  679. });
  680. factory CheckConfirmScanStateRequest.fromJson(Map<String, dynamic> map) {
  681. return CheckConfirmScanStateRequest(
  682. scanCode: map['ScanCode'],
  683. );
  684. }
  685. Map<String, dynamic> toJson() {
  686. final map = Map<String, dynamic>();
  687. if (scanCode != null) {
  688. map['ScanCode'] = scanCode;
  689. }
  690. return map;
  691. }
  692. }