Files
RRAC/RecRoomArchive/Controllers/API/Players/V1/PlayersController.cs
2026-02-27 19:30:49 -08:00

57 lines
2.0 KiB
C#

using Microsoft.AspNetCore.Mvc;
using RecRoomArchive.Models.API.Platform;
using RecRoomArchive.Models.API.Players;
using RecRoomArchive.Services;
using System.ComponentModel.DataAnnotations;
namespace RecRoomArchive.Controllers.API.Players.V1
{
/// <summary>
/// Used to get accounts / profiles in 2016-2020 although gets phased out as time goes on...
/// </summary>
[Route(template: "api/[controller]/v1")]
[ApiController]
public class PlayersController(AccountService accountService) : ControllerBase
{
/// <summary>
/// Returns the profile of this ID (If it exists)
/// </summary>
/// <param name="id">The ID of the player we are trying to get the profile of</param>
/// <returns>The profile of the player, if it exists</returns>
[HttpGet(template: "{id:long}")]
public async Task<ActionResult<BaseProfile>> GetProfile([Required] ulong id)
{
return accountService.GetSelfAccount()!;
}
[HttpPost(template: "listByPlatformId")]
public async Task<ActionResult<List<object>>> GetFromServer([FromForm] PlatformType platform, [FromForm] List<ulong> platformIds)
{
return Ok(new List<object>());
}
[HttpGet(template: "search/{query}")]
public async Task<ActionResult<List<BaseProfile>>> SearchForProfiles(string query)
{
return Ok(new List<BaseProfile>());
}
[HttpGet(template: "phoneLastFour")]
public async Task<ActionResult<PhoneNumberDTO>> GetPhoneLastFour()
{
return Ok(new PhoneNumberDTO());
}
[HttpGet(template: "blockDuration")]
public async Task<ActionResult<BlockDurationDTO>> GetBlockDuration()
{
return Ok(new BlockDurationDTO());
}
[HttpPost(template: "objectives")]
public async Task<ActionResult> CompleteObjectives(object objective)
{
return Ok();
}
}
}