feat(backend): initial /api/v1/users endpoint

This commit is contained in:
sam 2024-12-25 11:19:50 -05:00
parent 5e7df2e074
commit 7791c91960
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
20 changed files with 385 additions and 4 deletions

View file

@ -0,0 +1,16 @@
using Foxnouns.Backend.Database.Models;
using Foxnouns.Backend.Services.V1;
using Microsoft.AspNetCore.Mvc;
namespace Foxnouns.Backend.Controllers.V1;
[Route("/api/v1/users")]
public class UsersV1Controller(UsersV1Service usersV1Service) : ApiControllerBase
{
[HttpGet("{userRef}")]
public async Task<IActionResult> GetUserAsync(string userRef, CancellationToken ct = default)
{
User user = await usersV1Service.ResolveUserAsync(userRef, CurrentToken, ct);
return Ok(await usersV1Service.RenderUserAsync(user));
}
}