平安校园
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

ISysRoleService.cs 3.7 KiB

hace 4 meses
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. 
  2. //
  3. namespace SafeCampus.System;
  4. /// <summary>
  5. /// 角色服务
  6. /// </summary>
  7. public interface ISysRoleService : ITransient
  8. {
  9. #region 查询
  10. /// <summary>
  11. /// 获取所有角色
  12. /// </summary>
  13. /// <returns></returns>
  14. Task<List<SysRole>> GetListAsync();
  15. /// <summary>
  16. /// 根据用户ID获取用户角色集合
  17. /// </summary>
  18. /// <param name="userId">用户ID</param>
  19. /// <returns></returns>
  20. Task<List<SysRole>> GetRoleListByUserId(long userId);
  21. /// <summary>
  22. /// 获取角色拥有权限
  23. /// </summary>
  24. /// <param name="input">角色ID</param>
  25. /// <returns></returns>
  26. Task<RoleOwnPermissionOutput> OwnPermission(BaseIdInput input);
  27. /// <summary>
  28. /// 角色拥有资源
  29. /// </summary>
  30. /// <param name="input">角色id</param>
  31. /// <param name="category">资源类型</param>
  32. /// <returns>角色拥有资源信息</returns>
  33. Task<RoleOwnResourceOutput> OwnResource(BaseIdInput input, string category);
  34. /// <summary>
  35. /// 获取角色下的用户
  36. /// </summary>
  37. /// <param name="input">角色ID</param>
  38. /// <returns></returns>
  39. Task<List<UserSelectorOutPut>> OwnUser(BaseIdInput input);
  40. /// <summary>
  41. /// 分页查询角色
  42. /// </summary>
  43. /// <param name="input">查询参数</param>
  44. /// <returns></returns>
  45. Task<SqlSugarPagedList<SysRole>> Page(RolePageInput input);
  46. /// <summary>
  47. /// 获取角色授权权限选择器
  48. /// </summary>
  49. /// <param name="input">角色ID</param>
  50. /// <returns></returns>
  51. Task<List<string>> RolePermissionTreeSelector(BaseIdInput input);
  52. /// <summary>
  53. /// 角色选择器
  54. /// </summary>
  55. /// <param name="input"></param>
  56. /// <returns></returns>
  57. Task<SqlSugarPagedList<RoleSelectorOutPut>> RoleSelector(RoleSelectorInput input);
  58. /// <summary>
  59. /// 根据id集合获取角色集合
  60. /// </summary>
  61. /// <param name="input"></param>
  62. /// <returns></returns>
  63. Task<List<SysRole>> GetRoleListByIdList(IdListInput input);
  64. /// <summary>
  65. /// 获取角色树
  66. /// </summary>
  67. /// <param name="input">角色树</param>
  68. /// <returns></returns>
  69. Task<List<RoleTreeOutput>> Tree(RoleTreeInput input);
  70. /// <summary>
  71. /// 角色详情
  72. /// </summary>
  73. /// <param name="input">角色Id</param>
  74. /// <returns></returns>
  75. Task<SysRole> Detail(BaseIdInput input);
  76. #endregion
  77. #region 新增
  78. /// <summary>
  79. /// 添加角色
  80. /// </summary>
  81. /// <param name="input">添加参数</param>
  82. /// <returns></returns>
  83. Task Add(RoleAddInput input);
  84. #endregion
  85. #region 编辑
  86. /// <summary>
  87. /// 编辑角色
  88. /// </summary>
  89. /// <param name="input">编辑参数</param>
  90. /// <returns></returns>
  91. Task Edit(RoleEditInput input);
  92. /// <summary>
  93. /// 给角色授权权限
  94. /// </summary>
  95. /// <param name="input">授权信息</param>
  96. /// <returns></returns>
  97. Task GrantPermission(GrantPermissionInput input);
  98. /// <summary>
  99. /// 给角色授权
  100. /// </summary>
  101. /// <param name="input">授权参数</param>
  102. /// <returns></returns>
  103. Task GrantResource(GrantResourceInput input);
  104. /// <summary>
  105. /// 给角色授权用户
  106. /// </summary>
  107. /// <param name="input">授权信息</param>
  108. /// <returns></returns>
  109. Task GrantUser(GrantUserInput input);
  110. #endregion
  111. #region 删除
  112. /// <summary>
  113. /// 刷新缓存
  114. /// </summary>
  115. /// <returns></returns>
  116. Task RefreshCache();
  117. /// <summary>
  118. /// 删除角色
  119. /// </summary>
  120. /// <param name="input">删除参数</param>
  121. /// <returns></returns>
  122. Task Delete(BaseIdListInput input);
  123. #endregion
  124. }