using TakeoutSaaS.Application.Identity.Contracts;
using TakeoutSaaS.Shared.Abstractions.Results;

namespace TakeoutSaaS.Application.Identity.Abstractions;

/// <summary>
/// 管理后台认证服务。
/// </summary>
public interface IAdminAuthService
{
    /// <summary>
    /// 登录获取 Token。
    /// </summary>
    Task<TokenResponse> LoginAsync(AdminLoginRequest request, CancellationToken cancellationToken = default);

    /// <summary>
    /// 刷新 Token。
    /// </summary>
    Task<TokenResponse> RefreshTokenAsync(RefreshTokenRequest request, CancellationToken cancellationToken = default);

    /// <summary>
    /// 获取用户档案。
    /// </summary>
    Task<CurrentUserProfile> GetProfileAsync(long userId, CancellationToken cancellationToken = default);

    /// <summary>
    /// 获取用户权限概览。
    /// </summary>
    Task<UserPermissionDto?> GetUserPermissionsAsync(long userId, CancellationToken cancellationToken = default);

    /// <summary>
    /// 搜索用户权限概览列表。
    /// </summary>
    Task<PagedResult<UserPermissionDto>> SearchUserPermissionsAsync(string? keyword, int page, int pageSize, string? sortBy, bool sortDescending, CancellationToken cancellationToken = default);

    /// <summary>
    /// 获取当前用户可见菜单树。
    /// </summary>
    Task<IReadOnlyList<MenuNodeDto>> GetMenuTreeAsync(long userId, CancellationToken cancellationToken = default);
}
