Add remaining project files
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using DeluxeBackend.Models;
|
||||
using DeluxeBackend.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DeluxeBackend.Controllers.Accounts
|
||||
{
|
||||
[Route("Accounts/account")]
|
||||
[ApiController]
|
||||
public class BruhController : ControllerBase
|
||||
{
|
||||
private readonly IJwtService jwt;
|
||||
private readonly ILiteDbService db;
|
||||
|
||||
public BruhController(IJwtService _jwt, ILiteDbService _db)
|
||||
{
|
||||
jwt = _jwt;
|
||||
db = _db;
|
||||
}
|
||||
|
||||
[HttpGet("{accId}/bio")]
|
||||
[Authorize(Roles = "gameClient")]
|
||||
public async Task<IActionResult> Btio(long accId)
|
||||
{
|
||||
|
||||
Account? account = db.Accounts.FindById(accId);
|
||||
|
||||
if (account == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return Ok(new
|
||||
{
|
||||
accountId = accId,
|
||||
bio = account.Bio
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user