//
namespace SafeCampus.Web.Core;
///
/// 批量控制器
///
[ApiDescriptionSettings(Tag = "批量修改")]
[Route("/sys/batch")]
public class BatchEditController : BaseController
{
private readonly IBatchEditService _batchEditService;
public BatchEditController(IBatchEditService updateBatchService)
{
_batchEditService = updateBatchService;
}
#region Get请求
///
/// 批量分页查询
///
///
///
[HttpGet("page")]
public async Task Page([FromQuery] BatchEditPageInput input)
{
return await _batchEditService.Page(input);
}
///
/// 获取表信息
///
///
[HttpGet("tables")]
public dynamic Tables()
{
return _batchEditService.GetTables();
}
///
/// 获取批量配置信息
///
///
[HttpGet("configs")]
public async Task ConfigList([FromQuery] BaseIdInput input)
{
return await _batchEditService.ConfigList(input);
}
///
/// 获取批量配置信息
///
///
[HttpGet("columns")]
[IgnoreSuperAdmin]
public async Task Columns([FromQuery] string code)
{
return await _batchEditService.Columns(code);
}
#endregion Get请求
#region Post请求
///
/// 添加批量
///
///
///
[HttpPost("add")]
[DisplayName("添加批量更新")]
public async Task Add([FromBody] BatchEditAddInput input)
{
await _batchEditService.Add(input);
}
///
/// 配置修改批量
///
///
///
[HttpPost("config")]
[DisplayName("配置批量更新")]
public async Task Config([FromBody] List input)
{
await _batchEditService.Config(input);
}
///
/// 删除批量
///
///
///
[HttpPost("delete")]
[DisplayName("删除批量更新")]
public async Task Delete([FromBody] BaseIdListInput input)
{
await _batchEditService.Delete(input);
}
///
/// 批量更新同步
///
///
///
[HttpPost("sync")]
[DisplayName("批量更新同步")]
public async Task Sync([FromBody] BaseIdInput input)
{
await _batchEditService.SyncColumns(input);
}
#endregion Post请求
}