using System.ComponentModel.DataAnnotations;

namespace FutureMailAPI.DTOs
{
    public class OAuthLoginRequestDto
    {
        [Required(ErrorMessage = "客户端ID是必填项")]
        public string ClientId { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "客户端密钥是必填项")]
        public string ClientSecret { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "用户名或邮箱是必填项")]
        public string Username { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "密码是必填项")]
        public string Password { get; set; } = string.Empty;
        
        public string? Scope { get; set; }
    }
    
    public class OAuthTokenResponseDto
    {
        public string AccessToken { get; set; } = string.Empty;
        public string RefreshToken { get; set; } = string.Empty;
        public string TokenType { get; set; } = "Bearer";
        public int ExpiresIn { get; set; }
        public string? Scope { get; set; }
        public UserResponseDto User { get; set; } = new();
    }
    
    public class OAuthRefreshTokenRequestDto
    {
        [Required(ErrorMessage = "刷新令牌是必填项")]
        public string RefreshToken { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "客户端ID是必填项")]
        public string ClientId { get; set; } = string.Empty;
        
        [Required(ErrorMessage = "客户端密钥是必填项")]
        public string ClientSecret { get; set; } = string.Empty;
    }
}