123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
- import 'authentication.m.dart';
- class UserTokenDTO {
- String? token;
- UserTokenDTO({
- this.token,
- });
- factory UserTokenDTO.fromJson(Map<String, dynamic> map) {
- return UserTokenDTO(
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(token != null)
- map['Token'] = token;
- return map;
- }
- }
- class CommonLoginRequest {
- String? anyAccount;
- String? anyCode;
- String? password;
- Map<String,String>? headerMap;
- Platform platform;
- LoginSource loginSource;
- CommonLoginRequest({
- this.anyAccount,
- this.anyCode,
- this.password,
- this.headerMap,
- this.platform = Platform.Windows,
- this.loginSource = LoginSource.PC,
- });
- factory CommonLoginRequest.fromJson(Map<String, dynamic> map) {
- return CommonLoginRequest(
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- headerMap: map['HeaderMap'] != null ? map['HeaderMap'].cast<String,String>() : null,
- platform: Platform.values.firstWhere((e) => e.index == map['Platform']),
- loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
- );
- }
- 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;
- 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;
- Map<String,String>? headerMap;
- CommonSignUpRequest({
- this.anyAccount,
- this.anyCode,
- this.password,
- this.headerMap,
- });
- factory CommonSignUpRequest.fromJson(Map<String, dynamic> map) {
- return CommonSignUpRequest(
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- headerMap: map['HeaderMap'] != null ? map['HeaderMap'].cast<String,String>() : null,
- );
- }
- 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;
- 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,
- Map<String,String>? headerMap,
- }) : super(
- anyAccount: anyAccount,
- anyCode: anyCode,
- password: password,
- headerMap: headerMap,
- );
- factory ModifyPasswordRequest.fromJson(Map<String, dynamic> map) {
- return ModifyPasswordRequest(
- token: map['Token'],
- newPassword: map['NewPassword'],
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- headerMap: map['HeaderMap'] != null ? map['HeaderMap'].cast<String,String>() : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(token != null)
- map['Token'] = token;
- if(newPassword != null)
- map['NewPassword'] = newPassword;
- return map;
- }
- }
|