|
|
|
|
using DS.Module.Core;
|
|
|
|
|
using DS.WMS.Core.System.Dtos;
|
|
|
|
|
using DS.WMS.Core.System.Entity;
|
|
|
|
|
using DS.WMS.Core.System.Interface;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DS.WMS.AdminApi.Controllers;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 字典模块
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class DictController : ApiController
|
|
|
|
|
{
|
|
|
|
|
private readonly ISysDictTypeService _invokeService;
|
|
|
|
|
private readonly ISysDictDataService _dictDataService;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 构造函数
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="invokeService"></param>
|
|
|
|
|
public DictController(ISysDictTypeService invokeService,ISysDictDataService dictDataService)
|
|
|
|
|
{
|
|
|
|
|
_invokeService = invokeService;
|
|
|
|
|
_dictDataService = dictDataService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 字典类型列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("GetSysDictTypeList")]
|
|
|
|
|
public DataResult<List<DictTypeRes>> GetSysDictTypeList([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetListByPage(request);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 编辑字典类型
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("EditDictType")]
|
|
|
|
|
public DataResult EditDictType([FromBody] DictTypeReq model)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.EditDictType(model);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 字典明细列表
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="request"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("GetSysDictDataList")]
|
|
|
|
|
public DataResult<List<DictDataRes>> GetSysDictDataList([FromBody] PageRequest request)
|
|
|
|
|
{
|
|
|
|
|
var res = _dictDataService.GetListByPage(request);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 编辑字典明细
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="model"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[Route("EditDictData")]
|
|
|
|
|
public DataResult EditDictData([FromBody] DictDataReq model)
|
|
|
|
|
{
|
|
|
|
|
var res = _dictDataService.EditDictData(model);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 字典类型详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetDictTypeInfo")]
|
|
|
|
|
public DataResult<DictTypeRes> GetDictTypeInfo([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = _invokeService.GetDictTypeInfo(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 字典明细详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[Route("GetDictDataInfo")]
|
|
|
|
|
public DataResult<DictDataRes> GetDictDataInfo([FromQuery] string id)
|
|
|
|
|
{
|
|
|
|
|
var res = _dictDataService.GetDictDataInfo(id);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
}
|