|
@@ -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;
|
|
|
+ }
|
|
|
+}
|