using System.ComponentModel.DataAnnotations;

namespace FutureMailAPI.DTOs
{
    public class UserRegisterDto
    {
        [Required(ErrorMessage = "用户名是必填项")]
        [StringLength(100, MinimumLength = 3, ErrorMessage = "用户名长度必须在3-100个字符之间")]
        public string Username { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "邮箱是必填项")]
        [EmailAddress(ErrorMessage = "请输入有效的邮箱地址")]
        public string Email { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "密码是必填项")]
        [StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度必须在6-100个字符之间")]
        public string Password { get; set; } = string.Empty;
        
        [StringLength(100, ErrorMessage = "昵称长度不能超过100个字符")]
        public string? Nickname { get; set; }
    }
    
    public class UserResponseDto
    {
        public int Id { get; set; }
        public string Username { get; set; } = string.Empty;
        public string Email { get; set; } = string.Empty;
        public string? Nickname { get; set; }
        public string? Avatar { get; set; }
        public DateTime CreatedAt { get; set; }
        public DateTime? LastLoginAt { get; set; }
    }
    
    public class UserUpdateDto
    {
        [StringLength(100, ErrorMessage = "昵称长度不能超过100个字符")]
        public string? Nickname { get; set; }
        
        [StringLength(500, ErrorMessage = "头像URL长度不能超过500个字符")]
        public string? Avatar { get; set; }
    }
    
    public class ChangePasswordDto
    {
        [Required(ErrorMessage = "当前密码是必填项")]
        public string CurrentPassword { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "新密码是必填项")]
        [StringLength(100, MinimumLength = 6, ErrorMessage = "密码长度必须在6-100个字符之间")]
        public string NewPassword { get; set; } = string.Empty;
    }
    

}