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.

88 lines
2.7 KiB

using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using Entity.Dto.Req;
using Service.System.Dict;
using Entity.Base;
using Entity.DbModel.System;
using HybirdFrameworkCore.Entity;
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<Result<PageResult<SysDictData>>> DictDataPage([FromBody][Required] PageDictDataReq pageDictDataInput)
{
return Result<PageResult<SysDictData>>.Success(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);
}
}
}