You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.7 KiB

7 months ago
using Entity.DbModel.System.SysBaseObject;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using Entity.Dto.Req;
using Service.System.Dict;
using Entity.Base;
namespace WebStarter.Controllers.System.Dict
{
[Produces("application/json")]
[ApiController]
public class SysDictDataController : ControllerBase
{
private readonly SysDictDataService _sysDictDataServices;
public SysDictDataController(SysDictDataService sysDictDataServices)
{
_sysDictDataServices = sysDictDataServices;
}
[HttpPost]
[Route("/api/sysDictData/page")]
public async Task<SqlSugarPagedList<SysDictData>> DictDataPage([FromBody][Required] PageDictDataReq pageDictDataInput)
{
return await _sysDictDataServices.Page(pageDictDataInput);
}
[HttpGet]
[Route("/api/sysDictData/list")]
public async Task<List<SysDictData>> DictDataGetList([FromBody] GetDataDictDataReq getDataDictDataInput)
{
return await _sysDictDataServices.GetList(getDataDictDataInput);
}
[HttpPost]
[Route("/api/sysDictData/add")]
public async Task AddDictData([FromBody] AddDictDataReq addDictDataInput)
{
await _sysDictDataServices.AddDictData(addDictDataInput);
}
[HttpPost]
[Route("/api/sysDictData/update")]
public async Task UpdateDictData([FromBody] UpdateDictDataReq input)
{
await _sysDictDataServices.UpdateDictData(input);
}
[HttpPost]
[Route("/api/sysDictData/delete")]
public async Task DeleteDictData([FromBody] DeleteDictDataReq input)
{
await _sysDictDataServices.DeleteDictData(input);
}
[HttpPost]
[Route("/api/sysDictData/setStatus")]
public async Task SetStatus([FromBody] DictDataReq input)
{
await _sysDictDataServices.SetStatus(input);
}
[HttpGet]
[Route("/api/sysDictData/detail")]
public async Task<SysDictData> GetDetail([FromBody] DictDataReq input)
{
return await _sysDictDataServices.GetDetail(input);
}
[HttpGet]
[Route("/api/sysDictData/dataList/{code}")]
public async Task<List<SysDictData>> GetDataListByStr(string code)
{
return await _sysDictDataServices.GetDataList(code);
}
[HttpGet]
[Route("/api/sysDictData/dataList")]
public async Task<List<SysDictData>> GetDataListByObj([FromBody] QueryDictDataReq input)
{
return await _sysDictDataServices.GetDataList(input);
}
}
}