123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666 |
- import 'package:fis_jsonrpc/utils.dart';
- class UserTokenDTO {
- String? userCode;
- String? deviceId;
- String? token;
- UserTokenDTO({
- this.userCode,
- this.deviceId,
- this.token,
- });
- factory UserTokenDTO.fromJson(Map<String, dynamic> map) {
- return UserTokenDTO(
- userCode: map['UserCode'],
- deviceId: map['DeviceId'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(userCode != null)
- map['UserCode'] = userCode;
- if(deviceId != null)
- map['DeviceId'] = deviceId;
- if(token != null)
- map['Token'] = token;
- return map;
- }
- }
- enum EnumLoginProcessorType {
- Official,
- Wechat,
- Phone,
- Email,
- Unregistered,
- }
- class LoginProcessorDTO {
- String? userName;
- String? password;
- String? phone;
- String? email;
- String? verifyCode;
- String? wechatToken;
- LoginProcessorDTO({
- this.userName,
- this.password,
- this.phone,
- this.email,
- this.verifyCode,
- this.wechatToken,
- });
- factory LoginProcessorDTO.fromJson(Map<String, dynamic> map) {
- return LoginProcessorDTO(
- userName: map['UserName'],
- password: map['Password'],
- phone: map['Phone'],
- email: map['Email'],
- verifyCode: map['VerifyCode'],
- wechatToken: map['WechatToken'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(userName != null)
- map['UserName'] = userName;
- if(password != null)
- map['Password'] = password;
- if(phone != null)
- map['Phone'] = phone;
- if(email != null)
- map['Email'] = email;
- if(verifyCode != null)
- map['VerifyCode'] = verifyCode;
- if(wechatToken != null)
- map['WechatToken'] = wechatToken;
- return map;
- }
- }
- class ClientDTO {
- String? clientIpAndPort;
- String? clientDeviceId;
- String? clientSource;
- String? clientExtensionInfo;
- ClientDTO({
- this.clientIpAndPort,
- this.clientDeviceId,
- this.clientSource,
- this.clientExtensionInfo,
- });
- factory ClientDTO.fromJson(Map<String, dynamic> map) {
- return ClientDTO(
- clientIpAndPort: map['ClientIpAndPort'],
- clientDeviceId: map['ClientDeviceId'],
- clientSource: map['ClientSource'],
- clientExtensionInfo: map['ClientExtensionInfo'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(clientIpAndPort != null)
- map['ClientIpAndPort'] = clientIpAndPort;
- if(clientDeviceId != null)
- map['ClientDeviceId'] = clientDeviceId;
- if(clientSource != null)
- map['ClientSource'] = clientSource;
- if(clientExtensionInfo != null)
- map['ClientExtensionInfo'] = clientExtensionInfo;
- return map;
- }
- }
- class UserLoginDTO {
- EnumLoginProcessorType loginType;
- LoginProcessorDTO? processorInfo;
- ClientDTO? clientInfo;
- UserLoginDTO({
- this.loginType = EnumLoginProcessorType.Official,
- this.processorInfo,
- this.clientInfo,
- });
- factory UserLoginDTO.fromJson(Map<String, dynamic> map) {
- return UserLoginDTO(
- loginType: EnumLoginProcessorType.values.firstWhere((e) => e.index == map['LoginType']),
- processorInfo: map['ProcessorInfo'],
- clientInfo: map['ClientInfo'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['LoginType'] = loginType.index;
- if(processorInfo != null)
- map['ProcessorInfo'] = processorInfo;
- if(clientInfo != null)
- map['ClientInfo'] = clientInfo;
- return map;
- }
- }
- class ClientLoginRequest extends UserLoginDTO{
- ClientLoginRequest({
- EnumLoginProcessorType loginType = EnumLoginProcessorType.Official,
- LoginProcessorDTO? processorInfo,
- ClientDTO? clientInfo,
- }) : super(
- loginType: loginType,
- processorInfo: processorInfo,
- clientInfo: clientInfo,
- );
- factory ClientLoginRequest.fromJson(Map<String, dynamic> map) {
- return ClientLoginRequest(
- loginType: EnumLoginProcessorType.values.firstWhere((e) => e.index == map['LoginType']),
- processorInfo: map['ProcessorInfo'],
- clientInfo: map['ClientInfo'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class CommonLoginRequest {
- String? anyAccount;
- String? anyCode;
- String? password;
- CommonLoginRequest({
- this.anyAccount,
- this.anyCode,
- this.password,
- });
- factory CommonLoginRequest.fromJson(Map<String, dynamic> map) {
- return CommonLoginRequest(
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- );
- }
- 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;
- 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;
- CommonSignUpRequest({
- this.anyAccount,
- this.anyCode,
- this.password,
- });
- factory CommonSignUpRequest.fromJson(Map<String, dynamic> map) {
- return CommonSignUpRequest(
- anyAccount: map['AnyAccount'],
- anyCode: map['AnyCode'],
- password: map['Password'],
- );
- }
- 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;
- return map;
- }
- }
- class BaseDTO {
- DateTime? createTime;
- DateTime? updateTime;
- BaseDTO({
- this.createTime,
- this.updateTime,
- });
- factory BaseDTO.fromJson(Map<String, dynamic> map) {
- return BaseDTO(
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(createTime != null)
- map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
- if(updateTime != null)
- map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
- return map;
- }
- }
- enum UserInfoStateEnum {
- Nonactivated,
- Activated,
- }
- enum ApplyStateEnum {
- NotApply,
- Applying,
- Refused,
- Passed,
- }
- class UserDTO extends BaseDTO{
- String? userCode;
- String? userName;
- String? phone;
- String? email;
- String? nickName;
- String? fullName;
- String? headImageUrl;
- String? organizationCode;
- String? rootOrganizationCode;
- List<String>? authorityGroups;
- List<String>? bindDevices;
- String? lastIP;
- int logintimes;
- UserInfoStateEnum userState;
- List<String>? roleCodes;
- List<String>? rankCodes;
- List<String>? positionCodes;
- ApplyStateEnum applyState;
- UserDTO({
- this.userCode,
- this.userName,
- this.phone,
- this.email,
- this.nickName,
- this.fullName,
- this.headImageUrl,
- this.organizationCode,
- this.rootOrganizationCode,
- this.authorityGroups,
- this.bindDevices,
- this.lastIP,
- this.logintimes = 0,
- this.userState = UserInfoStateEnum.Nonactivated,
- this.roleCodes,
- this.rankCodes,
- this.positionCodes,
- this.applyState = ApplyStateEnum.NotApply,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory UserDTO.fromJson(Map<String, dynamic> map) {
- return UserDTO(
- userCode: map['UserCode'],
- userName: map['UserName'],
- phone: map['Phone'],
- email: map['Email'],
- nickName: map['NickName'],
- fullName: map['FullName'],
- headImageUrl: map['HeadImageUrl'],
- organizationCode: map['OrganizationCode'],
- rootOrganizationCode: map['RootOrganizationCode'],
- authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
- bindDevices: map['BindDevices'].cast<String>().toList(),
- lastIP: map['LastIP'],
- logintimes: map['Logintimes'],
- userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
- roleCodes: map['RoleCodes'].cast<String>().toList(),
- rankCodes: map['RankCodes'].cast<String>().toList(),
- positionCodes: map['PositionCodes'].cast<String>().toList(),
- applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if(userCode != null)
- map['UserCode'] = userCode;
- if(userName != null)
- map['UserName'] = userName;
- if(phone != null)
- map['Phone'] = phone;
- if(email != null)
- map['Email'] = email;
- if(nickName != null)
- map['NickName'] = nickName;
- if(fullName != null)
- map['FullName'] = fullName;
- if(headImageUrl != null)
- map['HeadImageUrl'] = headImageUrl;
- if(organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- if(rootOrganizationCode != null)
- map['RootOrganizationCode'] = rootOrganizationCode;
- if(authorityGroups != null)
- map['AuthorityGroups'] = authorityGroups;
- if(bindDevices != null)
- map['BindDevices'] = bindDevices;
- if(lastIP != null)
- map['LastIP'] = lastIP;
- map['Logintimes'] = logintimes;
- map['UserState'] = userState.index;
- if(roleCodes != null)
- map['RoleCodes'] = roleCodes;
- if(rankCodes != null)
- map['RankCodes'] = rankCodes;
- if(positionCodes != null)
- map['PositionCodes'] = positionCodes;
- map['ApplyState'] = applyState.index;
- return map;
- }
- }
- class SignUpRequest extends UserDTO{
- SignUpRequest({
- String? userCode,
- String? userName,
- String? phone,
- String? email,
- String? nickName,
- String? fullName,
- String? headImageUrl,
- String? organizationCode,
- String? rootOrganizationCode,
- List<String>? authorityGroups,
- List<String>? bindDevices,
- String? lastIP,
- int logintimes = 0,
- UserInfoStateEnum userState = UserInfoStateEnum.Nonactivated,
- List<String>? roleCodes,
- List<String>? rankCodes,
- List<String>? positionCodes,
- ApplyStateEnum applyState = ApplyStateEnum.NotApply,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- userCode: userCode,
- userName: userName,
- phone: phone,
- email: email,
- nickName: nickName,
- fullName: fullName,
- headImageUrl: headImageUrl,
- organizationCode: organizationCode,
- rootOrganizationCode: rootOrganizationCode,
- authorityGroups: authorityGroups,
- bindDevices: bindDevices,
- lastIP: lastIP,
- logintimes: logintimes,
- userState: userState,
- roleCodes: roleCodes,
- rankCodes: rankCodes,
- positionCodes: positionCodes,
- applyState: applyState,
- createTime: createTime,
- updateTime: updateTime,
- );
- factory SignUpRequest.fromJson(Map<String, dynamic> map) {
- return SignUpRequest(
- userCode: map['UserCode'],
- userName: map['UserName'],
- phone: map['Phone'],
- email: map['Email'],
- nickName: map['NickName'],
- fullName: map['FullName'],
- headImageUrl: map['HeadImageUrl'],
- organizationCode: map['OrganizationCode'],
- rootOrganizationCode: map['RootOrganizationCode'],
- authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
- bindDevices: map['BindDevices'].cast<String>().toList(),
- lastIP: map['LastIP'],
- logintimes: map['Logintimes'],
- userState: UserInfoStateEnum.values.firstWhere((e) => e.index == map['UserState']),
- roleCodes: map['RoleCodes'].cast<String>().toList(),
- rankCodes: map['RankCodes'].cast<String>().toList(),
- positionCodes: map['PositionCodes'].cast<String>().toList(),
- applyState: ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- 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;
- SendEmailVerificationCodeRequest({
- this.emailAddress,
- });
- factory SendEmailVerificationCodeRequest.fromJson(Map<String, dynamic> map) {
- return SendEmailVerificationCodeRequest(
- emailAddress: map['EmailAddress'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(emailAddress != null)
- map['EmailAddress'] = emailAddress;
- 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;
- }
- }
|