You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Txgy.RBS.DbModel.Models;
using Txgy.RBS.Framework.Api;
using Txgy.RBS.IServices;
using Txgy.RBS.Services;
namespace Txgy.RBS.Server.WebApi.Controllers
{
[Route("api/[controller]/[action]")]
[ApiController]
public class GlobalConfigController : ControllerBase
{
private readonly IGlobalConfigService _globalConfigService;
public GlobalConfigController(ILogger<GlobalConfigController> logger, IGlobalConfigService globalConfigService)
{
this._globalConfigService = globalConfigService;
}
[HttpPost]
public ApiResult AddGlobalConfig(GlobalConfigDTO globalConfigDTO)
{
return _globalConfigService.AddGlobalConfig(globalConfigDTO);
}
[HttpPost]
public ApiResult UpdateGlobalConfig(GlobalConfigDTO globalConfigDTO)
{
return _globalConfigService.UpdateGlobalConfig(globalConfigDTO);
}
[HttpGet("{id}")]
public GlobalConfigDTO GetGlobalConfig(int id)
{
return _globalConfigService.GetGlobalConfig(id);
}
[HttpGet]
public List<GlobalConfigDTO> GetAllGlobalConfig()
{
return _globalConfigService.GetAllGlobalConfig();
}
}
}