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

118 lines
2.6 KiB

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