Add remaining project files
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.IO;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DeluxeBackend.Controllers.Auth
|
||||
{
|
||||
[Route("Auth/photon")]
|
||||
[ApiController]
|
||||
public class PhotonController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<PhotonController> _logger;
|
||||
|
||||
public PhotonController(ILogger<PhotonController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public class PhotonAuthResponse
|
||||
{
|
||||
[JsonPropertyName("ResultCode")]
|
||||
public int ResultCode { get; set; } // 1 = Success, 2 = Fail, 3 = Invalid Params
|
||||
|
||||
[JsonPropertyName("Message")]
|
||||
public string? Message { get; set; }
|
||||
|
||||
[JsonPropertyName("UserId")]
|
||||
public string? UserId { get; set; }
|
||||
|
||||
[JsonPropertyName("Nickname")]
|
||||
public string? Nickname { get; set; }
|
||||
|
||||
[JsonPropertyName("Data")]
|
||||
public object? Data { get; set; }
|
||||
}
|
||||
|
||||
/*[HttpPost()]
|
||||
public async Task<IActionResult> Authenticate()
|
||||
{
|
||||
_logger.LogInformation("Photon Auth Request Query: {Query}", Request.QueryString.Value);
|
||||
|
||||
string requestBody = string.Empty;
|
||||
using (var reader = new StreamReader(Request.Body))
|
||||
{
|
||||
requestBody = await reader.ReadToEndAsync();
|
||||
}
|
||||
|
||||
_logger.LogInformation("Photon Auth Request Body: {Body}", requestBody);
|
||||
|
||||
return Ok(new PhotonAuthResponse
|
||||
{
|
||||
ResultCode = 1,
|
||||
UserId = "2",
|
||||
Nickname = "player",
|
||||
Message = "Authentication verified successfully.",
|
||||
Data = new { }
|
||||
});
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user