平安校园
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PositionController.cs 2.6 KiB

4 달 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. 
  2. //
  3. namespace SafeCampus.Web.Core;
  4. /// <summary>
  5. /// 职位管理控制器
  6. /// </summary>
  7. [ApiDescriptionSettings(Tag = "职位管理")]
  8. [Route("sys/organization/[controller]")]
  9. [SuperAdmin]
  10. public class PositionController : BaseController
  11. {
  12. private readonly ISysPositionService _sysPositionService;
  13. public PositionController(ISysPositionService sysPositionService)
  14. {
  15. _sysPositionService = sysPositionService;
  16. }
  17. #region Get
  18. /// <summary>
  19. /// 职位分页查询
  20. /// </summary>
  21. /// <param name="input"></param>
  22. /// <returns></returns>
  23. [HttpGet("page")]
  24. [DisplayName("职位分页查询")]
  25. public async Task<dynamic> Page([FromQuery] PositionPageInput input)
  26. {
  27. return await _sysPositionService.Page(input);
  28. }
  29. /// <summary>
  30. /// 获取职位树
  31. /// </summary>
  32. /// <returns></returns>
  33. [HttpGet("tree")]
  34. [DisplayName("获取职位树")]
  35. public async Task<dynamic> Tree([FromQuery] PositionTreeInput input)
  36. {
  37. return await _sysPositionService.Tree(input);
  38. }
  39. /// <summary>
  40. /// 职位选择器
  41. /// </summary>
  42. /// <param name="input"></param>
  43. /// <returns></returns>
  44. [HttpGet("selector")]
  45. public async Task<dynamic> Selector([FromQuery] PositionSelectorInput input)
  46. {
  47. return await _sysPositionService.Selector(input);
  48. }
  49. /// <summary>
  50. /// 获取职位详情
  51. /// </summary>
  52. /// <param name="input"></param>
  53. /// <returns></returns>
  54. [HttpGet("detail")]
  55. [DisplayName("获取职位详情")]
  56. public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
  57. {
  58. return await _sysPositionService.Detail(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 _sysPositionService.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 _sysPositionService.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 _sysPositionService.Delete(input);
  94. }
  95. #endregion
  96. }