melon.yin 3 years ago
parent
commit
b79c96ed1a

+ 2 - 2
lib/services/authentication.dart

@@ -21,8 +21,8 @@ class AuthenticationService extends JsonRpcClientBase {
 		FJsonConvert.setDecoder((map) => StorageAuthenticationInfo.fromJson(map));
 	}
 
-	Future<StorageAuthenticationInfo> getAuthorizationAsync(String sessionId,UploadFileType fileType) async {
-		var rpcRst = await call("GetAuthorizationAsync", [sessionId,fileType]);
+	Future<StorageAuthenticationInfo> getAuthorizationAsync(String token,UploadFileType fileType) async {
+		var rpcRst = await call("GetAuthorizationAsync", [token,fileType]);
 		var result = StorageAuthenticationInfo.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}

+ 11 - 11
lib/services/device.m.dart

@@ -3,22 +3,22 @@ import 'package:fis_jsonrpc/utils.dart';
 import 'package:fis_common/json_convert.dart';
 
 class BaseRequest {
-	String? sessionId;
+	String? token;
 
 	BaseRequest({
-		this.sessionId,
+		this.token,
 	});
 
 	factory BaseRequest.fromJson(Map<String, dynamic> map) {
 		return BaseRequest( 
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = Map<String, dynamic>();
-		if(sessionId != null)
-			map['SessionId'] = sessionId;
+		if(token != null)
+			map['Token'] = token;
 		return map;
 	}
 }
@@ -127,15 +127,15 @@ class CreateDeviceInfoRequest extends BaseRequest{
 
 	CreateDeviceInfoRequest({
 		this.info,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory CreateDeviceInfoRequest.fromJson(Map<String, dynamic> map) {
 		return CreateDeviceInfoRequest( 
 			info: map['Info'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -196,9 +196,9 @@ class PageRequest extends BaseRequest{
 		this.pageSize = 0,
 		this.filter,
 		this.isFuzzy = false,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory PageRequest.fromJson(Map<String, dynamic> map) {
@@ -207,7 +207,7 @@ class PageRequest extends BaseRequest{
 			pageSize: map['PageSize'],
 			filter: map['Filter'].cast<String,String>(),
 			isFuzzy: map['IsFuzzy'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 

+ 6 - 6
lib/services/identityApply.dart

@@ -18,17 +18,17 @@ class IdentityApplyService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => IdentityApplyStateInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => IdentityApplyStateDTO.fromJson(map));
 	}
 
-	Future<List<IdentityApplyStateInfo>> getIdentityApplys(String sessionId) async {
-		var rpcRst = await call("GetIdentityApplys", sessionId);
-		var result = (rpcRst as List).map((e)=>IdentityApplyStateInfo.fromJson(e as Map<String, dynamic>)).toList();
+	Future<List<IdentityApplyStateDTO>> getIdentityApplys(TokenRequest request) async {
+		var rpcRst = await call("GetIdentityApplys", request);
+		var result = (rpcRst as List).map((e)=>IdentityApplyStateDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 
-	Future<bool> applyFor(String sessionId,IdentityApplyInfo info,String extensionData) async {
-		var rpcRst = await call("ApplyFor", [sessionId,info,extensionData]);
+	Future<bool> applyFor(ApplyForRequest request) async {
+		var rpcRst = await call("ApplyFor", request);
 		return rpcRst;
 	}
 

+ 105 - 25
lib/services/identityApply.m.dart

@@ -1,16 +1,16 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
+class BaseDTO {
   DateTime? createTime;
   DateTime? updateTime;
 
-  BaseEntity({
+  BaseDTO({
     this.createTime,
     this.updateTime,
   });
 
-  factory BaseEntity.fromJson(Map<String, dynamic> map) {
-    return BaseEntity(
+  factory BaseDTO.fromJson(Map<String, dynamic> map) {
+    return BaseDTO(
       createTime:
           map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
       updateTime:
@@ -28,6 +28,49 @@ class BaseEntity {
   }
 }
 
+class IdentityApplyDTO extends BaseDTO {
+  String? applyPosition;
+  List<String>? identityCard;
+  List<String>? licenseCard;
+
+  IdentityApplyDTO({
+    this.applyPosition,
+    this.identityCard,
+    this.licenseCard,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory IdentityApplyDTO.fromJson(Map<String, dynamic> map) {
+    final identityCardData = map['IdentityCard'];
+    final licenseCardData = map['LicenseCard'];
+    return IdentityApplyDTO(
+      applyPosition: map['ApplyPosition'],
+      identityCard: identityCardData != null
+          ? (identityCardData as List).map((e) => e as String).toList()
+          : null,
+      licenseCard: licenseCardData != null
+          ? (licenseCardData as List).map((e) => e as String).toList()
+          : null,
+      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 (applyPosition != null) map['ApplyPosition'] = applyPosition;
+    if (identityCard != null) map['IdentityCard'] = identityCard;
+    if (licenseCard != null) map['LicenseCard'] = licenseCard;
+    return map;
+  }
+}
+
 enum ApplyStateEnum {
   NotApply,
   Applying,
@@ -35,34 +78,34 @@ enum ApplyStateEnum {
   Passed,
 }
 
-class IdentityApplyStateInfo extends IdentityApplyInfo {
-  String? applyPosition;
+class IdentityApplyStateDTO extends IdentityApplyDTO {
   ApplyStateEnum applyState;
   String? applyNote;
 
-  IdentityApplyStateInfo({
-    this.applyPosition,
+  IdentityApplyStateDTO({
     this.applyState = ApplyStateEnum.NotApply,
     this.applyNote,
+    String? applyPosition,
     List<String>? identityCard,
     List<String>? licenseCard,
     DateTime? createTime,
     DateTime? updateTime,
   }) : super(
+          applyPosition: applyPosition,
           identityCard: identityCard,
           licenseCard: licenseCard,
           createTime: createTime,
           updateTime: updateTime,
         );
 
-  factory IdentityApplyStateInfo.fromJson(Map<String, dynamic> map) {
+  factory IdentityApplyStateDTO.fromJson(Map<String, dynamic> map) {
     final identityCardData = map['IdentityCard'];
     final licenseCardData = map['LicenseCard'];
-    return IdentityApplyStateInfo(
-      applyPosition: map['ApplyPosition'],
+    return IdentityApplyStateDTO(
       applyState:
           ApplyStateEnum.values.firstWhere((e) => e.index == map['ApplyState']),
       applyNote: map['ApplyNote'],
+      applyPosition: map['ApplyPosition'],
       identityCard: identityCardData != null
           ? (identityCardData as List).map((e) => e as String).toList()
           : null,
@@ -78,33 +121,71 @@ class IdentityApplyStateInfo extends IdentityApplyInfo {
 
   Map<String, dynamic> toJson() {
     final map = super.toJson();
-    if (applyPosition != null) map['ApplyPosition'] = applyPosition;
     map['ApplyState'] = applyState.index;
     if (applyNote != null) map['ApplyNote'] = applyNote;
     return map;
   }
 }
 
-class IdentityApplyInfo extends BaseEntity {
-  String? applyPosition;
-  List<String>? identityCard;
-  List<String>? licenseCard;
+class BaseRequest {
+  BaseRequest();
 
-  IdentityApplyInfo({
-    this.applyPosition,
-    this.identityCard,
-    this.licenseCard,
+  factory BaseRequest.fromJson(Map<String, dynamic> map) {
+    return BaseRequest();
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    return map;
+  }
+}
+
+class TokenRequest extends BaseRequest {
+  String? token;
+
+  TokenRequest({
+    this.token,
+  }) : super();
+
+  factory TokenRequest.fromJson(Map<String, dynamic> map) {
+    return TokenRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (token != null) map['Token'] = token;
+    return map;
+  }
+}
+
+class ApplyForRequest extends IdentityApplyDTO {
+  String? token;
+  String? extensionData;
+
+  ApplyForRequest({
+    this.token,
+    this.extensionData,
+    String? applyPosition,
+    List<String>? identityCard,
+    List<String>? licenseCard,
     DateTime? createTime,
     DateTime? updateTime,
   }) : super(
+          applyPosition: applyPosition,
+          identityCard: identityCard,
+          licenseCard: licenseCard,
           createTime: createTime,
           updateTime: updateTime,
         );
 
-  factory IdentityApplyInfo.fromJson(Map<String, dynamic> map) {
+  factory ApplyForRequest.fromJson(Map<String, dynamic> map) {
     final identityCardData = map['IdentityCard'];
     final licenseCardData = map['LicenseCard'];
-    return IdentityApplyInfo(
+    return ApplyForRequest(
+      token: map['Token'],
+      extensionData: map['ExtensionData'],
       applyPosition: map['ApplyPosition'],
       identityCard: identityCardData != null
           ? (identityCardData as List).map((e) => e as String).toList()
@@ -121,9 +202,8 @@ class IdentityApplyInfo extends BaseEntity {
 
   Map<String, dynamic> toJson() {
     final map = super.toJson();
-    if (applyPosition != null) map['ApplyPosition'] = applyPosition;
-    if (identityCard != null) map['IdentityCard'] = identityCard;
-    if (licenseCard != null) map['LicenseCard'] = licenseCard;
+    if (token != null) map['Token'] = token;
+    if (extensionData != null) map['ExtensionData'] = extensionData;
     return map;
   }
 }

+ 27 - 27
lib/services/login.dart

@@ -18,68 +18,68 @@ class LoginService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => UserSessionInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => UserTokenDTO.fromJson(map));
 	}
 
-	Future<UserSessionInfo> clientLoginAsync(UserLoginInfo userLoginInfo) async {
-		var rpcRst = await call("ClientLoginAsync", userLoginInfo);
-		var result = UserSessionInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<UserTokenDTO> clientLoginAsync(ClientLoginRequest request) async {
+		var rpcRst = await call("ClientLoginAsync", request);
+		var result = UserTokenDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<UserSessionInfo> commonLoginAsync(String anyAccount,String anyCode,String password) async {
-		var rpcRst = await call("CommonLoginAsync", [anyAccount,anyCode,password]);
-		var result = UserSessionInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<UserTokenDTO> commonLoginAsync(CommonLoginRequest request) async {
+		var rpcRst = await call("CommonLoginAsync", request);
+		var result = UserTokenDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<int> checkLoginType(String anyAccount) async {
-		var rpcRst = await call("CheckLoginType", anyAccount);
+	Future<int> checkLoginType(CheckLoginTypeRequest request) async {
+		var rpcRst = await call("CheckLoginType", request);
 		return rpcRst;
 	}
 
-	Future<bool> commonSignUpAsync(String anyAccount,String anyCode,String password) async {
-		var rpcRst = await call("CommonSignUpAsync", [anyAccount,anyCode,password]);
+	Future<bool> commonSignUpAsync(CommonSignUpRequest request) async {
+		var rpcRst = await call("CommonSignUpAsync", request);
 		return rpcRst;
 	}
 
-	Future<bool> signUpAsync(UserInfo userInfo) async {
-		var rpcRst = await call("SignUpAsync", userInfo);
+	Future<bool> signUpAsync(SignUpRequest request) async {
+		var rpcRst = await call("SignUpAsync", request);
 		return rpcRst;
 	}
 
-	Future<bool> checkSMSVerificationCode(String userPhone,String verifyCode) async {
-		var rpcRst = await call("CheckSMSVerificationCode", [userPhone,verifyCode]);
+	Future<bool> checkSMSVerificationCode(CheckSMSVerificationCodeRequest request) async {
+		var rpcRst = await call("CheckSMSVerificationCode", request);
 		return rpcRst;
 	}
 
-	Future<bool> sendSMSVerificationCode(String userPhone) async {
-		var rpcRst = await call("SendSMSVerificationCode", userPhone);
+	Future<bool> sendSMSVerificationCode(SendSMSVerificationCodeRequest request) async {
+		var rpcRst = await call("SendSMSVerificationCode", request);
 		return rpcRst;
 	}
 
-	Future<bool> sendEmailVerificationCode(String emailAddress) async {
-		var rpcRst = await call("SendEmailVerificationCode", emailAddress);
+	Future<bool> sendEmailVerificationCode(SendEmailVerificationCodeRequest request) async {
+		var rpcRst = await call("SendEmailVerificationCode", request);
 		return rpcRst;
 	}
 
-	Future<bool> checkEmailVerificationCode(String emailAddress,String verifyCode) async {
-		var rpcRst = await call("CheckEmailVerificationCode", [emailAddress,verifyCode]);
+	Future<bool> checkEmailVerificationCode(CheckEmailVerificationCodeRequest request) async {
+		var rpcRst = await call("CheckEmailVerificationCode", request);
 		return rpcRst;
 	}
 
-	Future<bool> retrievePasswordByPhone(String phone,String verifyCode,String newPassword) async {
-		var rpcRst = await call("RetrievePasswordByPhone", [phone,verifyCode,newPassword]);
+	Future<bool> retrievePasswordByPhone(RetrievePasswordByPhoneRequest request) async {
+		var rpcRst = await call("RetrievePasswordByPhone", request);
 		return rpcRst;
 	}
 
-	Future<bool> retrievePasswordByEmail(String mail,String verifyCode,String newPassword) async {
-		var rpcRst = await call("RetrievePasswordByEmail", [mail,verifyCode,newPassword]);
+	Future<bool> retrievePasswordByEmail(RetrievePasswordByEmailRequest request) async {
+		var rpcRst = await call("RetrievePasswordByEmail", request);
 		return rpcRst;
 	}
 
-	Future<bool> verifyAccount(String userName) async {
-		var rpcRst = await call("VerifyAccount", userName);
+	Future<bool> verifyAccount(VerifyAccountRequest request) async {
+		var rpcRst = await call("VerifyAccount", request);
 		return rpcRst;
 	}
 

+ 394 - 31
lib/services/login.m.dart

@@ -1,21 +1,21 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class UserSessionInfo {
+class UserTokenDTO {
 	String? userCode;
 	String? deviceId;
-	String? sessionId;
+	String? token;
 
-	UserSessionInfo({
+	UserTokenDTO({
 		this.userCode,
 		this.deviceId,
-		this.sessionId,
+		this.token,
 	});
 
-	factory UserSessionInfo.fromJson(Map<String, dynamic> map) {
-		return UserSessionInfo( 
+	factory UserTokenDTO.fromJson(Map<String, dynamic> map) {
+		return UserTokenDTO( 
 			userCode: map['UserCode'],
 			deviceId: map['DeviceId'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -25,8 +25,8 @@ class UserSessionInfo {
 			map['UserCode'] = userCode;
 		if(deviceId != null)
 			map['DeviceId'] = deviceId;
-		if(sessionId != null)
-			map['SessionId'] = sessionId;
+		if(token != null)
+			map['Token'] = token;
 		return map;
 	}
 }
@@ -39,7 +39,7 @@ enum EnumLoginProcessorType {
 	Unregistered,
 }
 
-class LoginProcessorInfo {
+class LoginProcessorDTO {
 	String? userName;
 	String? password;
 	String? phone;
@@ -47,7 +47,7 @@ class LoginProcessorInfo {
 	String? verifyCode;
 	String? wechatToken;
 
-	LoginProcessorInfo({
+	LoginProcessorDTO({
 		this.userName,
 		this.password,
 		this.phone,
@@ -56,8 +56,8 @@ class LoginProcessorInfo {
 		this.wechatToken,
 	});
 
-	factory LoginProcessorInfo.fromJson(Map<String, dynamic> map) {
-		return LoginProcessorInfo( 
+	factory LoginProcessorDTO.fromJson(Map<String, dynamic> map) {
+		return LoginProcessorDTO( 
 			userName: map['UserName'],
 			password: map['Password'],
 			phone: map['Phone'],
@@ -85,21 +85,21 @@ class LoginProcessorInfo {
 	}
 }
 
-class ClientInfo {
+class ClientDTO {
 	String? clientIpAndPort;
 	String? clientDeviceId;
 	String? clientSource;
 	String? clientExtensionInfo;
 
-	ClientInfo({
+	ClientDTO({
 		this.clientIpAndPort,
 		this.clientDeviceId,
 		this.clientSource,
 		this.clientExtensionInfo,
 	});
 
-	factory ClientInfo.fromJson(Map<String, dynamic> map) {
-		return ClientInfo( 
+	factory ClientDTO.fromJson(Map<String, dynamic> map) {
+		return ClientDTO( 
 			clientIpAndPort: map['ClientIpAndPort'],
 			clientDeviceId: map['ClientDeviceId'],
 			clientSource: map['ClientSource'],
@@ -121,19 +121,19 @@ class ClientInfo {
 	}
 }
 
-class UserLoginInfo {
+class UserLoginDTO {
 	EnumLoginProcessorType loginType;
-	LoginProcessorInfo? processorInfo;
-	ClientInfo? clientInfo;
+	LoginProcessorDTO? processorInfo;
+	ClientDTO? clientInfo;
 
-	UserLoginInfo({
+	UserLoginDTO({
 		this.loginType = EnumLoginProcessorType.Official,
 		this.processorInfo,
 		this.clientInfo,
 	});
 
-	factory UserLoginInfo.fromJson(Map<String, dynamic> map) {
-		return UserLoginInfo( 
+	factory UserLoginDTO.fromJson(Map<String, dynamic> map) {
+		return UserLoginDTO( 
 			loginType: EnumLoginProcessorType.values.firstWhere((e) => e.index == map['LoginType']),
 			processorInfo: map['ProcessorInfo'],
 			clientInfo: map['ClientInfo'],
@@ -151,17 +151,126 @@ class UserLoginInfo {
 	}
 }
 
-class BaseEntity {
+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;
 
-	BaseEntity({
+	BaseDTO({
 		this.createTime,
 		this.updateTime,
 	});
 
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
+	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,
 		);
@@ -189,7 +298,7 @@ enum ApplyStateEnum {
 	Passed,
 }
 
-class UserInfo extends BaseEntity{
+class UserDTO extends BaseDTO{
 	String? userCode;
 	String? userName;
 	String? phone;
@@ -209,7 +318,7 @@ class UserInfo extends BaseEntity{
 	List<String>? positionCodes;
 	ApplyStateEnum applyState;
 
-	UserInfo({
+	UserDTO({
 		this.userCode,
 		this.userName,
 		this.phone,
@@ -235,8 +344,8 @@ class UserInfo extends BaseEntity{
 			updateTime: updateTime,
 		);
 
-	factory UserInfo.fromJson(Map<String, dynamic> map) {
-		return UserInfo( 
+	factory UserDTO.fromJson(Map<String, dynamic> map) {
+		return UserDTO( 
 			userCode: map['UserCode'],
 			userName: map['UserName'],
 			phone: map['Phone'],
@@ -299,5 +408,259 @@ class UserInfo extends BaseEntity{
 	}
 }
 
+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;
+	}
+}
+
 
 

+ 17 - 17
lib/services/organization.dart

@@ -18,37 +18,37 @@ class OrganizationService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => OrganizationInfo.fromJson(map));
-		FJsonConvert.setDecoder((map) => OrganizationBaseInfo.fromJson(map));
-		FJsonConvert.setDecoder((map) => OrganizationBasicInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => OrganizationDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => OrganizationBaseDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => OrganizationBasicDTO.fromJson(map));
 	}
 
-	Future<List<OrganizationInfo>> searchOrganizations(String keyword,String parentCode,OrganizationTypeEnum organizationType) async {
-		var rpcRst = await call("SearchOrganizations", [keyword,parentCode,organizationType]);
-		var result = (rpcRst as List).map((e)=>OrganizationInfo.fromJson(e as Map<String, dynamic>)).toList();
+	Future<List<OrganizationDTO>> searchOrganizations(SearchOrganizationsRequest request) async {
+		var rpcRst = await call("SearchOrganizations", request);
+		var result = (rpcRst as List).map((e)=>OrganizationDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 
-	Future<OrganizationInfo> getOrganizationByCode(String organizationCode) async {
-		var rpcRst = await call("GetOrganizationByCode", organizationCode);
-		var result = OrganizationInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<OrganizationDTO> getOrganizationByCode(GetOrganizationByCodeRequest request) async {
+		var rpcRst = await call("GetOrganizationByCode", request);
+		var result = OrganizationDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<List<OrganizationBaseInfo>> getParentOrganizationListAsync(String token) async {
-		var rpcRst = await call("GetParentOrganizationListAsync", token);
-		var result = (rpcRst as List).map((e)=>OrganizationBaseInfo.fromJson(e as Map<String, dynamic>)).toList();
+	Future<List<OrganizationBaseDTO>> getParentOrganizationListAsync(GetParentOrganizationListRequest request) async {
+		var rpcRst = await call("GetParentOrganizationListAsync", request);
+		var result = (rpcRst as List).map((e)=>OrganizationBaseDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 
-	Future<OrganizationBasicInfo> getPersonOrganizationAsync(String token) async {
-		var rpcRst = await call("GetPersonOrganizationAsync", token);
-		var result = OrganizationBasicInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<OrganizationBasicDTO> getPersonOrganizationAsync(GetPersonOrganizationRequest request) async {
+		var rpcRst = await call("GetPersonOrganizationAsync", request);
+		var result = OrganizationBasicDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<bool> savePersonOrganizationAsync(String token,OrganizationBasicInfo model) async {
-		var rpcRst = await call("SavePersonOrganizationAsync", [token,model]);
+	Future<bool> savePersonOrganizationAsync(SavePersonOrganizationRequest request) async {
+		var rpcRst = await call("SavePersonOrganizationAsync", request);
 		return rpcRst;
 	}
 

+ 393 - 237
lib/services/organization.m.dart

@@ -1,258 +1,414 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
-	DateTime? createTime;
-	DateTime? updateTime;
-
-	BaseEntity({
-		this.createTime,
-		this.updateTime,
-	});
-
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
-			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;
-	}
+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;
+  }
 }
 
-class OrganizationBaseInfo extends BaseEntity{
-	String? organizationCode;
-	String? organizationName;
-
-	OrganizationBaseInfo({
-		this.organizationCode,
-		this.organizationName,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	factory OrganizationBaseInfo.fromJson(Map<String, dynamic> map) {
-		return OrganizationBaseInfo( 
-			organizationCode: map['OrganizationCode'],
-			organizationName: map['OrganizationName'],
-			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(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		if(organizationName != null)
-			map['OrganizationName'] = organizationName;
-		return map;
-	}
+class OrganizationBaseDTO extends BaseDTO {
+  String? organizationCode;
+  String? organizationName;
+
+  OrganizationBaseDTO({
+    this.organizationCode,
+    this.organizationName,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory OrganizationBaseDTO.fromJson(Map<String, dynamic> map) {
+    return OrganizationBaseDTO(
+      organizationCode: map['OrganizationCode'],
+      organizationName: map['OrganizationName'],
+      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 (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    if (organizationName != null) map['OrganizationName'] = organizationName;
+    return map;
+  }
 }
 
-class OrganizationBasicInfo extends OrganizationBaseInfo{
-	String? regionCode;
-	String? parentCode;
-	String? logoUrl;
-
-	OrganizationBasicInfo({
-		this.regionCode,
-		this.parentCode,
-		this.logoUrl,
-		String? organizationCode,
-		String? organizationName,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			organizationCode: organizationCode,
-			organizationName: organizationName,
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	factory OrganizationBasicInfo.fromJson(Map<String, dynamic> map) {
-		return OrganizationBasicInfo( 
-			regionCode: map['RegionCode'],
-			parentCode: map['ParentCode'],
-			logoUrl: map['LogoUrl'],
-			organizationCode: map['OrganizationCode'],
-			organizationName: map['OrganizationName'],
-			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(regionCode != null)
-			map['RegionCode'] = regionCode;
-		if(parentCode != null)
-			map['ParentCode'] = parentCode;
-		if(logoUrl != null)
-			map['LogoUrl'] = logoUrl;
-		return map;
-	}
+class OrganizationBasicDTO extends OrganizationBaseDTO {
+  String? regionCode;
+  String? parentCode;
+  String? logoUrl;
+
+  OrganizationBasicDTO({
+    this.regionCode,
+    this.parentCode,
+    this.logoUrl,
+    String? organizationCode,
+    String? organizationName,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          organizationCode: organizationCode,
+          organizationName: organizationName,
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory OrganizationBasicDTO.fromJson(Map<String, dynamic> map) {
+    return OrganizationBasicDTO(
+      regionCode: map['RegionCode'],
+      parentCode: map['ParentCode'],
+      logoUrl: map['LogoUrl'],
+      organizationCode: map['OrganizationCode'],
+      organizationName: map['OrganizationName'],
+      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 (regionCode != null) map['RegionCode'] = regionCode;
+    if (parentCode != null) map['ParentCode'] = parentCode;
+    if (logoUrl != null) map['LogoUrl'] = logoUrl;
+    return map;
+  }
 }
 
 enum OrganizationTypeEnum {
-	Corporation,
-	Department,
-	Section,
+  Corporation,
+  Department,
+  Section,
 }
 
-class OrganizationInfo extends OrganizationBasicInfo{
-	String? description;
-	String? rootCode;
-	OrganizationTypeEnum organizationType;
-	List<String>? authorityGroups;
-	String? nautica;
-
-	OrganizationInfo({
-		this.description,
-		this.rootCode,
-		this.organizationType = OrganizationTypeEnum.Corporation,
-		this.authorityGroups,
-		this.nautica,
-		String? regionCode,
-		String? parentCode,
-		String? logoUrl,
-		String? organizationCode,
-		String? organizationName,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			regionCode: regionCode,
-			parentCode: parentCode,
-			logoUrl: logoUrl,
-			organizationCode: organizationCode,
-			organizationName: organizationName,
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	factory OrganizationInfo.fromJson(Map<String, dynamic> map) {
-		return OrganizationInfo( 
-			description: map['Description'],
-			rootCode: map['RootCode'],
-			organizationType: OrganizationTypeEnum.values.firstWhere((e) => e.index == map['OrganizationType']),
-			authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
-			nautica: map['Nautica'],
-			regionCode: map['RegionCode'],
-			parentCode: map['ParentCode'],
-			logoUrl: map['LogoUrl'],
-			organizationCode: map['OrganizationCode'],
-			organizationName: map['OrganizationName'],
-			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(description != null)
-			map['Description'] = description;
-		if(rootCode != null)
-			map['RootCode'] = rootCode;
-		map['OrganizationType'] = organizationType.index;
-		if(authorityGroups != null)
-			map['AuthorityGroups'] = authorityGroups;
-		if(nautica != null)
-			map['Nautica'] = nautica;
-		return map;
-	}
+class OrganizationDTO extends OrganizationBasicDTO {
+  String? description;
+  String? rootCode;
+  OrganizationTypeEnum organizationType;
+  List<String>? authorityGroups;
+  String? nautica;
+
+  OrganizationDTO({
+    this.description,
+    this.rootCode,
+    this.organizationType = OrganizationTypeEnum.Corporation,
+    this.authorityGroups,
+    this.nautica,
+    String? regionCode,
+    String? parentCode,
+    String? logoUrl,
+    String? organizationCode,
+    String? organizationName,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          regionCode: regionCode,
+          parentCode: parentCode,
+          logoUrl: logoUrl,
+          organizationCode: organizationCode,
+          organizationName: organizationName,
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory OrganizationDTO.fromJson(Map<String, dynamic> map) {
+    return OrganizationDTO(
+      description: map['Description'],
+      rootCode: map['RootCode'],
+      organizationType: OrganizationTypeEnum.values
+          .firstWhere((e) => e.index == map['OrganizationType']),
+      authorityGroups: map['AuthorityGroups'].cast<String>().toList(),
+      nautica: map['Nautica'],
+      regionCode: map['RegionCode'],
+      parentCode: map['ParentCode'],
+      logoUrl: map['LogoUrl'],
+      organizationCode: map['OrganizationCode'],
+      organizationName: map['OrganizationName'],
+      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 (description != null) map['Description'] = description;
+    if (rootCode != null) map['RootCode'] = rootCode;
+    map['OrganizationType'] = organizationType.index;
+    if (authorityGroups != null) map['AuthorityGroups'] = authorityGroups;
+    if (nautica != null) map['Nautica'] = nautica;
+    return map;
+  }
 }
 
-class OrganizationItem {
-	String? organizationName;
-	String? parentCode;
-	String? extendsData;
-
-	OrganizationItem({
-		this.organizationName,
-		this.parentCode,
-		this.extendsData,
-	});
-
-	factory OrganizationItem.fromJson(Map<String, dynamic> map) {
-		return OrganizationItem( 
-			organizationName: map['OrganizationName'],
-			parentCode: map['ParentCode'],
-			extendsData: map['ExtendsData'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(organizationName != null)
-			map['OrganizationName'] = organizationName;
-		if(parentCode != null)
-			map['ParentCode'] = parentCode;
-		if(extendsData != null)
-			map['ExtendsData'] = extendsData;
-		return map;
-	}
+class SearchOrganizationsRequest {
+  String? keyword;
+  String? parentCode;
+  OrganizationTypeEnum organizationType;
+
+  SearchOrganizationsRequest({
+    this.keyword,
+    this.parentCode,
+    this.organizationType = OrganizationTypeEnum.Corporation,
+  });
+
+  factory SearchOrganizationsRequest.fromJson(Map<String, dynamic> map) {
+    return SearchOrganizationsRequest(
+      keyword: map['Keyword'],
+      parentCode: map['ParentCode'],
+      organizationType: OrganizationTypeEnum.values
+          .firstWhere((e) => e.index == map['OrganizationType']),
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    if (keyword != null) map['Keyword'] = keyword;
+    if (parentCode != null) map['ParentCode'] = parentCode;
+    map['OrganizationType'] = organizationType.index;
+    return map;
+  }
 }
 
-class AddOrganizationsRequest {
-	String? token;
-	List<OrganizationItem>? organizationInfos;
-
-	AddOrganizationsRequest({
-		this.token,
-		this.organizationInfos,
-	});
-
-	factory AddOrganizationsRequest.fromJson(Map<String, dynamic> map) {
-		return AddOrganizationsRequest( 
-			token: map['Token'],
-			organizationInfos: map['OrganizationInfos'].map((e)=>OrganizationItem.fromJson(e as Map<String,dynamic>)).toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(organizationInfos != null)
-			map['OrganizationInfos'] = organizationInfos;
-		return map;
-	}
+class GetOrganizationByCodeRequest {
+  String? organizationCode;
+
+  GetOrganizationByCodeRequest({
+    this.organizationCode,
+  });
+
+  factory GetOrganizationByCodeRequest.fromJson(Map<String, dynamic> map) {
+    return GetOrganizationByCodeRequest(
+      organizationCode: map['OrganizationCode'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    return map;
+  }
 }
 
-class RemoveOrganizationsRequest {
-	String? token;
-	List<String>? organizationCodes;
-
-	RemoveOrganizationsRequest({
-		this.token,
-		this.organizationCodes,
-	});
-
-	factory RemoveOrganizationsRequest.fromJson(Map<String, dynamic> map) {
-		return RemoveOrganizationsRequest( 
-			token: map['Token'],
-			organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(organizationCodes != null)
-			map['OrganizationCodes'] = organizationCodes;
-		return map;
-	}
+class BaseRequest {
+  BaseRequest();
+
+  factory BaseRequest.fromJson(Map<String, dynamic> map) {
+    return BaseRequest();
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    return map;
+  }
 }
 
+class TokenRequest extends BaseRequest {
+  String? token;
 
+  TokenRequest({
+    this.token,
+  }) : super();
+
+  factory TokenRequest.fromJson(Map<String, dynamic> map) {
+    return TokenRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (token != null) map['Token'] = token;
+    return map;
+  }
+}
+
+class GetParentOrganizationListRequest extends TokenRequest {
+  GetParentOrganizationListRequest({
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetParentOrganizationListRequest.fromJson(Map<String, dynamic> map) {
+    return GetParentOrganizationListRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    return map;
+  }
+}
 
+class GetPersonOrganizationRequest extends TokenRequest {
+  GetPersonOrganizationRequest({
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetPersonOrganizationRequest.fromJson(Map<String, dynamic> map) {
+    return GetPersonOrganizationRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    return map;
+  }
+}
+
+class SavePersonOrganizationRequest extends OrganizationBasicDTO {
+  String? token;
+
+  SavePersonOrganizationRequest({
+    this.token,
+    String? regionCode,
+    String? parentCode,
+    String? logoUrl,
+    String? organizationCode,
+    String? organizationName,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          regionCode: regionCode,
+          parentCode: parentCode,
+          logoUrl: logoUrl,
+          organizationCode: organizationCode,
+          organizationName: organizationName,
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory SavePersonOrganizationRequest.fromJson(Map<String, dynamic> map) {
+    return SavePersonOrganizationRequest(
+      token: map['Token'],
+      regionCode: map['RegionCode'],
+      parentCode: map['ParentCode'],
+      logoUrl: map['LogoUrl'],
+      organizationCode: map['OrganizationCode'],
+      organizationName: map['OrganizationName'],
+      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 (token != null) map['Token'] = token;
+    return map;
+  }
+}
+
+class OrganizationItemDTO {
+  String? organizationName;
+  String? parentCode;
+  String? extendsData;
+
+  OrganizationItemDTO({
+    this.organizationName,
+    this.parentCode,
+    this.extendsData,
+  });
+
+  factory OrganizationItemDTO.fromJson(Map<String, dynamic> map) {
+    return OrganizationItemDTO(
+      organizationName: map['OrganizationName'],
+      parentCode: map['ParentCode'],
+      extendsData: map['ExtendsData'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    if (organizationName != null) map['OrganizationName'] = organizationName;
+    if (parentCode != null) map['ParentCode'] = parentCode;
+    if (extendsData != null) map['ExtendsData'] = extendsData;
+    return map;
+  }
+}
+
+class AddOrganizationsRequest extends TokenRequest {
+  List<OrganizationItemDTO>? organizationInfos;
+
+  AddOrganizationsRequest({
+    this.organizationInfos,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory AddOrganizationsRequest.fromJson(Map<String, dynamic> map) {
+    return AddOrganizationsRequest(
+      organizationInfos: map['OrganizationInfos']
+          .map((e) => OrganizationItemDTO.fromJson(e as Map<String, dynamic>))
+          .toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (organizationInfos != null) map['OrganizationInfos'] = organizationInfos;
+    return map;
+  }
+}
+
+class RemoveOrganizationsRequest extends TokenRequest {
+  List<String>? organizationCodes;
+
+  RemoveOrganizationsRequest({
+    this.organizationCodes,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory RemoveOrganizationsRequest.fromJson(Map<String, dynamic> map) {
+    return RemoveOrganizationsRequest(
+      organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (organizationCodes != null) map['OrganizationCodes'] = organizationCodes;
+    return map;
+  }
+}

+ 3 - 3
lib/services/position.dart

@@ -18,12 +18,12 @@ class PositionService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => PositionInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => PositionDTO.fromJson(map));
 	}
 
-	Future<List<PositionInfo>> getPositions(GetPositionsRequest request) async {
+	Future<List<PositionDTO>> getPositions(GetPositionsRequest request) async {
 		var rpcRst = await call("GetPositions", request);
-		var result = (rpcRst as List).map((e)=>PositionInfo.fromJson(e as Map<String, dynamic>)).toList();
+		var result = (rpcRst as List).map((e)=>PositionDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 

+ 222 - 201
lib/services/position.m.dart

@@ -1,218 +1,239 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
-	DateTime? createTime;
-	DateTime? updateTime;
-
-	BaseEntity({
-		this.createTime,
-		this.updateTime,
-	});
-
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
-			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;
-	}
+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;
+  }
 }
 
-class PositionInfo extends BaseEntity{
-	String? positionCode;
-	String? positionName;
-	String? organizationCode;
-	List<String>? underUserCodes;
-
-	PositionInfo({
-		this.positionCode,
-		this.positionName,
-		this.organizationCode,
-		this.underUserCodes,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	factory PositionInfo.fromJson(Map<String, dynamic> map) {
-		return PositionInfo( 
-			positionCode: map['PositionCode'],
-			positionName: map['PositionName'],
-			organizationCode: map['OrganizationCode'],
-			underUserCodes: map['UnderUserCodes'].cast<String>().toList(),
-			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(positionCode != null)
-			map['PositionCode'] = positionCode;
-		if(positionName != null)
-			map['PositionName'] = positionName;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		if(underUserCodes != null)
-			map['UnderUserCodes'] = underUserCodes;
-		return map;
-	}
+class PositionDTO extends BaseDTO {
+  String? positionCode;
+  String? positionName;
+  String? organizationCode;
+  List<String>? underUserCodes;
+
+  PositionDTO({
+    this.positionCode,
+    this.positionName,
+    this.organizationCode,
+    this.underUserCodes,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory PositionDTO.fromJson(Map<String, dynamic> map) {
+    return PositionDTO(
+      positionCode: map['PositionCode'],
+      positionName: map['PositionName'],
+      organizationCode: map['OrganizationCode'],
+      underUserCodes: map['UnderUserCodes'].cast<String>().toList(),
+      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 (positionCode != null) map['PositionCode'] = positionCode;
+    if (positionName != null) map['PositionName'] = positionName;
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    if (underUserCodes != null) map['UnderUserCodes'] = underUserCodes;
+    return map;
+  }
 }
 
-class GetPositionsRequest {
-	String? token;
-	List<String>? positionCodes;
-	List<String>? organizationCodes;
-
-	GetPositionsRequest({
-		this.token,
-		this.positionCodes,
-		this.organizationCodes,
-	});
-
-	factory GetPositionsRequest.fromJson(Map<String, dynamic> map) {
-		return GetPositionsRequest( 
-			token: map['Token'],
-			positionCodes: map['PositionCodes'].cast<String>().toList(),
-			organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(positionCodes != null)
-			map['PositionCodes'] = positionCodes;
-		if(organizationCodes != null)
-			map['OrganizationCodes'] = organizationCodes;
-		return map;
-	}
-}
+class BaseRequest {
+  BaseRequest();
+
+  factory BaseRequest.fromJson(Map<String, dynamic> map) {
+    return BaseRequest();
+  }
 
-class PositionItem {
-	String? positionName;
-	String? organizationCode;
-	List<String>? underUserCodes;
-	String? extendsData;
-
-	PositionItem({
-		this.positionName,
-		this.organizationCode,
-		this.underUserCodes,
-		this.extendsData,
-	});
-
-	factory PositionItem.fromJson(Map<String, dynamic> map) {
-		return PositionItem( 
-			positionName: map['PositionName'],
-			organizationCode: map['OrganizationCode'],
-			underUserCodes: map['UnderUserCodes'].cast<String>().toList(),
-			extendsData: map['ExtendsData'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(positionName != null)
-			map['PositionName'] = positionName;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		if(underUserCodes != null)
-			map['UnderUserCodes'] = underUserCodes;
-		if(extendsData != null)
-			map['ExtendsData'] = extendsData;
-		return map;
-	}
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    return map;
+  }
 }
 
-class AddPositionsRequest {
-	String? token;
-	List<PositionItem>? positions;
-
-	AddPositionsRequest({
-		this.token,
-		this.positions,
-	});
-
-	factory AddPositionsRequest.fromJson(Map<String, dynamic> map) {
-		return AddPositionsRequest( 
-			token: map['Token'],
-			positions: map['Positions'].map((e)=>PositionItem.fromJson(e as Map<String,dynamic>)).toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(positions != null)
-			map['Positions'] = positions;
-		return map;
-	}
+class TokenRequest extends BaseRequest {
+  String? token;
+
+  TokenRequest({
+    this.token,
+  }) : super();
+
+  factory TokenRequest.fromJson(Map<String, dynamic> map) {
+    return TokenRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (token != null) map['Token'] = token;
+    return map;
+  }
 }
 
-class UpdatePositionsRequest {
-	String? token;
-	List<PositionItem>? positions;
-
-	UpdatePositionsRequest({
-		this.token,
-		this.positions,
-	});
-
-	factory UpdatePositionsRequest.fromJson(Map<String, dynamic> map) {
-		return UpdatePositionsRequest( 
-			token: map['Token'],
-			positions: map['Positions'].map((e)=>PositionItem.fromJson(e as Map<String,dynamic>)).toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(positions != null)
-			map['Positions'] = positions;
-		return map;
-	}
+class GetPositionsRequest extends TokenRequest {
+  List<String>? positionCodes;
+  List<String>? organizationCodes;
+
+  GetPositionsRequest({
+    this.positionCodes,
+    this.organizationCodes,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetPositionsRequest.fromJson(Map<String, dynamic> map) {
+    return GetPositionsRequest(
+      positionCodes: map['PositionCodes'].cast<String>().toList(),
+      organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (positionCodes != null) map['PositionCodes'] = positionCodes;
+    if (organizationCodes != null) map['OrganizationCodes'] = organizationCodes;
+    return map;
+  }
 }
 
-class RemovePositionRequest {
-	String? token;
-	List<String>? positionCodes;
-
-	RemovePositionRequest({
-		this.token,
-		this.positionCodes,
-	});
-
-	factory RemovePositionRequest.fromJson(Map<String, dynamic> map) {
-		return RemovePositionRequest( 
-			token: map['Token'],
-			positionCodes: map['PositionCodes'].cast<String>().toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(positionCodes != null)
-			map['PositionCodes'] = positionCodes;
-		return map;
-	}
+class PositionItemDTO {
+  String? positionName;
+  String? organizationCode;
+  List<String>? underUserCodes;
+  String? extendsData;
+
+  PositionItemDTO({
+    this.positionName,
+    this.organizationCode,
+    this.underUserCodes,
+    this.extendsData,
+  });
+
+  factory PositionItemDTO.fromJson(Map<String, dynamic> map) {
+    return PositionItemDTO(
+      positionName: map['PositionName'],
+      organizationCode: map['OrganizationCode'],
+      underUserCodes: map['UnderUserCodes'].cast<String>().toList(),
+      extendsData: map['ExtendsData'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    if (positionName != null) map['PositionName'] = positionName;
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    if (underUserCodes != null) map['UnderUserCodes'] = underUserCodes;
+    if (extendsData != null) map['ExtendsData'] = extendsData;
+    return map;
+  }
 }
 
+class AddPositionsRequest {
+  String? token;
+  List<PositionItemDTO>? positions;
+
+  AddPositionsRequest({
+    this.token,
+    this.positions,
+  });
+
+  factory AddPositionsRequest.fromJson(Map<String, dynamic> map) {
+    return AddPositionsRequest(
+      token: map['Token'],
+      positions: map['Positions']
+          .map((e) => PositionItemDTO.fromJson(e as Map<String, dynamic>))
+          .toList(),
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    if (token != null) map['Token'] = token;
+    if (positions != null) map['Positions'] = positions;
+    return map;
+  }
+}
 
+class UpdatePositionsRequest extends TokenRequest {
+  List<PositionItemDTO>? positions;
+
+  UpdatePositionsRequest({
+    this.positions,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory UpdatePositionsRequest.fromJson(Map<String, dynamic> map) {
+    return UpdatePositionsRequest(
+      positions: map['Positions']
+          .map((e) => PositionItemDTO.fromJson(e as Map<String, dynamic>))
+          .toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (positions != null) map['Positions'] = positions;
+    return map;
+  }
+}
 
+class RemovePositionRequest extends TokenRequest {
+  List<String>? positionCodes;
+
+  RemovePositionRequest({
+    this.positionCodes,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory RemovePositionRequest.fromJson(Map<String, dynamic> map) {
+    return RemovePositionRequest(
+      positionCodes: map['PositionCodes'].cast<String>().toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (positionCodes != null) map['PositionCodes'] = positionCodes;
+    return map;
+  }
+}

+ 6 - 6
lib/services/rank.dart

@@ -18,18 +18,18 @@ class RankService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => RankInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => RankDTO.fromJson(map));
 	}
 
-	Future<RankInfo> getRankByCode(String token,String rankCode) async {
-		var rpcRst = await call("GetRankByCode", [token,rankCode]);
-		var result = RankInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<RankDTO> getRankByCode(GetRankByCodeRequest request) async {
+		var rpcRst = await call("GetRankByCode", request);
+		var result = RankDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<List<RankInfo>> getAllRanks(GetRanksRequest request) async {
+	Future<List<RankDTO>> getAllRanks(GetRanksRequest request) async {
 		var rpcRst = await call("GetAllRanks", request);
-		var result = (rpcRst as List).map((e)=>RankInfo.fromJson(e as Map<String, dynamic>)).toList();
+		var result = (rpcRst as List).map((e)=>RankDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 

+ 233 - 185
lib/services/rank.m.dart

@@ -1,203 +1,251 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
-	DateTime? createTime;
-	DateTime? updateTime;
-
-	BaseEntity({
-		this.createTime,
-		this.updateTime,
-	});
-
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
-			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;
-	}
+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;
+  }
 }
 
-class RankInfo extends BaseEntity{
-	String? rankCode;
-	String? rankName;
-
-	RankInfo({
-		this.rankCode,
-		this.rankName,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	factory RankInfo.fromJson(Map<String, dynamic> map) {
-		return RankInfo( 
-			rankCode: map['RankCode'],
-			rankName: map['RankName'],
-			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(rankCode != null)
-			map['RankCode'] = rankCode;
-		if(rankName != null)
-			map['RankName'] = rankName;
-		return map;
-	}
+class RankDTO extends BaseDTO {
+  String? rankCode;
+  String? rankName;
+
+  RankDTO({
+    this.rankCode,
+    this.rankName,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory RankDTO.fromJson(Map<String, dynamic> map) {
+    return RankDTO(
+      rankCode: map['RankCode'],
+      rankName: map['RankName'],
+      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 (rankCode != null) map['RankCode'] = rankCode;
+    if (rankName != null) map['RankName'] = rankName;
+    return map;
+  }
 }
 
-class GetRanksRequest {
-	String? token;
-	List<String>? rankCodes;
-	List<String>? organizationCodes;
-
-	GetRanksRequest({
-		this.token,
-		this.rankCodes,
-		this.organizationCodes,
-	});
-
-	factory GetRanksRequest.fromJson(Map<String, dynamic> map) {
-		return GetRanksRequest( 
-			token: map['Token'],
-			rankCodes: map['RankCodes'].cast<String>().toList(),
-			organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(rankCodes != null)
-			map['RankCodes'] = rankCodes;
-		if(organizationCodes != null)
-			map['OrganizationCodes'] = organizationCodes;
-		return map;
-	}
+class BaseRequest {
+  BaseRequest();
+
+  factory BaseRequest.fromJson(Map<String, dynamic> map) {
+    return BaseRequest();
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    return map;
+  }
 }
 
-class RankItem {
-	String? rankName;
-	String? organizationCode;
-	String? extendsData;
-
-	RankItem({
-		this.rankName,
-		this.organizationCode,
-		this.extendsData,
-	});
-
-	factory RankItem.fromJson(Map<String, dynamic> map) {
-		return RankItem( 
-			rankName: map['RankName'],
-			organizationCode: map['OrganizationCode'],
-			extendsData: map['ExtendsData'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(rankName != null)
-			map['RankName'] = rankName;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		if(extendsData != null)
-			map['ExtendsData'] = extendsData;
-		return map;
-	}
+class TokenRequest extends BaseRequest {
+  String? token;
+
+  TokenRequest({
+    this.token,
+  }) : super();
+
+  factory TokenRequest.fromJson(Map<String, dynamic> map) {
+    return TokenRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (token != null) map['Token'] = token;
+    return map;
+  }
 }
 
-class AddRanksRequest {
-	String? token;
-	List<RankItem>? rankInfos;
-
-	AddRanksRequest({
-		this.token,
-		this.rankInfos,
-	});
-
-	factory AddRanksRequest.fromJson(Map<String, dynamic> map) {
-		return AddRanksRequest( 
-			token: map['Token'],
-			rankInfos: map['RankInfos'].map((e)=>RankItem.fromJson(e as Map<String,dynamic>)).toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(rankInfos != null)
-			map['RankInfos'] = rankInfos;
-		return map;
-	}
+class GetRankByCodeRequest extends TokenRequest {
+  String? rankCode;
+
+  GetRankByCodeRequest({
+    this.rankCode,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetRankByCodeRequest.fromJson(Map<String, dynamic> map) {
+    return GetRankByCodeRequest(
+      rankCode: map['RankCode'],
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (rankCode != null) map['RankCode'] = rankCode;
+    return map;
+  }
 }
 
-class RemoveRanksRequest {
-	String? token;
-	List<String>? rankCodes;
-
-	RemoveRanksRequest({
-		this.token,
-		this.rankCodes,
-	});
-
-	factory RemoveRanksRequest.fromJson(Map<String, dynamic> map) {
-		return RemoveRanksRequest( 
-			token: map['Token'],
-			rankCodes: map['RankCodes'].cast<String>().toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(rankCodes != null)
-			map['RankCodes'] = rankCodes;
-		return map;
-	}
+class GetRanksRequest extends TokenRequest {
+  List<String>? rankCodes;
+  List<String>? organizationCodes;
+
+  GetRanksRequest({
+    this.rankCodes,
+    this.organizationCodes,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetRanksRequest.fromJson(Map<String, dynamic> map) {
+    return GetRanksRequest(
+      rankCodes: map['RankCodes'].cast<String>().toList(),
+      organizationCodes: map['OrganizationCodes'].cast<String>().toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (rankCodes != null) map['RankCodes'] = rankCodes;
+    if (organizationCodes != null) map['OrganizationCodes'] = organizationCodes;
+    return map;
+  }
 }
 
-class UpdateRanksRequest {
-	String? token;
-	List<RankItem>? ranks;
-
-	UpdateRanksRequest({
-		this.token,
-		this.ranks,
-	});
-
-	factory UpdateRanksRequest.fromJson(Map<String, dynamic> map) {
-		return UpdateRanksRequest( 
-			token: map['Token'],
-			ranks: map['Ranks'].map((e)=>RankItem.fromJson(e as Map<String,dynamic>)).toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(ranks != null)
-			map['Ranks'] = ranks;
-		return map;
-	}
+class RankItemDTO {
+  String? rankName;
+  String? organizationCode;
+  String? extendsData;
+
+  RankItemDTO({
+    this.rankName,
+    this.organizationCode,
+    this.extendsData,
+  });
+
+  factory RankItemDTO.fromJson(Map<String, dynamic> map) {
+    return RankItemDTO(
+      rankName: map['RankName'],
+      organizationCode: map['OrganizationCode'],
+      extendsData: map['ExtendsData'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    if (rankName != null) map['RankName'] = rankName;
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    if (extendsData != null) map['ExtendsData'] = extendsData;
+    return map;
+  }
 }
 
+class AddRanksRequest extends TokenRequest {
+  List<RankItemDTO>? rankInfos;
+
+  AddRanksRequest({
+    this.rankInfos,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory AddRanksRequest.fromJson(Map<String, dynamic> map) {
+    return AddRanksRequest(
+      rankInfos: map['RankInfos']
+          .map((e) => RankItemDTO.fromJson(e as Map<String, dynamic>))
+          .toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (rankInfos != null) map['RankInfos'] = rankInfos;
+    return map;
+  }
+}
 
+class RemoveRanksRequest extends TokenRequest {
+  List<String>? rankCodes;
+
+  RemoveRanksRequest({
+    this.rankCodes,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory RemoveRanksRequest.fromJson(Map<String, dynamic> map) {
+    return RemoveRanksRequest(
+      rankCodes: map['RankCodes'].cast<String>().toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (rankCodes != null) map['RankCodes'] = rankCodes;
+    return map;
+  }
+}
 
+class UpdateRanksRequest extends TokenRequest {
+  List<RankItemDTO>? ranks;
+
+  UpdateRanksRequest({
+    this.ranks,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory UpdateRanksRequest.fromJson(Map<String, dynamic> map) {
+    return UpdateRanksRequest(
+      ranks: map['Ranks']
+          .map((e) => RankItemDTO.fromJson(e as Map<String, dynamic>))
+          .toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (ranks != null) map['Ranks'] = ranks;
+    return map;
+  }
+}

+ 4 - 4
lib/services/region.dart

@@ -18,12 +18,12 @@ class RegionService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => RegionInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => RegionDTO.fromJson(map));
 	}
 
-	Future<RegionInfo> getRegions(String version,String languageType) async {
-		var rpcRst = await call("GetRegions", [version,languageType]);
-		var result = RegionInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<RegionDTO> getRegions(GetRegionsRequest request) async {
+		var rpcRst = await call("GetRegions", request);
+		var result = RegionDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 

+ 34 - 8
lib/services/region.m.dart

@@ -1,16 +1,16 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
+class BaseDTO {
 	DateTime? createTime;
 	DateTime? updateTime;
 
-	BaseEntity({
+	BaseDTO({
 		this.createTime,
 		this.updateTime,
 	});
 
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
+	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,
 		);
@@ -26,12 +26,12 @@ class BaseEntity {
 	}
 }
 
-class RegionInfo extends BaseEntity{
+class RegionDTO extends BaseDTO{
 	String? regionVersion;
 	String? languageType;
 	String? reginData;
 
-	RegionInfo({
+	RegionDTO({
 		this.regionVersion,
 		this.languageType,
 		this.reginData,
@@ -42,8 +42,8 @@ class RegionInfo extends BaseEntity{
 			updateTime: updateTime,
 		);
 
-	factory RegionInfo.fromJson(Map<String, dynamic> map) {
-		return RegionInfo( 
+	factory RegionDTO.fromJson(Map<String, dynamic> map) {
+		return RegionDTO( 
 			regionVersion: map['RegionVersion'],
 			languageType: map['LanguageType'],
 			reginData: map['ReginData'],
@@ -64,5 +64,31 @@ class RegionInfo extends BaseEntity{
 	}
 }
 
+class GetRegionsRequest {
+	String? version;
+	String? languageType;
+
+	GetRegionsRequest({
+		this.version,
+		this.languageType,
+	});
+
+	factory GetRegionsRequest.fromJson(Map<String, dynamic> map) {
+		return GetRegionsRequest( 
+			version: map['Version'],
+			languageType: map['LanguageType'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(version != null)
+			map['Version'] = version;
+		if(languageType != null)
+			map['LanguageType'] = languageType;
+		return map;
+	}
+}
+
 
 

+ 26 - 26
lib/services/remedical.m.dart

@@ -3,22 +3,22 @@ import 'package:fis_jsonrpc/utils.dart';
 import 'package:fis_common/json_convert.dart';
 
 class BaseRequest {
-	String? sessionId;
+	String? token;
 
 	BaseRequest({
-		this.sessionId,
+		this.token,
 	});
 
 	factory BaseRequest.fromJson(Map<String, dynamic> map) {
 		return BaseRequest( 
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
 	Map<String, dynamic> toJson() {
 		final map = Map<String, dynamic>();
-		if(sessionId != null)
-			map['SessionId'] = sessionId;
+		if(token != null)
+			map['Token'] = token;
 		return map;
 	}
 }
@@ -129,15 +129,15 @@ class CreatePatientInfoRequest extends BaseRequest{
 
 	CreatePatientInfoRequest({
 		this.info,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory CreatePatientInfoRequest.fromJson(Map<String, dynamic> map) {
 		return CreatePatientInfoRequest( 
 			info: map['Info'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -225,15 +225,15 @@ class CreateDeviceDataRequest extends BaseRequest{
 
 	CreateDeviceDataRequest({
 		this.info,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory CreateDeviceDataRequest.fromJson(Map<String, dynamic> map) {
 		return CreateDeviceDataRequest( 
 			info: map['Info'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -333,15 +333,15 @@ class CreateRecordInfoRequest extends BaseRequest{
 
 	CreateRecordInfoRequest({
 		this.info,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory CreateRecordInfoRequest.fromJson(Map<String, dynamic> map) {
 		return CreateRecordInfoRequest( 
 			info: map['Info'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -358,15 +358,15 @@ class GetDeviceDataDetailRequest extends BaseRequest{
 
 	GetDeviceDataDetailRequest({
 		this.deviceDataCode,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory GetDeviceDataDetailRequest.fromJson(Map<String, dynamic> map) {
 		return GetDeviceDataDetailRequest( 
 			deviceDataCode: map['DeviceDataCode'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -383,15 +383,15 @@ class GetRecordInfoDetailRequest extends BaseRequest{
 
 	GetRecordInfoDetailRequest({
 		this.recordCode,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory GetRecordInfoDetailRequest.fromJson(Map<String, dynamic> map) {
 		return GetRecordInfoDetailRequest( 
 			recordCode: map['RecordCode'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -452,9 +452,9 @@ class PageRequest extends BaseRequest{
 		this.pageSize = 0,
 		this.filter,
 		this.isFuzzy = false,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory PageRequest.fromJson(Map<String, dynamic> map) {
@@ -463,7 +463,7 @@ class PageRequest extends BaseRequest{
 			pageSize: map['PageSize'],
 			filter: map['Filter'].cast<String,String>(),
 			isFuzzy: map['IsFuzzy'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 
@@ -483,15 +483,15 @@ class GetPatientInfoRequest extends BaseRequest{
 
 	GetPatientInfoRequest({
 		this.patientCode,
-		String? sessionId,
+		String? token,
 	}) : super(
-			sessionId: sessionId,
+			token: token,
 		);
 
 	factory GetPatientInfoRequest.fromJson(Map<String, dynamic> map) {
 		return GetPatientInfoRequest( 
 			patientCode: map['PatientCode'],
-			sessionId: map['SessionId'],
+			token: map['Token'],
 		);
 	}
 

+ 10 - 10
lib/services/role.dart

@@ -18,24 +18,24 @@ class RoleService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => RoleInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => RoleDTO.fromJson(map));
 	}
 
-	Future<RoleInfo> getRoleByCode(String sessionId,String roleCode) async {
-		var rpcRst = await call("GetRoleByCode", [sessionId,roleCode]);
-		var result = RoleInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<RoleDTO> getRoleByCode(GetRoleByCodeRequest request) async {
+		var rpcRst = await call("GetRoleByCode", request);
+		var result = RoleDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<List<RoleInfo>> findDefaultRoles(String sessionId,String organizationCode) async {
-		var rpcRst = await call("FindDefaultRoles", [sessionId,organizationCode]);
-		var result = (rpcRst as List).map((e)=>RoleInfo.fromJson(e as Map<String, dynamic>)).toList();
+	Future<List<RoleDTO>> findDefaultRoles(FindDefaultRolesRequest request) async {
+		var rpcRst = await call("FindDefaultRoles", request);
+		var result = (rpcRst as List).map((e)=>RoleDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 
-	Future<List<RoleInfo>> findAuthenticationRoles(String sessionId,String organizationCode) async {
-		var rpcRst = await call("FindAuthenticationRoles", [sessionId,organizationCode]);
-		var result = (rpcRst as List).map((e)=>RoleInfo.fromJson(e as Map<String, dynamic>)).toList();
+	Future<List<RoleDTO>> findAuthenticationRoles(FindAuthenticationRolesRequest request) async {
+		var rpcRst = await call("FindAuthenticationRoles", request);
+		var result = (rpcRst as List).map((e)=>RoleDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 

+ 191 - 89
lib/services/role.m.dart

@@ -1,103 +1,205 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
-	DateTime? createTime;
-	DateTime? updateTime;
-
-	BaseEntity({
-		this.createTime,
-		this.updateTime,
-	});
-
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
-			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;
-	}
+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 RoleShowTypeEnum {
-	NotShow,
-	ISShow,
+  NotShow,
+  ISShow,
 }
 
 enum RoleQualificationEnum {
-	NoNeed,
-	ID,
-	DocLicense,
-	Both,
+  NoNeed,
+  ID,
+  DocLicense,
+  Both,
+}
+
+class RoleDTO extends BaseDTO {
+  String? roleCode;
+  String? roleName;
+  RoleShowTypeEnum roleShowType;
+  String? description;
+  String? iConUrl;
+  String? colorStart;
+  String? colorEnd;
+  RoleQualificationEnum roleQualification;
+
+  RoleDTO({
+    this.roleCode,
+    this.roleName,
+    this.roleShowType = RoleShowTypeEnum.NotShow,
+    this.description,
+    this.iConUrl,
+    this.colorStart,
+    this.colorEnd,
+    this.roleQualification = RoleQualificationEnum.NoNeed,
+    DateTime? createTime,
+    DateTime? updateTime,
+  }) : super(
+          createTime: createTime,
+          updateTime: updateTime,
+        );
+
+  factory RoleDTO.fromJson(Map<String, dynamic> map) {
+    return RoleDTO(
+      roleCode: map['RoleCode'],
+      roleName: map['RoleName'],
+      roleShowType: RoleShowTypeEnum.values
+          .firstWhere((e) => e.index == map['RoleShowType']),
+      description: map['Description'],
+      iConUrl: map['IConUrl'],
+      colorStart: map['ColorStart'],
+      colorEnd: map['ColorEnd'],
+      roleQualification: RoleQualificationEnum.values
+          .firstWhere((e) => e.index == map['RoleQualification']),
+      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 (roleCode != null) map['RoleCode'] = roleCode;
+    if (roleName != null) map['RoleName'] = roleName;
+    map['RoleShowType'] = roleShowType.index;
+    if (description != null) map['Description'] = description;
+    if (iConUrl != null) map['IConUrl'] = iConUrl;
+    if (colorStart != null) map['ColorStart'] = colorStart;
+    if (colorEnd != null) map['ColorEnd'] = colorEnd;
+    map['RoleQualification'] = roleQualification.index;
+    return map;
+  }
 }
 
-class RoleInfo extends BaseEntity{
-	String? roleCode;
-	String? roleName;
-	RoleShowTypeEnum roleShowType;
-	String? description;
-	String? iConUrl;
-	String? colorStart;
-	String? colorEnd;
-	RoleQualificationEnum roleQualification;
-
-	RoleInfo({
-		this.roleCode,
-		this.roleName,
-		this.roleShowType = RoleShowTypeEnum.NotShow,
-		this.description,
-		this.iConUrl,
-		this.colorStart,
-		this.colorEnd,
-		this.roleQualification = RoleQualificationEnum.NoNeed,
-		DateTime? createTime,
-		DateTime? updateTime,
-	}) : super(
-			createTime: createTime,
-			updateTime: updateTime,
-		);
-
-	factory RoleInfo.fromJson(Map<String, dynamic> map) {
-		return RoleInfo( 
-			roleCode: map['RoleCode'],
-			roleName: map['RoleName'],
-			roleShowType: RoleShowTypeEnum.values.firstWhere((e) => e.index == map['RoleShowType']),
-			description: map['Description'],
-			iConUrl: map['IConUrl'],
-			colorStart: map['ColorStart'],
-			colorEnd: map['ColorEnd'],
-			roleQualification: RoleQualificationEnum.values.firstWhere((e) => e.index == map['RoleQualification']),
-			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(roleCode != null)
-			map['RoleCode'] = roleCode;
-		if(roleName != null)
-			map['RoleName'] = roleName;
-		map['RoleShowType'] = roleShowType.index;
-		if(description != null)
-			map['Description'] = description;
-		if(iConUrl != null)
-			map['IConUrl'] = iConUrl;
-		if(colorStart != null)
-			map['ColorStart'] = colorStart;
-		if(colorEnd != null)
-			map['ColorEnd'] = colorEnd;
-		map['RoleQualification'] = roleQualification.index;
-		return map;
-	}
+class BaseRequest {
+  BaseRequest();
+
+  factory BaseRequest.fromJson(Map<String, dynamic> map) {
+    return BaseRequest();
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    return map;
+  }
 }
 
+class TokenRequest extends BaseRequest {
+  String? token;
+
+  TokenRequest({
+    this.token,
+  }) : super();
+
+  factory TokenRequest.fromJson(Map<String, dynamic> map) {
+    return TokenRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (token != null) map['Token'] = token;
+    return map;
+  }
+}
 
+class GetRoleByCodeRequest extends TokenRequest {
+  String? roleCode;
 
+  GetRoleByCodeRequest({
+    this.roleCode,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetRoleByCodeRequest.fromJson(Map<String, dynamic> map) {
+    return GetRoleByCodeRequest(
+      roleCode: map['RoleCode'],
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (roleCode != null) map['RoleCode'] = roleCode;
+    return map;
+  }
+}
+
+class FindDefaultRolesRequest extends TokenRequest {
+  String? organizationCode;
+
+  FindDefaultRolesRequest({
+    this.organizationCode,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory FindDefaultRolesRequest.fromJson(Map<String, dynamic> map) {
+    return FindDefaultRolesRequest(
+      organizationCode: map['OrganizationCode'],
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    return map;
+  }
+}
+
+class FindAuthenticationRolesRequest extends TokenRequest {
+  String? organizationCode;
+
+  FindAuthenticationRolesRequest({
+    this.organizationCode,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory FindAuthenticationRolesRequest.fromJson(Map<String, dynamic> map) {
+    return FindAuthenticationRolesRequest(
+      organizationCode: map['OrganizationCode'],
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    return map;
+  }
+}

+ 10 - 10
lib/services/user.dart

@@ -18,23 +18,23 @@ class UserService extends JsonRpcClientBase {
 						timeout: timeout,
 				) {
 		/// 注册响应实体反序列化处理器
-		FJsonConvert.setDecoder((map) => UserInfo.fromJson(map));
+		FJsonConvert.setDecoder((map) => UserDTO.fromJson(map));
 	}
 
-	Future<UserInfo> getUserInfoAsync(String sessionId) async {
-		var rpcRst = await call("GetUserInfoAsync", sessionId);
-		var result = UserInfo.fromJson(rpcRst as Map<String, dynamic>);
+	Future<UserDTO> getUserInfoAsync(GetUserInfoRequest request) async {
+		var rpcRst = await call("GetUserInfoAsync", request);
+		var result = UserDTO.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 
-	Future<bool> alterUserInfoAsync(String sessionId,UserInfo userInfo,String extensionData) async {
-		var rpcRst = await call("AlterUserInfoAsync", [sessionId,userInfo,extensionData]);
+	Future<bool> alterUserInfoAsync(AlterUserInfoRequest request) async {
+		var rpcRst = await call("AlterUserInfoAsync", request);
 		return rpcRst;
 	}
 
-	Future<List<UserInfo>> getUserList(GetUsersListRequest request) async {
+	Future<List<UserDTO>> getUserList(GetUserListRequest request) async {
 		var rpcRst = await call("GetUserList", request);
-		var result = (rpcRst as List).map((e)=>UserInfo.fromJson(e as Map<String, dynamic>)).toList();
+		var result = (rpcRst as List).map((e)=>UserDTO.fromJson(e as Map<String, dynamic>)).toList();
 		return result;
 	}
 
@@ -48,8 +48,8 @@ class UserService extends JsonRpcClientBase {
 		return rpcRst;
 	}
 
-	Future<bool> alterPersonInfoAsync(String sessionId,UserInfo userInfo) async {
-		var rpcRst = await call("AlterPersonInfoAsync", [sessionId,userInfo]);
+	Future<bool> alterPersonInfoAsync(AlterPersonInfoRequest request) async {
+		var rpcRst = await call("AlterPersonInfoAsync", request);
 		return rpcRst;
 	}
 

+ 448 - 245
lib/services/user.m.dart

@@ -1,265 +1,468 @@
 import 'package:fis_jsonrpc/utils.dart';
 
-class BaseEntity {
-	DateTime? createTime;
-	DateTime? updateTime;
-
-	BaseEntity({
-		this.createTime,
-		this.updateTime,
-	});
-
-	factory BaseEntity.fromJson(Map<String, dynamic> map) {
-		return BaseEntity( 
-			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;
-	}
+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,
+  Nonactivated,
+  Activated,
 }
 
 enum ApplyStateEnum {
-	NotApply,
-	Applying,
-	Refused,
-	Passed,
+  NotApply,
+  Applying,
+  Refused,
+  Passed,
 }
 
-class UserInfo extends BaseEntity{
-	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;
-
-	UserInfo({
-		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 UserInfo.fromJson(Map<String, dynamic> map) {
-		return UserInfo( 
-			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 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 BaseRequest {
+  BaseRequest();
+
+  factory BaseRequest.fromJson(Map<String, dynamic> map) {
+    return BaseRequest();
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = Map<String, dynamic>();
+    return map;
+  }
 }
 
-class GetUsersListRequest {
-	String? token;
-	String? roleCode;
-	String? rankCode;
-	String? positionCode;
-	String? organizationCode;
-
-	GetUsersListRequest({
-		this.token,
-		this.roleCode,
-		this.rankCode,
-		this.positionCode,
-		this.organizationCode,
-	});
-
-	factory GetUsersListRequest.fromJson(Map<String, dynamic> map) {
-		return GetUsersListRequest( 
-			token: map['Token'],
-			roleCode: map['RoleCode'],
-			rankCode: map['RankCode'],
-			positionCode: map['PositionCode'],
-			organizationCode: map['OrganizationCode'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(roleCode != null)
-			map['RoleCode'] = roleCode;
-		if(rankCode != null)
-			map['RankCode'] = rankCode;
-		if(positionCode != null)
-			map['PositionCode'] = positionCode;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		return map;
-	}
+class TokenRequest extends BaseRequest {
+  String? token;
+
+  TokenRequest({
+    this.token,
+  }) : super();
+
+  factory TokenRequest.fromJson(Map<String, dynamic> map) {
+    return TokenRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (token != null) map['Token'] = token;
+    return map;
+  }
 }
 
-class RemoveUsersFromOrganizationRequest {
-	String? token;
-	List<String>? userCodes;
-
-	RemoveUsersFromOrganizationRequest({
-		this.token,
-		this.userCodes,
-	});
-
-	factory RemoveUsersFromOrganizationRequest.fromJson(Map<String, dynamic> map) {
-		return RemoveUsersFromOrganizationRequest( 
-			token: map['Token'],
-			userCodes: map['UserCodes'].cast<String>().toList(),
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(userCodes != null)
-			map['UserCodes'] = userCodes;
-		return map;
-	}
+class GetUserInfoRequest extends TokenRequest {
+  GetUserInfoRequest({
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory GetUserInfoRequest.fromJson(Map<String, dynamic> map) {
+    return GetUserInfoRequest(
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    return map;
+  }
 }
 
-class SetUserOrganizationInfoRequest {
-	String? token;
-	String? userCode;
-	List<String>? roleCodes;
-	List<String>? rankCodes;
-	List<String>? positionCodes;
-	String? organizationCode;
-
-	SetUserOrganizationInfoRequest({
-		this.token,
-		this.userCode,
-		this.roleCodes,
-		this.rankCodes,
-		this.positionCodes,
-		this.organizationCode,
-	});
-
-	factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
-		return SetUserOrganizationInfoRequest( 
-			token: map['Token'],
-			userCode: map['UserCode'],
-			roleCodes: map['RoleCodes'].cast<String>().toList(),
-			rankCodes: map['RankCodes'].cast<String>().toList(),
-			positionCodes: map['PositionCodes'].cast<String>().toList(),
-			organizationCode: map['OrganizationCode'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = Map<String, dynamic>();
-		if(token != null)
-			map['Token'] = token;
-		if(userCode != null)
-			map['UserCode'] = userCode;
-		if(roleCodes != null)
-			map['RoleCodes'] = roleCodes;
-		if(rankCodes != null)
-			map['RankCodes'] = rankCodes;
-		if(positionCodes != null)
-			map['PositionCodes'] = positionCodes;
-		if(organizationCode != null)
-			map['OrganizationCode'] = organizationCode;
-		return map;
-	}
+class AlterUserInfoRequest extends UserDTO {
+  String? token;
+  String? extensionData;
+
+  AlterUserInfoRequest({
+    this.token,
+    this.extensionData,
+    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 AlterUserInfoRequest.fromJson(Map<String, dynamic> map) {
+    return AlterUserInfoRequest(
+      token: map['Token'],
+      extensionData: map['ExtensionData'],
+      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 (token != null) map['Token'] = token;
+    if (extensionData != null) map['ExtensionData'] = extensionData;
+    return map;
+  }
 }
 
+class GetUserListRequest extends TokenRequest {
+  String? roleCode;
+  String? rankCode;
+  String? positionCode;
+  String? organizationCode;
 
+  GetUserListRequest({
+    this.roleCode,
+    this.rankCode,
+    this.positionCode,
+    this.organizationCode,
+    String? token,
+  }) : super(
+          token: token,
+        );
 
+  factory GetUserListRequest.fromJson(Map<String, dynamic> map) {
+    return GetUserListRequest(
+      roleCode: map['RoleCode'],
+      rankCode: map['RankCode'],
+      positionCode: map['PositionCode'],
+      organizationCode: map['OrganizationCode'],
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (roleCode != null) map['RoleCode'] = roleCode;
+    if (rankCode != null) map['RankCode'] = rankCode;
+    if (positionCode != null) map['PositionCode'] = positionCode;
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    return map;
+  }
+}
+
+class RemoveUsersFromOrganizationRequest extends TokenRequest {
+  List<String>? userCodes;
+
+  RemoveUsersFromOrganizationRequest({
+    this.userCodes,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory RemoveUsersFromOrganizationRequest.fromJson(
+      Map<String, dynamic> map) {
+    return RemoveUsersFromOrganizationRequest(
+      userCodes: map['UserCodes'].cast<String>().toList(),
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (userCodes != null) map['UserCodes'] = userCodes;
+    return map;
+  }
+}
+
+class SetUserOrganizationInfoRequest extends TokenRequest {
+  String? userCode;
+  List<String>? roleCodes;
+  List<String>? rankCodes;
+  List<String>? positionCodes;
+  String? organizationCode;
+
+  SetUserOrganizationInfoRequest({
+    this.userCode,
+    this.roleCodes,
+    this.rankCodes,
+    this.positionCodes,
+    this.organizationCode,
+    String? token,
+  }) : super(
+          token: token,
+        );
+
+  factory SetUserOrganizationInfoRequest.fromJson(Map<String, dynamic> map) {
+    return SetUserOrganizationInfoRequest(
+      userCode: map['UserCode'],
+      roleCodes: map['RoleCodes'].cast<String>().toList(),
+      rankCodes: map['RankCodes'].cast<String>().toList(),
+      positionCodes: map['PositionCodes'].cast<String>().toList(),
+      organizationCode: map['OrganizationCode'],
+      token: map['Token'],
+    );
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    if (userCode != null) map['UserCode'] = userCode;
+    if (roleCodes != null) map['RoleCodes'] = roleCodes;
+    if (rankCodes != null) map['RankCodes'] = rankCodes;
+    if (positionCodes != null) map['PositionCodes'] = positionCodes;
+    if (organizationCode != null) map['OrganizationCode'] = organizationCode;
+    return map;
+  }
+}
+
+class AlterPersonInfoRequest extends UserDTO {
+  String? token;
+
+  AlterPersonInfoRequest({
+    this.token,
+    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 AlterPersonInfoRequest.fromJson(Map<String, dynamic> map) {
+    return AlterPersonInfoRequest(
+      token: map['Token'],
+      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 (token != null) map['Token'] = token;
+    return map;
+  }
+}