123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using Admin.Core.Common.Input;
- using Admin.Core.Common.Output;
- using Admin.Core.Model.Admin;
- using Admin.Core.Service.Admin.Dictionary;
- using Admin.Core.Service.Admin.Dictionary.Input;
- using Microsoft.AspNetCore.Mvc;
- using System.Threading.Tasks;
- namespace Admin.Core.Controllers.Admin
- {
- /// <summary>
- /// 数据字典
- /// </summary>
- public class DictionaryController : AreaController
- {
- private readonly IDictionaryService _dictionaryService;
- public DictionaryController(IDictionaryService dictionaryService)
- {
- _dictionaryService = dictionaryService;
- }
- /// <summary>
- /// 查询单条数据字典
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpGet]
- public async Task<IResponseOutput> Get(long id)
- {
- return await _dictionaryService.GetAsync(id);
- }
- /// <summary>
- /// 查询分页数据字典
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost]
- public async Task<IResponseOutput> GetPage(PageInput<DictionaryEntity> model)
- {
- return await _dictionaryService.PageAsync(model);
- }
- /// <summary>
- /// 新增数据字典
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpPost]
- public async Task<IResponseOutput> Add(DictionaryAddInput input)
- {
- return await _dictionaryService.AddAsync(input);
- }
- /// <summary>
- /// 修改数据字典
- /// </summary>
- /// <param name="input"></param>
- /// <returns></returns>
- [HttpPut]
- public async Task<IResponseOutput> Update(DictionaryUpdateInput input)
- {
- return await _dictionaryService.UpdateAsync(input);
- }
- /// <summary>
- /// 删除数据字典
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- [HttpDelete]
- public async Task<IResponseOutput> SoftDelete(long id)
- {
- return await _dictionaryService.SoftDeleteAsync(id);
- }
- }
- }
|