//
namespace SafeCampus.Web.Core;
///
/// 系统字典控制器
///
[ApiDescriptionSettings(Tag = "系统字典")]
[Route("sys/ops/[controller]")]
[SuperAdmin]
public class DictController : BaseController
{
private readonly IDictService _dictService;
public DictController(IDictService dictService)
{
_dictService = dictService;
}
///
/// 获取字典树
///
///
[HttpGet("tree")]
[IgnoreSuperAdmin]
public async Task Tree([FromQuery] DictTreeInput input)
{
return await _dictService.Tree(input);
}
///
/// 字典分页查询
///
///
///
[HttpGet("page")]
public async Task Page([FromQuery] DictPageInput input)
{
return await _dictService.Page(input);
}
///
/// 添加字典
///
///
///
[HttpPost("add")]
[DisplayName("添加字典")]
public async Task Add([FromBody] DictAddInput input)
{
await _dictService.Add(input);
}
///
/// 修改字典
///
///
///
[HttpPost("edit")]
[DisplayName("修改字典")]
public async Task Edit([FromBody] DictEditInput input)
{
await _dictService.Edit(input);
}
///
/// 删除字典
///
///
///
[HttpPost("delete")]
[DisplayName("删除字典")]
public async Task Delete([FromBody] DictDeleteInput input)
{
await _dictService.Delete(input);
}
}