namespace SafeCampus.Web.Core;
///
/// 机构管理控制器
///
[ApiDescriptionSettings("Application", Tag = "机构管理")]
[Route("biz/organization/org")]
[RolePermission]
public class BizOrgController : IDynamicApiController
{
private readonly IOrgService _orgService;
private readonly IUserService _userService;
public BizOrgController(IOrgService orgService, IUserService userService)
{
_orgService = orgService;
_userService = userService;
}
#region Get请求
///
/// 获取机构树
///
///
[HttpGet("tree")]
[DisplayName("机构树查询")]
public async Task Tree()
{
return await _orgService.Tree();
}
///
/// 机构分页查询
///
///
///
[HttpGet("page")]
[DisplayName("机构分页查询")]
public async Task Page([FromQuery] SysOrgPageInput input)
{
return await _orgService.Page(input);
}
///
/// 获取机构树选择器
///
///
[HttpGet("orgTreeSelector")]
[DisplayName("机构树选择器")]
public async Task OrgTreeSelector()
{
return await _orgService.Tree();
}
///
/// 获取人员选择器
///
///
[HttpGet("userSelector")]
[DisplayName("人员选择器")]
public async Task UserSelector([FromQuery] UserSelectorInput input)
{
return await _userService.Selector(input);
}
///
/// 机构详情
///
///
///
[HttpGet("detail")]
[DisplayName("机构详情")]
public async Task Detail([FromQuery] BaseIdInput input)
{
return await _orgService.Detail(input);
}
#endregion
#region Post请求
///
/// 添加机构
///
///
///
[HttpPost("add")]
[DisplayName("添加机构")]
public async Task Add([FromBody] SysOrgAddInput input)
{
await _orgService.Add(input);
}
///
/// 修改机构
///
///
///
[HttpPost("edit")]
[DisplayName("修改机构")]
public async Task Edit([FromBody] SysOrgEditInput input)
{
await _orgService.Edit(input);
}
///
/// 复制组织
///
///
///
[HttpPost("copy")]
[DisplayName("复制组织")]
public async Task Copy(SysOrgCopyInput input)
{
await _orgService.Copy(input);
}
///
/// 删除机构
///
///
///
[HttpPost("delete")]
[DisplayName("删除机构")]
public async Task Delete([FromBody] BaseIdListInput input)
{
await _orgService.Delete(input);
}
#endregion
}