Initialize repository

Added basic info to get in game for like...August 2016 ;-;
It's not much but it's a start
This commit is contained in:
splootybean
2026-02-27 00:58:13 -08:00
parent 05c35b2a18
commit 387ec7ba89
61 changed files with 1722 additions and 0 deletions
@@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using RecRoomArchive.Models.API.Players;
using RecRoomArchive.Services;
using System.Text.Json;
namespace RecRoomArchive.Controllers.API.Images.V2
{
[Route("api/[controller]/v2")]
[ApiController]
public class ImagesController(FileService fileService, ImageService imageService) : ControllerBase
{
[HttpPost(template: "profile")]
public async Task<ActionResult> SetProfileImage(IFormFile image)
{
using var stream = image.OpenReadStream();
var imageName = await imageService.SaveImageAsync(stream);
var profileData = fileService.GetData("profile.json");
if (profileData == null)
return BadRequest("Profile is not populated");
var profile = JsonSerializer.Deserialize<BaseProfile>(profileData)!;
profile.ProfileImageName = imageName;
fileService.SetData("profile.json", JsonSerializer.Serialize(profile));
return Ok();
}
}
}