系统类型枚举接口
This commit is contained in:
50
src/WMS.Web.Api/Controllers/SysConfigController.cs
Normal file
50
src/WMS.Web.Api/Controllers/SysConfigController.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WMS.Web.Core;
|
||||
using WMS.Web.Core.Dto;
|
||||
using WMS.Web.Core.Internal.Results;
|
||||
using WMS.Web.Domain.Values;
|
||||
|
||||
namespace WMS.Web.Api.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 系统配置
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class SysConfigController : ControllerBase
|
||||
{
|
||||
public SysConfigController()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取系统类型所需要下拉列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
[Route("GetStatus")]
|
||||
public Task<Result<EnumStatusResponse>> GetStatus()
|
||||
{
|
||||
EnumStatusResponse response = new EnumStatusResponse();
|
||||
foreach (OutStockType enumv in Enum.GetValues(typeof(OutStockType)))
|
||||
{
|
||||
response.OutStockType.Add(enumv.ToString(), enumv.GetRemark());
|
||||
}
|
||||
foreach (MoveBoxType enumv in Enum.GetValues(typeof(MoveBoxType)))
|
||||
{
|
||||
response.MoveBoxType.Add(enumv.ToString(), enumv.GetRemark());
|
||||
}
|
||||
foreach (TakeStockType enumv in Enum.GetValues(typeof(TakeStockType)))
|
||||
{
|
||||
response.TakeStockType.Add(enumv.ToString(), enumv.GetRemark());
|
||||
}
|
||||
|
||||
return Task.FromResult(Result<EnumStatusResponse>.ReSuccess(response));
|
||||
}
|
||||
}
|
||||
}
|
||||
27
src/WMS.Web.Core/Dto/EnumStatusResponse.cs
Normal file
27
src/WMS.Web.Core/Dto/EnumStatusResponse.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace WMS.Web.Core.Dto
|
||||
{
|
||||
/// <summary>
|
||||
/// 所有枚举信息
|
||||
/// </summary>
|
||||
public class EnumStatusResponse
|
||||
{
|
||||
public EnumStatusResponse() { }
|
||||
/// <summary>
|
||||
/// 出库单类型
|
||||
/// </summary>
|
||||
public Dictionary<string, string> OutStockType { get; set; } = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// 移库单类型
|
||||
/// </summary>
|
||||
public Dictionary<string, string> MoveBoxType { get; set; } = new Dictionary<string, string>();
|
||||
/// <summary>
|
||||
/// 盘点结果类型
|
||||
/// </summary>
|
||||
public Dictionary<string, string> TakeStockType { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user