26 lines
718 B
C#
26 lines
718 B
C#
using System;
|
|
using ChaosBot.Database.Repository;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using NLog;
|
|
|
|
namespace ChaosBot.WebServer.App.Controller
|
|
{
|
|
[ApiController]
|
|
[Route("/config/{guildId}/{flag}")]
|
|
public class ConfigurationController
|
|
{
|
|
private readonly Logger _logger = Program._logger;
|
|
|
|
[HttpGet]
|
|
public string GetConfigurationFlag(long guildId, string flag)
|
|
{
|
|
return ConfigurationRepository.GetValueRaw(flag, guildId);
|
|
}
|
|
|
|
[HttpPost]
|
|
public void SetConfigurationFlag(long guildId, string flag, [FromBody] string serializedValue)
|
|
{
|
|
ConfigurationRepository.SetValueRaw(flag, guildId, serializedValue);
|
|
}
|
|
}
|
|
} |