You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
187 lines
6.1 KiB
C#
187 lines
6.1 KiB
C#
1 year ago
|
|
||
|
|
||
|
//----------SysRole开始----------
|
||
|
|
||
|
|
||
|
using Admin.Core.Model;
|
||
|
using Admin.Core.Model.Sys;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace Admin.Core.IService.ISys
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 角色信息表IService
|
||
|
/// </summary>
|
||
|
public interface ISysRoleService : IBaseServices<SysRole>
|
||
|
{
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取权限Perms
|
||
|
/// </summary>
|
||
|
/// <param name="roles"></param>
|
||
|
/// <returns></returns>
|
||
|
Task<List<string>> GetUserPermsStr(List<int> roleIDs);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取所有角色信息
|
||
|
/// </summary>
|
||
|
/// <param name="userId"></param>
|
||
|
/// <returns></returns>
|
||
|
Task<List<SysRole>> GetUserRolesByUserId(int userId);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 根据条件分页查询角色数据
|
||
|
/// </summary>
|
||
|
/// <param name="role"> 角色信息 </param>
|
||
|
/// <returns> 角色数据集合信息 </returns>
|
||
|
Task<PageModel<SysRole>> SelectRoleList(PageQuery<RoleQuery> pageQuery);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 根据编号获取详细信息
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"></param>
|
||
|
/// <returns></returns>
|
||
|
Task<RoleView> GetInfo(int roleId);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 查询所有角色
|
||
|
/// </summary>
|
||
|
/// <returns> 角色列表 </returns>
|
||
|
Task<List<SysRole>> SelectRoleAll();
|
||
|
|
||
|
/// <summary>
|
||
|
/// 根据用户ID获取角色选择框列表
|
||
|
/// </summary>
|
||
|
/// <param name="userId"> 用户ID </param>
|
||
|
/// <returns> 选中角色ID列表 </returns>
|
||
|
Task<List<int>> SelectRoleListByUserId(int userId);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 通过角色ID查询角色
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"> 角色ID </param>
|
||
|
/// <returns> 角色对象信息 </returns>
|
||
|
Task<SysRole> SelectRoleById(int roleId);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 校验角色名称是否存在
|
||
|
/// </summary>
|
||
|
/// <param name="roleName"> 角色名称 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> CheckRoleNameUnique(string roleName);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 校验角色key是否存在
|
||
|
/// </summary>
|
||
|
/// <param name="roleKey"> 角色Key </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> CheckRoleKeyUnique(string roleKey);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 通过角色ID查询角色使用数量
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"> 角色ID </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<int> CountUserRoleByRoleId(int roleId);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 新增保存角色信息
|
||
|
/// </summary>
|
||
|
/// <param name="role"> 角色信息 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<int> InsertRole(RoleView role);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 修改保存角色信息
|
||
|
/// </summary>
|
||
|
/// <param name="role"> 角色信息 </param>
|
||
|
/// <param name="updateBy"> 修改者 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> UpdateRole(RoleView role, string updateBy = "");
|
||
|
|
||
|
/// <summary>
|
||
|
/// 修改角色状态
|
||
|
/// </summary>
|
||
|
/// <param name="role"> 角色信息 </param>
|
||
|
/// <param name="updateBy"> 修改者 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> UpdateRoleStatus(SysRole role, string updateBy = "");
|
||
|
|
||
|
/// <summary>
|
||
|
/// 修改角色基础信息
|
||
|
/// </summary>
|
||
|
/// <param name="role"> 角色信息 </param>
|
||
|
/// <param name="updateBy"> 修改者 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> UpdateRoleBase(SysRole role, string updateBy = "");
|
||
|
|
||
|
/// <summary>
|
||
|
/// 修改数据权限信息
|
||
|
/// </summary>
|
||
|
/// <param name="role"> 角色信息 </param>
|
||
|
/// <param name="updateBy"> 修改者 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> AuthDataScope(RoleView role, string updateBy = "");
|
||
|
|
||
|
/// <summary>
|
||
|
/// 新增角色菜单信息
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"></param>
|
||
|
/// <param name="menuIds"></param>
|
||
|
/// <returns></returns>
|
||
|
Task<bool> InsertRoleMenu(int roleId, int?[] menuIds);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 新增角色部门信息(数据权限)
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"></param>
|
||
|
/// <param name="deptIds"></param>
|
||
|
/// <param name="role"> 角色对象 </param>
|
||
|
Task<bool> InsertRoleDept(int roleId, int?[] deptIds);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 通过角色ID删除角色
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"> 角色ID </param>
|
||
|
/// <param name="updateBy"> 修改者 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> DeleteRoleById(int roleId, string updateBy = "");
|
||
|
|
||
|
/// <summary>
|
||
|
/// 批量删除角色信息
|
||
|
/// </summary>
|
||
|
/// <param name="roleIds"> 需要删除的角色ID </param>
|
||
|
/// <param name="updateBy"> 修改者 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> DeleteRoleByIds(int[] roleIds, string updateBy = "");
|
||
|
|
||
|
/// <summary>
|
||
|
/// 取消授权用户角色
|
||
|
/// </summary>
|
||
|
/// <param name="userRole"> 用户和角色关联信息 </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> DeleteAuthUser(SysUserRole userRole);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 批量取消授权用户角色
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"> 角色ID </param>
|
||
|
/// <param name="userIds"> 需要取消授权的用户数据ID </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> DeleteAuthUsers(int roleId, int[] userIds);
|
||
|
|
||
|
/// <summary>
|
||
|
/// 批量选择授权用户角色
|
||
|
/// </summary>
|
||
|
/// <param name="roleId"> 角色ID </param>
|
||
|
/// <param name="userIds"> 需要新增的用户数据ID </param>
|
||
|
/// <returns> 结果 </returns>
|
||
|
Task<bool> InsertAuthUsers(int roleId, int[] userIds);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
//----------SysRole结束----------
|
||
|
|