mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-09 17:03:08 +00:00
36 lines
754 B
C#
36 lines
754 B
C#
using DiscordRewards;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace BiblioTech.Rewards
|
|
{
|
|
public interface IDiscordRoleDriver
|
|
{
|
|
Task GiveRewards(GiveRewardsCommand rewards);
|
|
}
|
|
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class RewardController : ControllerBase
|
|
{
|
|
[HttpGet]
|
|
public string Ping()
|
|
{
|
|
return "Pong";
|
|
}
|
|
|
|
[HttpPost]
|
|
public async Task<string> Give(GiveRewardsCommand cmd)
|
|
{
|
|
try
|
|
{
|
|
await Program.RoleDriver.GiveRewards(cmd);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Program.Log.Error("Exception: " + ex);
|
|
}
|
|
return "OK";
|
|
}
|
|
}
|
|
}
|