SysRoleUserAppService.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using YBEE.EQM.Core;
  2. namespace YBEE.EQM.Application
  3. {
  4. /// <summary>
  5. /// 角色用户
  6. /// </summary>
  7. [ApiDescriptionSettings(Name = "sys-role-user")]
  8. [Route("sys/role/user")]
  9. [AppAuthorize]
  10. public class SysRoleUserAppService : IDynamicApiController
  11. {
  12. private readonly ISysRoleUserService _roleUserService;
  13. public SysRoleUserAppService(ISysRoleUserService roleUserService)
  14. {
  15. _roleUserService = roleUserService;
  16. }
  17. /// <summary>
  18. /// 添加用户到角色
  19. /// </summary>
  20. /// <param name="input"></param>
  21. /// <returns></returns>
  22. public async Task AddRoleUser(SysRoleUserInput input)
  23. {
  24. await _roleUserService.AddRoleUser(input);
  25. }
  26. /// <summary>
  27. /// 移出角色中的用户
  28. /// </summary>
  29. /// <param name="input"></param>
  30. /// <returns></returns>
  31. public async Task RemoveRoleUser(SysRoleUserInput input)
  32. {
  33. await _roleUserService.RemoveRoleUser(input);
  34. }
  35. /// <summary>
  36. /// 获取指定角色中的用户列表
  37. /// </summary>
  38. /// <param name="roleId"></param>
  39. /// <returns></returns>
  40. [DisableOpLog]
  41. public async Task<List<SysUserOutput>> GetInRoleUserList([Required] int roleId)
  42. {
  43. return await _roleUserService.GetInRoleUserList(roleId);
  44. }
  45. /// <summary>
  46. /// 分页查询角色用户列表
  47. /// </summary>
  48. /// <param name="input"></param>
  49. /// <returns></returns>
  50. [DisableOpLog]
  51. public async Task<PageResult<SysUserOutput>> QueryInRoleUserPageList(SysRoleUserPageInput input)
  52. {
  53. return await _roleUserService.QueryInRoleUserPageList(input);
  54. }
  55. /// <summary>
  56. /// 获取未在指定角色中的用户列表
  57. /// </summary>
  58. /// <param name="roleId"></param>
  59. /// <returns></returns>
  60. [DisableOpLog]
  61. public async Task<List<SysUserOutput>> GetNotInRoleUserList([Required] int roleId)
  62. {
  63. return await _roleUserService.GetNotInRoleUserList(roleId);
  64. }
  65. /// <summary>
  66. /// 通过权限标识获取人员列表
  67. /// </summary>
  68. /// <param name="permission">权限标识</param>
  69. /// <returns></returns>
  70. [DisableOpLog]
  71. public async Task<List<SysUserLiteOutput>> GetUserListByPermission([Required] string permission)
  72. {
  73. return await _roleUserService.GetUserListByPermission(permission);
  74. }
  75. }
  76. }