wcs_server_kate_suzhou/WcsMain/ApiServe/Controllers/WcsController/ConfigController.cs

41 lines
1.4 KiB
C#
Raw Normal View History

2024-05-14 16:30:56 +08:00
using Microsoft.AspNetCore.Mvc;
using WcsMain.ApiServe.ControllerFilter;
2024-05-14 16:30:56 +08:00
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]
2024-05-14 16:30:56 +08:00
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);
2024-05-14 16:30:56 +08:00
/// <summary>
/// 分页请求,获取配置项
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("getConfigWithPage")]
public WcsApiResponse<List<AppConfig>> GetConfigWithPage([FromBody] GetConfigWithPageRequest request) => configService.GetConfigWithPage(request);
2024-05-14 16:30:56 +08:00
/// <summary>
/// 添加或者修改配置项
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("editeConfig")]
public WcsApiResponse EditeConfig([FromBody] EditeConfigRequest request) => configService.EditeConfig(request);
2024-05-14 16:30:56 +08:00
}