DepartmentController.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using System.Threading.Tasks;
  2. using GxPress.Repository.Interface;
  3. using GxPress.Request.Department;
  4. using GxPress.Result.Department;
  5. using Microsoft.AspNetCore.Authorization;
  6. using Microsoft.AspNetCore.Mvc;
  7. namespace GxPress.Api.AppControllers
  8. {
  9. [Route("api/app/department")]
  10. [ApiController]
  11. [Authorize]
  12. public class DepartmentController : ControllerBase
  13. {
  14. private readonly IDepartmentRepository _departmentRepository;
  15. public DepartmentController(IDepartmentRepository departmentRepository)
  16. {
  17. _departmentRepository = departmentRepository;
  18. }
  19. /// <summary>
  20. /// 根据部门ID获取成员以及下级部门
  21. /// </summary>
  22. /// <param name="request"></param>
  23. /// <returns></returns>
  24. [HttpPost("user-list")]
  25. public async Task<DepartmentUserResult> GetDepartmentUserResult(DepartmentUserRequest request)
  26. {
  27. return await _departmentRepository.GetDepartmentUserResultAsync(request);
  28. }
  29. }
  30. }