using HoneyBox.Admin.Models.Auth;

namespace HoneyBox.Admin.Services;

/// <summary>
/// 认证服务接口
/// </summary>
public interface IAuthService
{
    /// <summary>
    /// 管理员登录
    /// </summary>
    /// <param name="request">登录请求</param>
    /// <param name="ipAddress">客户端IP地址</param>
    /// <returns>登录响应</returns>
    Task<LoginResponse> LoginAsync(LoginRequest request, string ipAddress);

    /// <summary>
    /// 退出登录
    /// </summary>
    /// <param name="adminUserId">管理员ID</param>
    Task LogoutAsync(long adminUserId);

    /// <summary>
    /// 获取当前用户信息
    /// </summary>
    /// <param name="adminUserId">管理员ID</param>
    /// <returns>用户信息</returns>
    Task<AdminUserInfo> GetCurrentUserInfoAsync(long adminUserId);

    /// <summary>
    /// 修改密码
    /// </summary>
    /// <param name="adminUserId">管理员ID</param>
    /// <param name="request">修改密码请求</param>
    Task ChangePasswordAsync(long adminUserId, ChangePasswordRequest request);

    /// <summary>
    /// 刷新Token
    /// </summary>
    /// <param name="refreshToken">Refresh Token</param>
    /// <param name="ipAddress">客户端IP地址</param>
    /// <returns>新的Token响应</returns>
    Task<RefreshTokenResponse> RefreshTokenAsync(string refreshToken, string ipAddress);

    /// <summary>
    /// 撤销RefreshToken（登出时使用）
    /// </summary>
    /// <param name="refreshToken">Refresh Token</param>
    /// <param name="ipAddress">客户端IP地址</param>
    Task RevokeTokenAsync(string refreshToken, string ipAddress);

    /// <summary>
    /// 撤销用户所有RefreshToken（强制下线所有设备）
    /// </summary>
    /// <param name="adminUserId">管理员ID</param>
    /// <param name="ipAddress">客户端IP地址</param>
    Task RevokeAllTokensAsync(long adminUserId, string ipAddress);
}
