平安校园
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

160 行
3.7 KiB

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