//
namespace SafeCampus.Web.Core;
///
/// 岗位管理控制器
///
[ApiDescriptionSettings("Application", Tag = "岗位管理")]
[Route("biz/organization/position")]
[RolePermission]
public class BizPositionController
{
private readonly IPositionService _positionService;
public BizPositionController(IPositionService positionService)
{
_positionService = positionService;
}
#region Get请求
///
/// 获取职位树
///
///
[HttpGet("tree")]
[DisplayName("获取职位树")]
public async Task Tree([FromQuery] PositionTreeInput input)
{
return await _positionService.Tree(input);
}
///
/// 岗位分页查询
///
///
///
[HttpGet("page")]
[DisplayName("岗位分页查询")]
public async Task Page([FromQuery] PositionPageInput input)
{
return await _positionService.Page(input);
}
///
/// 岗位详情
///
///
///
[HttpGet("detail")]
[DisplayName("岗位详情")]
public async Task Detail([FromQuery] BaseIdInput input)
{
return await _positionService.Detail(input);
}
///
/// 岗位选择器
///
///
///
[HttpGet("selector")]
[DisplayName("岗位选择器")]
public async Task Selector([FromQuery] PositionSelectorInput input)
{
return await _positionService.Selector(input);
}
#endregion
#region Post请求
///
/// 添加岗位
///
///
///
[HttpPost("add")]
[DisplayName("添加岗位")]
public async Task Add([FromBody] PositionAddInput input)
{
await _positionService.Add(input);
}
///
/// 修改岗位
///
///
///
[HttpPost("edit")]
[DisplayName("修改岗位")]
public async Task Edit([FromBody] PositionEditInput input)
{
await _positionService.Edit(input);
}
///
/// 删除岗位
///
///
///
[HttpPost("delete")]
[DisplayName("删除岗位")]
public async Task Delete([FromBody] BaseIdListInput input)
{
await _positionService.Delete(input);
}
#endregion
}