|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
-
- //
-
-
-
-
-
-
-
-
- namespace SafeCampus.Web.Core;
-
- /// <summary>
- /// 职位管理控制器
- /// </summary>
- [ApiDescriptionSettings(Tag = "职位管理")]
- [Route("sys/organization/[controller]")]
- [SuperAdmin]
- public class PositionController : BaseController
- {
- private readonly ISysPositionService _sysPositionService;
-
- public PositionController(ISysPositionService sysPositionService)
- {
- _sysPositionService = sysPositionService;
- }
-
- #region Get
-
- /// <summary>
- /// 职位分页查询
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpGet("page")]
- [DisplayName("职位分页查询")]
- public async Task<dynamic> Page([FromQuery] PositionPageInput input)
- {
- return await _sysPositionService.Page(input);
- }
-
- /// <summary>
- /// 获取职位树
- /// </summary>
- /// <returns></returns>
- [HttpGet("tree")]
- [DisplayName("获取职位树")]
- public async Task<dynamic> Tree([FromQuery] PositionTreeInput input)
- {
- return await _sysPositionService.Tree(input);
- }
-
- /// <summary>
- /// 职位选择器
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpGet("selector")]
- public async Task<dynamic> Selector([FromQuery] PositionSelectorInput input)
- {
- return await _sysPositionService.Selector(input);
- }
-
- /// <summary>
- /// 获取职位详情
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpGet("detail")]
- [DisplayName("获取职位详情")]
- public async Task<dynamic> Detail([FromQuery] BaseIdInput input)
- {
- return await _sysPositionService.Detail(input);
- }
-
- #endregion
-
- #region Post
-
- /// <summary>
- /// 添加职位
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpPost("add")]
- [DisplayName("添加职位")]
- public async Task Add([FromBody] PositionAddInput input)
- {
- await _sysPositionService.Add(input);
- }
-
- /// <summary>
- /// 修改职位
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpPost("edit")]
- [DisplayName("修改职位")]
- public async Task Edit([FromBody] PositionEditInput input)
- {
- await _sysPositionService.Edit(input);
- }
-
- /// <summary>
- /// 删除职位
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpPost("delete")]
- [DisplayName("删除职位")]
- public async Task Delete([FromBody] BaseIdListInput input)
- {
- await _sysPositionService.Delete(input);
- }
-
- #endregion
- }
|