You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
using System.ComponentModel.DataAnnotations ;
using FluentValidation ;
namespace DS.WMS.Core.Sys.Dtos ;
/// <summary>
/// 修改密码实体
/// </summary>
public class ChangePasswordReq
{
// /// <summary>
// /// 用户Id
// /// </summary>
// public string UserId { get; set; }
/// <summary>
/// 旧密码
/// </summary>
public string OldPassword { get ; set ; }
/// <summary>
/// 新密码
/// </summary>
[RegularExpression(pattern:@"^(?=.*[A-Z] ) ( ? = . * [ a - z ] ) ( ? = . * \ d ) ( ? = . * [ ^ \ da - zA - Z ] ) . { 8 , } $",ErrorMessage =" 密 码 至 少 要 包 含 8 个 字 符 , 同 时 包 含 至 少 一 个 大 写 字 母 、 一 个 小 写 字 母 、 一 个 数 字 和 一 个 特 殊 字 符 ")]
public string NewPassword { get ; set ; }
/// <summary>
/// 确认密码
/// </summary>
public string ConfirmPassword { get ; set ; }
}
/// <summary>
/// 验证
/// </summary>
public class ChangePasswordInputValidator : AbstractValidator < ChangePasswordReq >
{
/// <summary>
/// 构造函数
/// </summary>
public ChangePasswordInputValidator ( )
{
// this.RuleFor(o => o.UserId)
// .NotEmpty().WithName("用户Id");
this . RuleFor ( o = > o . OldPassword )
. NotEmpty ( ) . WithName ( "旧密码" ) ;
this . RuleFor ( o = > o . NewPassword )
. NotEmpty ( ) . WithName ( "新密码" ) ;
this . RuleFor ( o = > o . ConfirmPassword )
. NotEmpty ( ) . WithName ( "确认密码" ) ;
}
}