using System; using System.ComponentModel.DataAnnotations; namespace Myshipping.Core.Service; /// /// 用户参数 /// public class UserInput : InputBase { /// /// 账号 /// public virtual string Account { get; set; } /// /// 密码 /// public virtual string Password { get; set; } /// /// 昵称 /// public virtual string NickName { get; set; } /// /// 姓名 /// public virtual string Name { get; set; } /// /// 头像 /// public virtual string Avatar { get; set; } /// /// 生日 /// public virtual DateTime? Birthday { get; set; } /// /// 性别-男_1、女_2 /// public virtual int Sex { get; set; } /// /// 邮箱 /// public virtual string Email { get; set; } /// /// 手机 /// public virtual string Phone { get; set; } /// /// 电话 /// public virtual string Tel { get; set; } /// /// 状态-正常_0、停用_1、删除_2 /// public virtual CommonStatus Status { get; set; } /// /// 员工信息 /// public EmpOutput2 SysEmpParam { get; set; } = new EmpOutput2(); /// /// 搜索状态(字典 0正常 1停用 2删除) /// public CommonStatus SearchStatus { get; set; } = CommonStatus.ENABLE; } public class AddUserInput : UserInput { /// /// 账号 /// [Required(ErrorMessage = "账号名称不能为空"),MinLength(3, ErrorMessage = "用户名不能少于3位字符")] public override string Account { get; set; } /// /// 密码 /// [Required(ErrorMessage = "密码不能为空"), MinLength(5, ErrorMessage = "密码不能少于5位字符")] public override string Password { get; set; } /// /// 确认密码 /// [Required(ErrorMessage = "确认密码不能为空"), Compare(nameof(Password), ErrorMessage = "两次密码不一致")] public string Confirm { get; set; } } public class DeleteUserInput : UserInput { /// /// 用户Id /// [Required(ErrorMessage = "用户Id不能为空")] public long Id { get; set; } } public class UpdateUserInput : UserInput { /// /// 用户Id /// [Required(ErrorMessage = "用户Id不能为空")] public long Id { get; set; } } public class QueryUserInput : UpdateUserInput { } public class ChangePasswordUserInput { /// /// 用户Id /// [Required(ErrorMessage = "用户Id不能为空")] public long Id { get; set; } /// /// 密码 /// [Required(ErrorMessage = "旧密码不能为空")] public string Password { get; set; } /// /// 新密码 /// [Required(ErrorMessage = "新密码不能为空")] [StringLength(32, MinimumLength = 5, ErrorMessage = "密码需要大于5个字符")] public string NewPassword { get; set; } /// /// 确认密码 /// [Required(ErrorMessage = "确认密码不能为空"), Compare(nameof(NewPassword), ErrorMessage = "两次密码不一致")] public string Confirm { get; set; } } public class UploadAvatarInput { /// /// 用户Id /// [Required(ErrorMessage = "用户Id不能为空")] public long Id { get; set; } /// /// 头像文件路径标识 /// [Required(ErrorMessage = "头像文件路径标识不能为空")] public long Avatar { get; set; } }