123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786 |
- import 'authentication.m.dart';
- import 'notification.m.dart';
- import 'liveConsultation.m.dart';
- enum LoginStateEnum {
- Succeed,
- PasswordIncorrect,
- SignOrLoginFail,
- }
- class LoginResult {
- LoginStateEnum loginState;
- String? token;
- int? lockRemainingTimes;
- bool passwordExpired;
- String? accountName;
- String? openId;
- LoginResult({
- this.loginState = LoginStateEnum.Succeed,
- this.token,
- this.lockRemainingTimes,
- this.passwordExpired = false,
- this.accountName,
- this.openId,
- });
- factory LoginResult.fromJson(Map<String, dynamic> map) {
- return LoginResult(
- loginState: LoginStateEnum.values.firstWhere((e) => e.index == map['LoginState']),
- token: map['Token'],
- lockRemainingTimes: map['LockRemainingTimes'],
- passwordExpired: map['PasswordExpired'],
- accountName: map['AccountName'],
- openId: map['OpenId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['LoginState'] = loginState.index;
- if (token != null) {
- map['Token'] = token;
- }
- if (lockRemainingTimes != null) {
- map['LockRemainingTimes'] = lockRemainingTimes;
- }
- map['PasswordExpired'] = passwordExpired;
- if (accountName != null) {
- map['AccountName'] = accountName;
- }
- if (openId != null) {
- map['OpenId'] = openId;
- }
- return map;
- }
- }
- class CommonLoginRequest {
- String? anyAccount;
- String? anyCode;
- String? password;
- Map<String,String>? headerMap;
- Platform platform;
- LoginSource loginSource;
- String? installVersion;
- CommonLoginRequest({
- this.anyAccount,
- this.anyCode,
- this.password,
- this.headerMap,
- this.platform = Platform.Windows,
- this.loginSource = LoginSource.PC,
- this.installVersion,
- });
- factory CommonLoginRequest.fromJson(Map<String, dynamic> map) {
- return CommonLoginRequest(
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- headerMap: map['HeaderMap']?.cast<String,String>(),
- platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
- loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
- installVersion: map['InstallVersion'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (anyAccount != null) {
- map['AnyAccount'] = anyAccount;
- }
- if (anyCode != null) {
- map['AnyCode'] = anyCode;
- }
- if (password != null) {
- map['Password'] = password;
- }
- if (headerMap != null) {
- map['HeaderMap'] = headerMap;
- }
- map['Platform'] = platform.index;
- map['LoginSource'] = loginSource.index;
- if (installVersion != null) {
- map['InstallVersion'] = installVersion;
- }
- return map;
- }
- }
- class CheckLoginTypeRequest {
- String? anyAccount;
- CheckLoginTypeRequest({
- this.anyAccount,
- });
- factory CheckLoginTypeRequest.fromJson(Map<String, dynamic> map) {
- return CheckLoginTypeRequest(
- anyAccount: map['AnyAccount'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (anyAccount != null) {
- map['AnyAccount'] = anyAccount;
- }
- return map;
- }
- }
- class CommonSignUpRequest {
- String? anyAccount;
- String? anyCode;
- String? password;
- String? openId;
- Map<String,String>? headerMap;
- Platform platform;
- String? wXPhoneAnyCode;
- CommonSignUpRequest({
- this.anyAccount,
- this.anyCode,
- this.password,
- this.openId,
- this.headerMap,
- this.platform = Platform.Windows,
- this.wXPhoneAnyCode,
- });
- factory CommonSignUpRequest.fromJson(Map<String, dynamic> map) {
- return CommonSignUpRequest(
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- openId: map['OpenId'],
- headerMap: map['HeaderMap']?.cast<String,String>(),
- platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
- wXPhoneAnyCode: map['WXPhoneAnyCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (anyAccount != null) {
- map['AnyAccount'] = anyAccount;
- }
- if (anyCode != null) {
- map['AnyCode'] = anyCode;
- }
- if (password != null) {
- map['Password'] = password;
- }
- if (openId != null) {
- map['OpenId'] = openId;
- }
- if (headerMap != null) {
- map['HeaderMap'] = headerMap;
- }
- map['Platform'] = platform.index;
- if (wXPhoneAnyCode != null) {
- map['WXPhoneAnyCode'] = wXPhoneAnyCode;
- }
- return map;
- }
- }
- class CheckSMSVerificationCodeRequest {
- String? userPhone;
- String? verifyCode;
- CheckSMSVerificationCodeRequest({
- this.userPhone,
- this.verifyCode,
- });
- factory CheckSMSVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
- return CheckSMSVerificationCodeRequest(
- userPhone: map['UserPhone'],
- verifyCode: map['VerifyCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (userPhone != null) {
- map['UserPhone'] = userPhone;
- }
- if (verifyCode != null) {
- map['VerifyCode'] = verifyCode;
- }
- return map;
- }
- }
- class SendSMSVerificationCodeRequest {
- String? userPhone;
- SendSMSVerificationCodeRequest({
- this.userPhone,
- });
- factory SendSMSVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
- return SendSMSVerificationCodeRequest(
- userPhone: map['UserPhone'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (userPhone != null) {
- map['UserPhone'] = userPhone;
- }
- return map;
- }
- }
- class SendEmailVerificationCodeRequest {
- String? emailAddress;
- String? languageCode;
- SendEmailVerificationCodeRequest({
- this.emailAddress,
- this.languageCode,
- });
- factory SendEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
- return SendEmailVerificationCodeRequest(
- emailAddress: map['EmailAddress'],
- languageCode: map['LanguageCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (emailAddress != null) {
- map['EmailAddress'] = emailAddress;
- }
- if (languageCode != null) {
- map['LanguageCode'] = languageCode;
- }
- return map;
- }
- }
- class CheckEmailVerificationCodeRequest {
- String? emailAddress;
- String? verifyCode;
- CheckEmailVerificationCodeRequest({
- this.emailAddress,
- this.verifyCode,
- });
- factory CheckEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
- return CheckEmailVerificationCodeRequest(
- emailAddress: map['EmailAddress'],
- verifyCode: map['VerifyCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (emailAddress != null) {
- map['EmailAddress'] = emailAddress;
- }
- if (verifyCode != null) {
- map['VerifyCode'] = verifyCode;
- }
- return map;
- }
- }
- class RetrievePasswordByPhoneRequest {
- String? phone;
- String? verifyCode;
- String? newPassword;
- RetrievePasswordByPhoneRequest({
- this.phone,
- this.verifyCode,
- this.newPassword,
- });
- factory RetrievePasswordByPhoneRequest.fromJson(Map<String, dynamic> map) {
- return RetrievePasswordByPhoneRequest(
- phone: map['Phone'],
- verifyCode: map['VerifyCode'],
- newPassword: map['NewPassword'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (phone != null) {
- map['Phone'] = phone;
- }
- if (verifyCode != null) {
- map['VerifyCode'] = verifyCode;
- }
- if (newPassword != null) {
- map['NewPassword'] = newPassword;
- }
- return map;
- }
- }
- class RetrievePasswordByEmailRequest {
- String? mail;
- String? verifyCode;
- String? newPassword;
- RetrievePasswordByEmailRequest({
- this.mail,
- this.verifyCode,
- this.newPassword,
- });
- factory RetrievePasswordByEmailRequest.fromJson(Map<String, dynamic> map) {
- return RetrievePasswordByEmailRequest(
- mail: map['Mail'],
- verifyCode: map['VerifyCode'],
- newPassword: map['NewPassword'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (mail != null) {
- map['Mail'] = mail;
- }
- if (verifyCode != null) {
- map['VerifyCode'] = verifyCode;
- }
- if (newPassword != null) {
- map['NewPassword'] = newPassword;
- }
- return map;
- }
- }
- class VerifyAccountRequest {
- String? userName;
- VerifyAccountRequest({
- this.userName,
- });
- factory VerifyAccountRequest.fromJson(Map<String, dynamic> map) {
- return VerifyAccountRequest(
- userName: map['UserName'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (userName != null) {
- map['UserName'] = userName;
- }
- return map;
- }
- }
- class ModifyPasswordRequest extends CommonSignUpRequest{
- String? token;
- String? newPassword;
- ModifyPasswordRequest({
- this.token,
- this.newPassword,
- String? anyAccount,
- String? anyCode,
- String? password,
- String? openId,
- Map<String,String>? headerMap,
- Platform platform = Platform.Windows,
- String? wXPhoneAnyCode,
- }) : super(
- anyAccount: anyAccount,
- anyCode: anyCode,
- password: password,
- openId: openId,
- headerMap: headerMap,
- platform: platform,
- wXPhoneAnyCode: wXPhoneAnyCode,
- );
- factory ModifyPasswordRequest.fromJson(Map<String, dynamic> map) {
- return ModifyPasswordRequest(
- token: map['Token'],
- newPassword: map['NewPassword'],
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- openId: map['OpenId'],
- headerMap: map['HeaderMap']?.cast<String,String>(),
- platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
- wXPhoneAnyCode: map['WXPhoneAnyCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (token != null)
- map['Token'] = token;
- if (newPassword != null)
- map['NewPassword'] = newPassword;
- return map;
- }
- }
- class GenerateNewPasswordRequest extends TokenRequest{
- GenerateNewPasswordRequest({
- String? token,
- }) : super(
- token: token,
- );
- factory GenerateNewPasswordRequest.fromJson(Map<String, dynamic> map) {
- return GenerateNewPasswordRequest(
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- enum AssociatedAccountResultEnum {
- Success,
- UserNotFind,
- UserNameIsEmpty,
- Error,
- }
- class StartAssociatedWithAccountResult {
- bool isSuccess;
- AssociatedAccountResultEnum state;
- StartAssociatedWithAccountResult({
- this.isSuccess = false,
- this.state = AssociatedAccountResultEnum.Success,
- });
- factory StartAssociatedWithAccountResult.fromJson(Map<String, dynamic> map) {
- return StartAssociatedWithAccountResult(
- isSuccess: map['IsSuccess'],
- state: AssociatedAccountResultEnum.values.firstWhere((e) => e.index == map['State']),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['IsSuccess'] = isSuccess;
- map['State'] = state.index;
- return map;
- }
- }
- enum AssociateTypeEnum {
- FeedbackSystem,
- AgentAssessmentSystem,
- All,
- }
- class StartAssociatedWithAccountRequest extends TokenRequest{
- String? wingUserName;
- String? thirdPartyUserId;
- String? languageCode;
- bool needPullData;
- AssociateTypeEnum? associateType;
- bool isSelfCalling;
- StartAssociatedWithAccountRequest({
- this.wingUserName,
- this.thirdPartyUserId,
- this.languageCode,
- this.needPullData = false,
- this.associateType,
- this.isSelfCalling = false,
- String? token,
- }) : super(
- token: token,
- );
- factory StartAssociatedWithAccountRequest.fromJson(Map<String, dynamic> map) {
- return StartAssociatedWithAccountRequest(
- wingUserName: map['WingUserName'],
- thirdPartyUserId: map['ThirdPartyUserId'],
- languageCode: map['LanguageCode'],
- needPullData: map['NeedPullData'],
- associateType: map['AssociateType'] != null ? AssociateTypeEnum.values.firstWhere((e) => e.index == map['AssociateType']) : null,
- isSelfCalling: map['IsSelfCalling'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (wingUserName != null)
- map['WingUserName'] = wingUserName;
- if (thirdPartyUserId != null)
- map['ThirdPartyUserId'] = thirdPartyUserId;
- if (languageCode != null)
- map['LanguageCode'] = languageCode;
- map['NeedPullData'] = needPullData;
- if (associateType != null)
- map['AssociateType'] = associateType;
- map['IsSelfCalling'] = isSelfCalling;
- return map;
- }
- }
- class AssociatedFeatureInfoDTO extends AssociatedInfoDTO{
- String? featureCode;
- String? associatedPosition;
- AssociatedFeatureInfoDTO({
- this.featureCode,
- this.associatedPosition,
- String? id,
- String? relationName,
- String? title,
- String? cTitle,
- String? eTitle,
- String? icon,
- String? description,
- String? url,
- int index = 0,
- }) : super(
- id: id,
- relationName: relationName,
- title: title,
- cTitle: cTitle,
- eTitle: eTitle,
- icon: icon,
- description: description,
- url: url,
- index: index,
- );
- factory AssociatedFeatureInfoDTO.fromJson(Map<String, dynamic> map) {
- return AssociatedFeatureInfoDTO(
- featureCode: map['FeatureCode'],
- associatedPosition: map['AssociatedPosition'],
- id: map['Id'],
- relationName: map['RelationName'],
- title: map['Title'],
- cTitle: map['CTitle'],
- eTitle: map['ETitle'],
- icon: map['Icon'],
- description: map['Description'],
- url: map['Url'],
- index: map['Index'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (featureCode != null)
- map['FeatureCode'] = featureCode;
- if (associatedPosition != null)
- map['AssociatedPosition'] = associatedPosition;
- return map;
- }
- }
- class GetAssociatedAccountInfoResult {
- bool isSuccess;
- List<AssociatedFeatureInfoDTO>? accountInfoList;
- GetAssociatedAccountInfoResult({
- this.isSuccess = false,
- this.accountInfoList,
- });
- factory GetAssociatedAccountInfoResult.fromJson(Map<String, dynamic> map) {
- return GetAssociatedAccountInfoResult(
- isSuccess: map['IsSuccess'],
- accountInfoList: map['AccountInfoList'] != null ? (map['AccountInfoList'] as List).map((e)=>AssociatedFeatureInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['IsSuccess'] = isSuccess;
- if (accountInfoList != null) {
- map['AccountInfoList'] = accountInfoList;
- }
- return map;
- }
- }
- class GetAssociatedAccountInfoRequest extends TokenRequest{
- AssociateTypeEnum? associateType;
- GetAssociatedAccountInfoRequest({
- this.associateType,
- String? token,
- }) : super(
- token: token,
- );
- factory GetAssociatedAccountInfoRequest.fromJson(Map<String, dynamic> map) {
- return GetAssociatedAccountInfoRequest(
- associateType: map['AssociateType'] != null ? AssociateTypeEnum.values.firstWhere((e) => e.index == map['AssociateType']) : null,
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (associateType != null)
- map['AssociateType'] = associateType;
- return map;
- }
- }
- class GetScanCodeResult {
- int validSeconds;
- String? scanCode;
- GetScanCodeResult({
- this.validSeconds = 0,
- this.scanCode,
- });
- factory GetScanCodeResult.fromJson(Map<String, dynamic> map) {
- return GetScanCodeResult(
- validSeconds: map['ValidSeconds'],
- scanCode: map['ScanCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['ValidSeconds'] = validSeconds;
- if (scanCode != null) {
- map['ScanCode'] = scanCode;
- }
- return map;
- }
- }
- enum ScanLoginSource {
- PC,
- Web,
- US,
- }
- class GetScanCodeRequest {
- ScanLoginSource scanLoginSource;
- Platform platform;
- String? installVersion;
- GetScanCodeRequest({
- this.scanLoginSource = ScanLoginSource.PC,
- this.platform = Platform.Windows,
- this.installVersion,
- });
- factory GetScanCodeRequest.fromJson(Map<String, dynamic> map) {
- return GetScanCodeRequest(
- scanLoginSource: ScanLoginSource.values.firstWhere((e) => e.index == map['ScanLoginSource']),
- platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
- installVersion: map['InstallVersion'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['ScanLoginSource'] = scanLoginSource.index;
- map['Platform'] = platform.index;
- if (installVersion != null) {
- map['InstallVersion'] = installVersion;
- }
- return map;
- }
- }
- class ConfirmScanRequest extends TokenRequest{
- String? scanCode;
- ConfirmScanRequest({
- this.scanCode,
- String? token,
- }) : super(
- token: token,
- );
- factory ConfirmScanRequest.fromJson(Map<String, dynamic> map) {
- return ConfirmScanRequest(
- scanCode: map['ScanCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (scanCode != null)
- map['ScanCode'] = scanCode;
- return map;
- }
- }
- enum CheckConfirmScanState {
- Wait,
- Success,
- Expire,
- }
- class CheckConfirmScanStateResult {
- CheckConfirmScanState checkConfirmScanState;
- LoginResult? loginResult;
- CheckConfirmScanStateResult({
- this.checkConfirmScanState = CheckConfirmScanState.Wait,
- this.loginResult,
- });
- factory CheckConfirmScanStateResult.fromJson(Map<String, dynamic> map) {
- return CheckConfirmScanStateResult(
- checkConfirmScanState: CheckConfirmScanState.values.firstWhere((e) => e.index == map['CheckConfirmScanState']),
- loginResult: map['LoginResult'] != null ? LoginResult.fromJson(map['LoginResult']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['CheckConfirmScanState'] = checkConfirmScanState.index;
- if (loginResult != null) {
- map['LoginResult'] = loginResult;
- }
- return map;
- }
- }
- class CheckConfirmScanStateRequest {
- String? scanCode;
- CheckConfirmScanStateRequest({
- this.scanCode,
- });
- factory CheckConfirmScanStateRequest.fromJson(Map<String, dynamic> map) {
- return CheckConfirmScanStateRequest(
- scanCode: map['ScanCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (scanCode != null) {
- map['ScanCode'] = scanCode;
- }
- return map;
- }
- }
|