平安校园
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.

BizPositionController.cs 2.6 KiB

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