login.m.dart 17 KB

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