Add remaining project files

This commit is contained in:
Marco Baldwin
2026-07-23 18:21:43 -07:00
parent c12d8ac35d
commit 6e15e89a9d
453 changed files with 64265 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
using DeluxeBackend.Models;
using DeluxeBackend.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace DeluxeBackend.Controllers.Auth
{
[Route("Auth/role")]
[ApiController]
public class RoleController : ControllerBase
{
private readonly ILiteDbService db;
private readonly IJwtService jwt;
private readonly DiscordBotService discord;
public RoleController(ILiteDbService _db, IJwtService _jwtService, DiscordBotService discordBotService)
{
db = _db;
jwt = _jwtService;
discord = discordBotService;
}
[HttpGet("{roleName}/{accId}")]
public async Task<IActionResult> HasRole(string roleName, long accId)
{
Account? account = db.Accounts.FindById(accId);
if (account == null)
{
return NotFound();
}
return Ok(await account.HasRoleAsync(discord, roleName));
}
}
}