39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using WcsMain.ApiServe.Controllers.Dto;
|
|||
|
|
using WcsMain.ApiServe.Controllers.Dto.WcsDto.Settings;
|
|||
|
|
using WcsMain.ApiServe.Service.WcsService;
|
|||
|
|
using WcsMain.DataBase.TableEntity;
|
|||
|
|
|
|||
|
|
namespace WcsMain.ApiServe.Controllers.WcsController;
|
|||
|
|
|
|||
|
|
[Route("/api/wcs/setting")]
|
|||
|
|
[ApiController]
|
|||
|
|
public class SettingController(SettingService settingService) : ControllerBase
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
private readonly SettingService _settingService = settingService;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询设置项
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="settingKey"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("getSettings")]
|
|||
|
|
public WcsApiResponse<List<AppSettings>> GetConfig([FromQuery(Name = "settingKey")] string? settingKey)
|
|||
|
|
{
|
|||
|
|
return _settingService.GetConfig(settingKey);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 添加或者修改配置项
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="request"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost("editSettings")]
|
|||
|
|
public WcsApiResponse EditeConfig([FromBody] EditSettingsRequest request)
|
|||
|
|
{
|
|||
|
|
return _settingService.EditeConfig(request);
|
|||
|
|
}
|
|||
|
|
}
|