//
namespace SafeCampus.Web.Core;
///
/// 组织管理控制器
///
[ApiDescriptionSettings(Tag = "组织管理")]
[Route("sys/organization/[controller]")]
[SuperAdmin]
public class OrgController : BaseController
{
private readonly ISysOrgService _sysOrgService;
private readonly ISysUserService _sysUserService;
public OrgController(ISysOrgService sysOrgService, ISysUserService sysUserService)
{
_sysOrgService = sysOrgService;
_sysUserService = sysUserService;
}
#region Get
///
/// 获取组织树
///
///
[HttpGet("tree")]
public async Task Tree()
{
return await _sysOrgService.Tree();
}
///
/// 获取组织树选择器
///
///
[HttpGet("orgTreeSelector")]
public async Task OrgTreeSelector()
{
return await _sysOrgService.Tree();
}
///
/// 组织分页查询
///
///
///
[HttpGet("page")]
public async Task Page([FromQuery] SysOrgPageInput input)
{
return await _sysOrgService.Page(input);
}
///
/// 获取用户选择器
///
///
[HttpGet("selector")]
public async Task UserSelector([FromQuery] UserSelectorInput input)
{
return await _sysUserService.Selector(input);
}
///
/// 获取组织详情
///
///
///
[HttpGet("detail")]
public async Task Detail([FromQuery] BaseIdInput input)
{
return await _sysOrgService.Detail(input);
}
#endregion Get
#region Post
///
/// 复制组织
///
///
///
[HttpPost("copy")]
[DisplayName("复制组织")]
public async Task Copy([FromBody] SysOrgCopyInput input)
{
await _sysOrgService.Copy(input);
}
///
/// 添加组织
///
///
///
[HttpPost("add")]
[DisplayName("添加组织")]
public async Task Add([FromBody] SysOrgAddInput input)
{
await _sysOrgService.Add(input);
}
///
/// 修改组织
///
///
///
[HttpPost("edit")]
[DisplayName("修改组织")]
public async Task Edit([FromBody] SysOrgEditInput input)
{
await _sysOrgService.Edit(input);
}
///
/// 删除组织
///
///
///
[HttpPost("delete")]
[DisplayName("删除组织")]
public async Task Delete([FromBody] BaseIdListInput input)
{
await _sysOrgService.Delete(input);
}
#endregion Post
}