using DS.Module.Core.Extensions;
using FluentValidation;
namespace DS.WMS.Core.System.Dtos;
///
/// 用户编辑实体
///
public class UserInput
{
///
///
///
public string Id { get; set; }
///
///
/// 登陆账号
///
public string UserCode { get; set; }
///
/// 密码
///
public string Password { get; set; }
///
///姓名
///
public string UserName { get; set; }
///
/// 性别 1-男 2-女 3 -未知
///
public int Sex { get; set; } = 1;
///
///
///
public string NickName { get; set; } = "";
///
///
///
public string Avatar { get; set; } = "";
///
///
///
public DateTime? Birthday { get; set; } = DateTime.MinValue;
///
/// 电话
///
public string Phone { get; set; } = "";
///
/// 邮箱
///
public string Email { get; set; } = "";
///
/// 职位
///
public string Duty { get; set; } = "";
///
/// 用户类型 1-管理员 2-普通用户
///
public int UserType { get; set; } = 1;
///
/// 权限身份 0: 无; 1:客户端; 2:市平台:3:省平台
///
public int PermissionIdentity { get; set; }
///
/// 备注
///
public string Note { get; set; } = "";
///
/// 用戶角色
///
public string[] RoleIds { get; set; }
}
///
/// 验证
///
public class UserInputValidator : AbstractValidator
{
///
/// 构造函数
///
public UserInputValidator()
{
this.RuleFor(o => o.UserCode)
.NotEmpty().WithName("登录账号");
this.RuleFor(o => o.UserName)
.NotEmpty().WithName("用户名称");
this.RuleFor(o => o.Password)
.NotEmpty().WithName("密码");
}
}