namespace HoneyBox.Model.Models.Auth;

/// <summary>
/// Token 刷新结果模型
/// </summary>
public class RefreshTokenResult
{
    /// <summary>
    /// 是否成功
    /// </summary>
    public bool Success { get; set; }

    /// <summary>
    /// 登录响应（刷新成功时返回）
    /// </summary>
    public LoginResponse? LoginResponse { get; set; }

    /// <summary>
    /// 错误信息（刷新失败时返回）
    /// </summary>
    public string? ErrorMessage { get; set; }

    /// <summary>
    /// 创建成功结果
    /// </summary>
    public static RefreshTokenResult Ok(LoginResponse response) => new()
    {
        Success = true,
        LoginResponse = response
    };

    /// <summary>
    /// 创建失败结果
    /// </summary>
    public static RefreshTokenResult Fail(string errorMessage) => new()
    {
        Success = false,
        ErrorMessage = errorMessage
    };
}
