SysRoleMenuAppService.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application
  3. {
  4. /// <summary>
  5. /// 角色菜单
  6. /// </summary>
  7. [ApiDescriptionSettings(Name = "sys-role-menu")]
  8. [Route("sys/role/menu")]
  9. [AppAuthorize]
  10. public class SysRoleMenuAppService : IDynamicApiController
  11. {
  12. private readonly ISysRoleMenuService _roleMenuService;
  13. public SysRoleMenuAppService(ISysRoleMenuService roleMenuService)
  14. {
  15. _roleMenuService = roleMenuService;
  16. }
  17. /// <summary>
  18. /// 获取角色的菜单Id集合
  19. /// </summary>
  20. /// <param name="roleId"></param>
  21. /// <returns></returns>
  22. [DisableOpLog]
  23. public async Task<List<int>> GetRoleMenuIdList(int roleId)
  24. {
  25. return await _roleMenuService.GetRoleMenuIdList(new List<int> { roleId });
  26. }
  27. /// <summary>
  28. /// 获取角色对象菜单列表
  29. /// </summary>
  30. /// <param name="roleId"></param>
  31. /// <returns></returns>
  32. [DisableOpLog]
  33. public async Task<List<SysRoleMenuOutput>> GetRoleMenuList(int roleId)
  34. {
  35. return await _roleMenuService.GetRoleMenuList(roleId);
  36. }
  37. /// <summary>
  38. /// 授权角色菜单
  39. /// </summary>
  40. /// <param name="input"></param>
  41. /// <returns></returns>
  42. public async Task GrantRoleMenu(GrantSysRoleMenuInput input)
  43. {
  44. await _roleMenuService.GrantRoleMenu(input);
  45. }
  46. }
  47. }