平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

119 lines
2.6 KiB

  1. //
  2. namespace SafeCampus.Web.Core;
  3. /// <summary>
  4. /// 岗位管理控制器
  5. /// </summary>
  6. [ApiDescriptionSettings("Application", Tag = "岗位管理")]
  7. [Route("biz/organization/position")]
  8. [RolePermission]
  9. public class BizPositionController
  10. {
  11. private readonly IPositionService _positionService;
  12. public BizPositionController(IPositionService positionService)
  13. {
  14. _positionService = positionService;
  15. }
  16. #region Get请求
  17. /// <summary>
  18. /// 获取职位树
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet("tree")]
  22. [DisplayName("获取职位树")]
  23. public async Task<dynamic> Tree([FromQuery] PositionTreeInput input)
  24. {
  25. return await _positionService.Tree(input);
  26. }
  27. /// <summary>
  28. /// 岗位分页查询
  29. /// </summary>
  30. /// <param name="input"></param>
  31. /// <returns></returns>
  32. [HttpGet("page")]
  33. [DisplayName("岗位分页查询")]
  34. public async Task<dynamic> Page([FromQuery] PositionPageInput input)
  35. {
  36. return await _positionService.Page(input);
  37. }
  38. /// <summary>
  39. /// 岗位详情
  40. /// </summary>
  41. /// <param name="input"></param>
  42. /// <returns></returns>
  43. [HttpGet("detail")]
  44. [DisplayName("岗位详情")]
  45. public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
  46. {
  47. return await _positionService.Detail(input);
  48. }
  49. /// <summary>
  50. /// 岗位选择器
  51. /// </summary>
  52. /// <param name="input"></param>
  53. /// <returns></returns>
  54. [HttpGet("selector")]
  55. [DisplayName("岗位选择器")]
  56. public async Task<dynamic> Selector([FromQuery] PositionSelectorInput input)
  57. {
  58. return await _positionService.Selector(input);
  59. }
  60. #endregion
  61. #region Post请求
  62. /// <summary>
  63. /// 添加岗位
  64. /// </summary>
  65. /// <param name="input"></param>
  66. /// <returns></returns>
  67. [HttpPost("add")]
  68. [DisplayName("添加岗位")]
  69. public async Task Add([FromBody] PositionAddInput input)
  70. {
  71. await _positionService.Add(input);
  72. }
  73. /// <summary>
  74. /// 修改岗位
  75. /// </summary>
  76. /// <param name="input"></param>
  77. /// <returns></returns>
  78. [HttpPost("edit")]
  79. [DisplayName("修改岗位")]
  80. public async Task Edit([FromBody] PositionEditInput input)
  81. {
  82. await _positionService.Edit(input);
  83. }
  84. /// <summary>
  85. /// 删除岗位
  86. /// </summary>
  87. /// <param name="input"></param>
  88. /// <returns></returns>
  89. [HttpPost("delete")]
  90. [DisplayName("删除岗位")]
  91. public async Task Delete([FromBody] BaseIdListInput input)
  92. {
  93. await _positionService.Delete(input);
  94. }
  95. #endregion
  96. }