41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using WcsMain.ApiServe.ControllerFilter;
|
|
using WcsMain.ApiServe.ControllerFilter.ExceptionFilter;
|
|
using WcsMain.ApiServe.Controllers.Dto;
|
|
using WcsMain.ApiServe.Controllers.Dto.WcsDto.Config;
|
|
using WcsMain.ApiServe.Service.WcsService;
|
|
using WcsMain.DataBase.TableEntity;
|
|
|
|
namespace WcsMain.ApiServe.Controllers.WcsController;
|
|
|
|
[Route("api/wcs/config")]
|
|
[ApiController]
|
|
[WcsExceptionFilter]
|
|
[WcsAuthorization]
|
|
public class ConfigController(ConfigService configService) : ControllerBase
|
|
{
|
|
|
|
/// <summary>
|
|
/// 查询配置项
|
|
/// </summary>
|
|
/// <param name="configKey"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("getConfig")]
|
|
public WcsApiResponse<List<AppConfig>> GetConfig([FromQuery(Name = "configKey")] string? configKey) => configService.GetConfig(configKey);
|
|
|
|
/// <summary>
|
|
/// 分页请求,获取配置项
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("getConfigWithPage")]
|
|
public WcsApiResponse<List<AppConfig>> GetConfigWithPage([FromBody] GetConfigWithPageRequest request) => configService.GetConfigWithPage(request);
|
|
|
|
/// <summary>
|
|
/// 添加或者修改配置项
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("editeConfig")]
|
|
public WcsApiResponse EditeConfig([FromBody] EditeConfigRequest request) => configService.EditeConfig(request);
|
|
} |