add a bunch of stuff copied from Foxchat.NET
This commit is contained in:
parent
f4c0a40259
commit
6114f384a0
21 changed files with 1216 additions and 35 deletions
32
Foxnouns.Backend/Controllers/UsersController.cs
Normal file
32
Foxnouns.Backend/Controllers/UsersController.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System.Diagnostics;
|
||||
using Foxnouns.Backend.Database;
|
||||
using Foxnouns.Backend.Middleware;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Foxnouns.Backend.Controllers;
|
||||
|
||||
[Route("/api/v2/users")]
|
||||
public class UsersController(DatabaseContext db) : ApiControllerBase
|
||||
{
|
||||
[HttpGet("{userRef}")]
|
||||
public async Task<IActionResult> GetUser(string userRef)
|
||||
{
|
||||
var user = await db.ResolveUserAsync(userRef);
|
||||
return Ok(user);
|
||||
}
|
||||
|
||||
[HttpGet("@me")]
|
||||
[Authorize("identify")]
|
||||
public Task<IActionResult> GetMe()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
[HttpPatch("@me")]
|
||||
public Task<IActionResult> UpdateUser([FromBody] UpdateUserRequest req)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public record UpdateUserRequest(string? Username, string? DisplayName);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue