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

110 lines
3.0 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.System.Dtos;
using DS.WMS.Core.System.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.WebApi.Controllers;
/// <summary>
/// 字典模块
/// </summary>
public class SysDictionaryController : ApiController
{
private readonly ISysDictionaryService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public SysDictionaryController(ISysDictionaryService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 字典列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetDictionaryList")]
public DataResult<List<SysDictionaryViewModel>> GetDictionaryList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 获取字典信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetSysDictionaryInfo")]
public DataResult<SysDictionaryViewModel> GetSysDictionaryInfo([FromQuery]int id)
{
var res = _invokeService.GetSysDictionaryInfo(id);
return res;
}
/// <summary>
/// 编辑字典
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditSysDictionaryInfo")]
public DataResult EditSysDictionaryInfo([FromBody] SysDictionaryInput model)
{
var res = _invokeService.EditSysDictionaryInfo(model);
return res;
}
/// <summary>
/// 字典明细列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetSysDictionaryList")]
public DataResult<List<SysDictionaryListViewModel>> GetSysDictionaryList([FromBody] PageRequest request)
{
var res = _invokeService.GetSysDictionaryList(request);
return res;
}
/// <summary>
/// 获取字典明细信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetSysDictionaryListInfo")]
public DataResult<SysDictionaryListViewModel> GetSysDictionaryListInfo([FromQuery]int id)
{
var res = _invokeService.GetSysDictionaryListInfo(id);
return res;
}
/// <summary>
/// 编辑字典明细
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditSysDictionaryListInfo")]
public DataResult EditSysDictionaryListInfo([FromBody] SysDictionaryListInput model)
{
var res = _invokeService.EditSysDictionaryListInfo(model);
return res;
}
/// <summary>
/// 删除字典明细
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("DelSysDictionaryListInfo")]
public DataResult DelSysDictionaryListInfo([FromQuery]int id)
{
var res = _invokeService.DelSysDictionaryListInfo(id);
return res;
}
}