using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; using ZhonTai.Common.Domain.Dto; using ZhonTai.Plate.Admin.Domain.Dictionary; using ZhonTai.Plate.Admin.Service.Dictionary; using ZhonTai.Plate.Admin.Service.Dictionary.Input; namespace ZhonTai.Plate.Admin.HttpApi { /// /// 数据字典 /// public class DictionaryController : AreaController { private readonly IDictionaryService _dictionaryService; public DictionaryController(IDictionaryService dictionaryService) { _dictionaryService = dictionaryService; } /// /// 查询单条数据字典 /// /// /// [HttpGet] public async Task Get(long id) { return await _dictionaryService.GetAsync(id); } /// /// 查询分页数据字典 /// /// /// [HttpPost] public async Task GetPage(PageInput model) { return await _dictionaryService.GetPageAsync(model); } /// /// 新增数据字典 /// /// /// [HttpPost] public async Task Add(DictionaryAddInput input) { return await _dictionaryService.AddAsync(input); } /// /// 修改数据字典 /// /// /// [HttpPut] public async Task Update(DictionaryUpdateInput input) { return await _dictionaryService.UpdateAsync(input); } /// /// 删除数据字典 /// /// /// [HttpDelete] public async Task SoftDelete(long id) { return await _dictionaryService.SoftDeleteAsync(id); } /// /// 批量删除数据字典 /// /// /// [HttpPut] public async Task BatchSoftDelete(long[] ids) { return await _dictionaryService.BatchSoftDeleteAsync(ids); } } }