using System.ComponentModel.DataAnnotations;

namespace HoneyBox.Admin.Models.Auth;

/// <summary>
/// 修改密码请求模型
/// </summary>
public class ChangePasswordRequest
{
    /// <summary>
    /// 旧密码
    /// </summary>
    [Required(ErrorMessage = "旧密码不能为空")]
    public string OldPassword { get; set; } = null!;

    /// <summary>
    /// 新密码
    /// </summary>
    [Required(ErrorMessage = "新密码不能为空")]
    [MinLength(6, ErrorMessage = "新密码长度不能少于6个字符")]
    [MaxLength(50, ErrorMessage = "新密码长度不能超过50个字符")]
    public string NewPassword { get; set; } = null!;

    /// <summary>
    /// 确认新密码
    /// </summary>
    [Required(ErrorMessage = "确认密码不能为空")]
    [Compare("NewPassword", ErrorMessage = "两次输入的密码不一致")]
    public string ConfirmPassword { get; set; } = null!;
}
