using QYZH.InteractiveMagazine.Models.Dto;
using QYZH.InteractiveMagazine.Models.Entity;

namespace QYZH.InteractiveMagazine.IService;

/// <summary>
/// 后台权限管理服务接口
/// </summary>
public interface IAdminPermissionService : IBaseService<AdminRole>
{
    /// <summary>
    /// 创建菜单
    /// </summary>
    Task<AdminMenuOutput> CreateMenuAsync(AdminMenuInput input);

    /// <summary>
    /// 更新菜单
    /// </summary>
    Task<AdminMenuOutput> UpdateMenuAsync(long id, AdminMenuInput input);

    /// <summary>
    /// 删除菜单
    /// </summary>
    Task DeleteMenuAsync(long id);

    /// <summary>
    /// 获取菜单树
    /// </summary>
    Task<List<AdminMenuOutput>> GetMenuTreeAsync(AdminMenuQueryInput input);

    /// <summary>
    /// 创建角色
    /// </summary>
    Task<AdminRoleOutput> CreateRoleAsync(AdminRoleInput input);

    /// <summary>
    /// 更新角色
    /// </summary>
    Task<AdminRoleOutput> UpdateRoleAsync(long id, AdminRoleInput input);

    /// <summary>
    /// 删除角色
    /// </summary>
    Task DeleteRoleAsync(long id);

    /// <summary>
    /// 获取角色详情
    /// </summary>
    Task<AdminRoleOutput> GetRoleByIdAsync(long id);

    /// <summary>
    /// 获取角色分页列表
    /// </summary>
    Task<PageListModel<AdminRoleOutput>> GetRoleListAsync(AdminRoleQueryInput input);

    /// <summary>
    /// 分配角色菜单
    /// </summary>
    Task AssignRoleMenusAsync(long roleId, AssignRoleMenusInput input);

    /// <summary>
    /// 分配管理员角色
    /// </summary>
    Task AssignAdminUserRolesAsync(long adminUserId, AssignAdminUserRolesInput input);

    /// <summary>
    /// 获取管理员菜单树
    /// </summary>
    Task<List<AdminMenuOutput>> GetAdminUserMenuTreeAsync(long adminUserId);

    /// <summary>
    /// 获取管理员角色
    /// </summary>
    Task<List<AdminRoleSimpleOutput>> GetAdminUserRolesAsync(long adminUserId);

    /// <summary>
    /// 获取管理员权限编码
    /// </summary>
    Task<List<string>> GetAdminUserPermissionCodesAsync(long adminUserId);
}
