399 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			C#
		
	
	
			
		
		
	
	
			399 lines
		
	
	
		
			11 KiB
		
	
	
	
		
			C#
		
	
	
| using IRaCIS.Core.Domain.Share;
 | |
| using Newtonsoft.Json;
 | |
| 
 | |
| 
 | |
| namespace IRaCIS.Application.Contracts
 | |
| {
 | |
| 
 | |
|     public class UserTypeViewModel
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
| 
 | |
|         public string UserType { get; set; } = string.Empty;
 | |
|         public UserTypeEnum UserTypeEnum { get; set; }
 | |
|         public string Description { get; set; } = string.Empty;
 | |
|     }
 | |
| 
 | |
|     public class UserLoginDTO
 | |
|     {
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
|         public string Password { get; set; } = string.Empty;
 | |
| 
 | |
|         public Guid? UserId { get; set; }
 | |
|     }
 | |
|     public class IRCLoginDto
 | |
|     {
 | |
|         public string UserName { get; set; }
 | |
|         public string Password { get; set; }
 | |
|     }
 | |
|     public class LoginSelectRoleReturn
 | |
|     {
 | |
|         public string JwtStr { get; set; }
 | |
| 
 | |
|         public bool IsMutiAccount => AccountList.Count > 1;
 | |
| 
 | |
|         public List<UserAccountInfo> AccountList { get; set; } = new List<UserAccountInfo>();
 | |
|     }
 | |
| 
 | |
|     public class UserAccountInfo
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
|         public Guid IdentityUserId { get; set; }
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
|         public string FullName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string Phone { get; set; } = string.Empty;
 | |
|         public string EMail { get; set; } = string.Empty;
 | |
| 
 | |
|         public Guid UserTypeId { get; set; }
 | |
| 
 | |
|         public UserTypeEnum UserTypeEnum { get; set; }
 | |
| 
 | |
|         public string UserTypeShortName { get; set; }
 | |
| 
 | |
|         public bool IsUserRoleDisabled { get; set; }
 | |
| 
 | |
| 
 | |
| 
 | |
|     }
 | |
|     public class LoginReturnDTO
 | |
|     {
 | |
|         public UserBasicInfo BasicInfo { get; set; } = new UserBasicInfo();
 | |
|         public string JWTStr { get; set; } = string.Empty;
 | |
| 
 | |
|         public bool IsMFA { get; set; } = false;
 | |
| 
 | |
|         public SystemEmailSendConfigView CompanyInfo { get; set; }
 | |
| 
 | |
|     }
 | |
| 
 | |
|     public class IRCLoginReturnDTO
 | |
|     {
 | |
|         public UserBasicInfo BasicInfo { get; set; } = new UserBasicInfo();
 | |
|         public string JWTStr { get; set; } = string.Empty;
 | |
| 
 | |
|         public bool IsMFA { get; set; } = false;
 | |
| 
 | |
|         public SystemEmailSendConfigView CompanyInfo { get; set; }
 | |
| 
 | |
|     }
 | |
| 
 | |
|     public class UserBasicInfo
 | |
|     {
 | |
|         public Guid IdentityUserId { get; set; }
 | |
| 
 | |
|         public Guid UserRoleId { get; set; }
 | |
| 
 | |
|         public bool IsMutiAccount => AccountList?.Count > 1;
 | |
|         public List<UserAccountInfo> AccountList { get; set; }
 | |
| 
 | |
| 
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
|         public string FullName { get; set; } = string.Empty;
 | |
|         public int? Sex { get; set; } // 1-男  2-女
 | |
|         public string UserCode { get; set; }
 | |
|         public string EMail { get; set; }
 | |
| 
 | |
|         public int Status { get; set; }
 | |
|         public bool IsTestUser { get; set; }
 | |
|         public bool IsZhiZhun { get; set; }
 | |
|         public bool IsFirstAdd { get; set; }
 | |
| 
 | |
|         public bool NeedChangePassWord { get; set; } = false;
 | |
| 
 | |
| 
 | |
|         public bool PasswordChanged { get; set; }
 | |
| 
 | |
|         public int LoginState { get; set; } = 0;
 | |
|         public string LastLoginIP { get; set; } = string.Empty;
 | |
|         public DateTime? LastLoginTime { get; set; }
 | |
|         /// <summary>
 | |
|         /// 上一次修改密码的时间
 | |
|         /// </summary>
 | |
|         public DateTime? LastChangePassWordTime { get; set; }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 用户协议Id
 | |
|         /// </summary>
 | |
|         public Guid? UserAgreementId { get; set; }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 隐私政策Id
 | |
|         /// </summary>
 | |
|         public Guid? PrivacyPolicyId { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class MenuFuncTreeNodeView
 | |
|     {
 | |
|         [JsonIgnore]
 | |
|         public Guid Id { get; set; }
 | |
|         [JsonIgnore]
 | |
|         public Guid ParentId { get; set; } = Guid.Empty;
 | |
|         [JsonIgnore]
 | |
|         public int ShowOrder { get; set; }
 | |
| 
 | |
|         public string routeName { get; set; } = string.Empty;
 | |
|         public string component { get; set; } = string.Empty;
 | |
|         public string redirect { get; set; } = string.Empty;
 | |
|         public string path { get; set; } = string.Empty;
 | |
|         public Meta meta { get; set; } = new Meta();
 | |
|         public bool hidden { get; set; }
 | |
|         public List<MenuFuncTreeNodeView> Childrens { get; set; } = new List<MenuFuncTreeNodeView>();
 | |
|     }
 | |
| 
 | |
|     public class Meta
 | |
|     {
 | |
|         public string MetaTitle { get; set; } = string.Empty;
 | |
|         public bool MetaBreadcrumb { get; set; } = false;
 | |
|         public string MetaIcon { get; set; } = string.Empty;
 | |
|         public string MetaActiveMenu { get; set; } = string.Empty;
 | |
|     }
 | |
| 
 | |
| 
 | |
|     public class FunctionTreeNodeDTO
 | |
|     {
 | |
|         [JsonIgnore]
 | |
|         public Guid Id { get; set; }
 | |
|         [JsonIgnore]
 | |
|         public Guid ParentId { get; set; } = Guid.Empty;
 | |
|         [JsonIgnore]
 | |
|         public int ShowOrder { get; set; }
 | |
| 
 | |
|         public string RouteName { get; set; } = string.Empty;
 | |
|         public string FunctionName { get; set; } = string.Empty;
 | |
| 
 | |
|         public List<FunctionTreeNodeDTO> Childrens { get; set; } = new List<FunctionTreeNodeDTO>();
 | |
|     }
 | |
| 
 | |
| 
 | |
| 
 | |
|     public class UserDetailDTO : UserInfo
 | |
|     {
 | |
|         //public bool CanEditUserType { get; set; }
 | |
| 
 | |
|         public string FullName { get; set; }
 | |
| 
 | |
|         public Guid Id { get; set; }
 | |
| 
 | |
|         public List<UserAccountInfo> AccountList { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class UserInfo
 | |
|     {
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string FirstName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string LastName { get; set; } = string.Empty;
 | |
|         public int? Sex { get; set; } // 1-男  2-女
 | |
| 
 | |
|         public UserStateEnum Status { get; set; } = UserStateEnum.Enable;
 | |
| 
 | |
|         public string Phone { get; set; } = string.Empty;
 | |
|         public string EMail { get; set; } = string.Empty;
 | |
| 
 | |
|         public string UserCode { get; set; } = string.Empty;
 | |
| 
 | |
|         public bool IsZhiZhun { get; set; }
 | |
| 
 | |
|         public string OrganizationName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string DepartmentName { get; set; } = String.Empty;
 | |
|         public string PositionName { get; set; } = String.Empty;
 | |
| 
 | |
|         public bool IsTestUser { get; set; }
 | |
| 
 | |
| 
 | |
|     }
 | |
| 
 | |
|     /// <summary>
 | |
|     /// 添加用户是的返回模型
 | |
|     /// </summary>
 | |
|     public class UserAddedReturnDTO
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
|         public string UserCode { get; set; } = string.Empty;
 | |
|     }
 | |
| 
 | |
| 
 | |
|     public class UserBasicInfoCommand : UserInfo
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class UpdateUserRolesDto
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
| 
 | |
|         public List<UserAddUserType> UserRoleList { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class UserCommand : UserInfo
 | |
|     {
 | |
|         public Guid? Id { get; set; }
 | |
| 
 | |
|         public List<UserAddUserType> UserRoleList { get; set; }
 | |
| 
 | |
| 
 | |
|         public string BaseUrl { get; set; } = string.Empty;
 | |
|         public string RouteUrl { get; set; } = string.Empty;
 | |
| 
 | |
|     }
 | |
| 
 | |
| 
 | |
|     public class NewUserSendEmailCommand
 | |
|     {
 | |
|         public Guid IdentityUserId { get; set; }
 | |
|         public string BaseUrl { get; set; } = string.Empty;
 | |
|         public string RouteUrl { get; set; } = string.Empty;
 | |
| 
 | |
|     }
 | |
| 
 | |
|     public class IdentityUserTypeDTO : UserAddUserType
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
|         public string UserTypeShortName { get; set; }
 | |
| 
 | |
|         public DateTime CreateTime { get; set; }
 | |
| 
 | |
|         public DateTime UpdateTime { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class UserAddUserType
 | |
|     {
 | |
| 
 | |
|         public UserTypeEnum UserTypeEnum { get; set; }
 | |
| 
 | |
|         public Guid UserTypeId { get; set; }
 | |
| 
 | |
|         public bool IsUserRoleDisabled { get; set; }
 | |
| 
 | |
| 
 | |
|     }
 | |
| 
 | |
|     public class EditPasswordCommand
 | |
|     {
 | |
|         public string NewUserName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string NewPassWord { get; set; } = string.Empty;
 | |
|         public string OldPassWord { get; set; } = string.Empty;
 | |
|     }
 | |
| 
 | |
| 
 | |
| 
 | |
|     public class UserAccountDto
 | |
|     {
 | |
|         public Guid Id { get; set; }
 | |
| 
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string UserRealName { get; set; } = string.Empty;
 | |
| 
 | |
|         public string UserType { get; set; } = string.Empty;
 | |
|     }
 | |
| 
 | |
|     public class UserListQueryDTO : PageInput
 | |
|     {
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
|         public string RealName { get; set; }
 | |
|         public string Phone { get; set; } = string.Empty;
 | |
|         public string OrganizationName { get; set; } = string.Empty;
 | |
|         public Guid? UserType { get; set; }
 | |
| 
 | |
|         public UserTypeEnum? UserTypeEnum { get; set; }
 | |
| 
 | |
|         public bool? IsTestUser { get; set; }
 | |
| 
 | |
|         public bool? IsZhiZhun { get; set; }
 | |
|         public UserStateEnum? UserState { get; set; }
 | |
| 
 | |
|         public DateTime? BeginCreateTime { get; set; }
 | |
| 
 | |
|         public DateTime? EndCreateTime { get; set; }
 | |
| 
 | |
|         public string? EMail { get; set; }
 | |
| 
 | |
|         public DateTime? BeginLastLoginTime { get; set; }
 | |
| 
 | |
|         public DateTime? EndLastLoginTime { get; set; }
 | |
| 
 | |
| 
 | |
|         public DateTime? BeginLastChangePassWordTime { get; set; }
 | |
| 
 | |
|         public DateTime? EndLastChangePassWordTime { get; set; }
 | |
| 
 | |
|         public UserCeateSource? UserCeateSource { get; set; }
 | |
| 
 | |
|         public Guid? AuditRecordId { get; set; }
 | |
| 
 | |
|         public bool? IsAuditRecordUserSelect { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class UserRoleInfoDTO
 | |
|     {
 | |
|         public List<string> RoleList { get; set; } = new List<string>();
 | |
|         public int MaxPrivilegeLevel { get; set; }
 | |
|     }
 | |
| 
 | |
|     public class UserListDTO : UserInfo
 | |
|     {
 | |
|         //public bool CanEditUserType { get; set; }
 | |
| 
 | |
|         public bool IsFirstAdd { get; set; }
 | |
| 
 | |
|         public DateTime? LastLoginTime { get; set; }
 | |
| 
 | |
|         public DateTime CreateTime { get; set; }
 | |
| 
 | |
|         public Guid Id { get; set; }
 | |
| 
 | |
|         public string FullName { get; set; }
 | |
| 
 | |
|         public DateTime? LastChangePassWordTime { get; set; }
 | |
| 
 | |
|         public List<IdentityUserTypeDTO> UserRoleList { get; set; }
 | |
| 
 | |
|         #region 用户来源
 | |
| 
 | |
|         public UserCeateSource UserCeateSource { get; set; }
 | |
| 
 | |
|         public Guid? TrialId { get; set; }
 | |
| 
 | |
|         public string TrialCode { get; set; }
 | |
| 
 | |
|         public string ResearchProgramNo { get; set; }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         public int JoinedTrialCount { get; set; }
 | |
| 
 | |
| 
 | |
|         public bool IsAuditRecordUserSelect { get; set; }
 | |
|     }
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
|     public class AllowAnonymousResetPasswordCommand
 | |
|     {
 | |
|         public string Email { get; set; } = string.Empty;
 | |
| 
 | |
|         public string VerificationCode { get; set; } = string.Empty;
 | |
| 
 | |
|         public string NewPwd { get; set; } = string.Empty;
 | |
| 
 | |
|         public string UserName { get; set; } = string.Empty;
 | |
|     }
 | |
| 
 | |
|     public class ResetPasswordCommand
 | |
|     {
 | |
|         public string EmailOrPhone { get; set; } = string.Empty;
 | |
|         public VerifyType VerificationType { get; set; }
 | |
|         public string VerificationCode { get; set; } = string.Empty;
 | |
|         public string NewPwd { get; set; } = string.Empty;
 | |
| 
 | |
|         public bool IsReviewer { get; set; } = false;
 | |
|     }
 | |
| }
 |