DepartmentController.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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. using GxPress.Service.Interface.Department;
  8. namespace GxPress.Api.AppControllers
  9. {
  10. [Route("api/app/department")]
  11. [ApiController]
  12. [Authorize]
  13. public class DepartmentController : ControllerBase
  14. {
  15. private readonly IDepartmentRepository _departmentRepository;
  16. private readonly IDepartmentService departmentService;
  17. public DepartmentController(IDepartmentRepository departmentRepository, IDepartmentService departmentService)
  18. {
  19. _departmentRepository = departmentRepository;
  20. this.departmentService = departmentService;
  21. }
  22. /// <summary>
  23. /// 根据部门ID获取成员以及下级部门
  24. /// </summary>
  25. /// <param name="request"></param>
  26. /// <returns></returns>
  27. [HttpPost("user-list")]
  28. public async Task<DepartmentUserResult> GetDepartmentUserResult(DepartmentUserRequest request)
  29. {
  30. return await departmentService.GetDepartmentUserResultAsync(request);
  31. }
  32. }
  33. }