Add remaining project files
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using DeluxeBackend.Models;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DeluxeBackend.Controllers.Api
|
||||
{
|
||||
[Route("api/sanitize")]
|
||||
[ApiController]
|
||||
public class SanitizeController : ControllerBase
|
||||
{
|
||||
[HttpPost("v1/isPure")]
|
||||
[Authorize(Roles = "gameClient")]
|
||||
public async Task<IActionResult> IsPure()
|
||||
{
|
||||
return Ok(new { IsPure = true});
|
||||
}
|
||||
|
||||
public class SanitizeRequest
|
||||
{
|
||||
public string Value { get; set; } = string.Empty;
|
||||
public int ReplacementChar { get; set; } = 42;
|
||||
}
|
||||
[HttpPost("v1")]
|
||||
public async Task<IActionResult> SanitizeMessage([FromBody] SanitizeRequest request)
|
||||
{
|
||||
var sanitized = JsonSerializer.Serialize(request.Value);
|
||||
return Ok(sanitized);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user