mirror of
https://git.recroomarchive.org/RecRoomArchive/RRAC.git
synced 2026-09-08 06:31:25 -07:00
29 lines
983 B
C#
29 lines
983 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
using RecRoomArchive.Models.API.Platform;
|
|
using RecRoomArchive.Models.API.Players;
|
|
using RecRoomArchive.Services;
|
|
|
|
namespace RecRoomArchive.Controllers.API.PlatformLogin.V1
|
|
{
|
|
[Route("api/[controller]/v1")]
|
|
[ApiController]
|
|
public class PlatformLoginController(AccountService accountService) : ControllerBase
|
|
{
|
|
[HttpPost(template: "profiles")]
|
|
public async Task<ActionResult<List<BaseProfile>>> GetProfiles([FromForm(Name = "Platform")] PlatformType platform, [FromForm(Name = "PlatformId")] ulong platformId)
|
|
{
|
|
if (!accountService.AccountExists())
|
|
{
|
|
accountService.CreateAccount();
|
|
}
|
|
|
|
var profile = accountService.GetSelfAccount();
|
|
if (profile == null)
|
|
return BadRequest("Please relaunch RRAC and re-run setup");
|
|
|
|
List<BaseProfile> profiles = [profile];
|
|
|
|
return Ok(profiles);
|
|
}
|
|
}
|
|
} |