From cf455ed8de20bbee011289223e7d8d5775dfd69e Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Tue, 5 Sep 2023 06:28:52 +0200 Subject: Media moderator PoC works, abstract command handling to library --- .../Controllers/ValidationController.cs | 26 ------------------ .../LibMatrix.DebugDataValidationApi.csproj | 19 ------------- LibMatrix.DebugDataValidationApi/Program.cs | 32 ---------------------- .../Properties/launchSettings.json | 32 ---------------------- .../appsettings.Development.json | 11 -------- LibMatrix.DebugDataValidationApi/appsettings.json | 9 ------ 6 files changed, 129 deletions(-) delete mode 100644 LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs delete mode 100644 LibMatrix.DebugDataValidationApi/LibMatrix.DebugDataValidationApi.csproj delete mode 100644 LibMatrix.DebugDataValidationApi/Program.cs delete mode 100644 LibMatrix.DebugDataValidationApi/Properties/launchSettings.json delete mode 100644 LibMatrix.DebugDataValidationApi/appsettings.Development.json delete mode 100644 LibMatrix.DebugDataValidationApi/appsettings.json (limited to 'LibMatrix.DebugDataValidationApi') diff --git a/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs b/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs deleted file mode 100644 index 4dbee54..0000000 --- a/LibMatrix.DebugDataValidationApi/Controllers/ValidationController.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Text.Json; -using LibMatrix.Extensions; -using Microsoft.AspNetCore.Mvc; - -namespace LibMatrix.DebugDataValidationApi.Controllers; - -[ApiController] -[Route("/")] -public class ValidationController : ControllerBase { - private readonly ILogger _logger; - - public ValidationController(ILogger logger) { - _logger = logger; - } - - [HttpPost("/validate/{type}")] - public Task Get([FromRoute] string type, [FromBody] JsonElement content) { - var t = Type.GetType(type); - if (t is null) { - Console.WriteLine($"Type `{type}` does not exist!"); - throw new ArgumentException($"Unknown type {type}!"); - } - Console.WriteLine($"Validating {type}..."); - return Task.FromResult(content.FindExtraJsonElementFields(t, "$")); - } -} diff --git a/LibMatrix.DebugDataValidationApi/LibMatrix.DebugDataValidationApi.csproj b/LibMatrix.DebugDataValidationApi/LibMatrix.DebugDataValidationApi.csproj deleted file mode 100644 index 205ff68..0000000 --- a/LibMatrix.DebugDataValidationApi/LibMatrix.DebugDataValidationApi.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net7.0 - enable - enable - true - - - - - - - - - - - - diff --git a/LibMatrix.DebugDataValidationApi/Program.cs b/LibMatrix.DebugDataValidationApi/Program.cs deleted file mode 100644 index cf9dc55..0000000 --- a/LibMatrix.DebugDataValidationApi/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. - -builder.Services.AddControllers(); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); -builder.Services.AddCors(options => -{ - options.AddPolicy( - "Open", - policy => policy.AllowAnyOrigin().AllowAnyHeader()); -}); - -var app = builder.Build(); - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(); -} - -// app.UseHttpsRedirection(); - -app.UseCors("Open"); - -app.UseAuthorization(); - -app.MapControllers(); - -app.Run(); diff --git a/LibMatrix.DebugDataValidationApi/Properties/launchSettings.json b/LibMatrix.DebugDataValidationApi/Properties/launchSettings.json deleted file mode 100644 index fe668ce..0000000 --- a/LibMatrix.DebugDataValidationApi/Properties/launchSettings.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:9169", - "sslPort": 44321 - } - }, - "profiles": { - "Development": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "launchUrl": "swagger", - "applicationUrl": "http://localhost:5258", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Local": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": false, - "applicationUrl": "http://localhost:5258", - "environmentVariables": { - "DOTNET_ENVIRONMENT": "Local" - } - } - } -} diff --git a/LibMatrix.DebugDataValidationApi/appsettings.Development.json b/LibMatrix.DebugDataValidationApi/appsettings.Development.json deleted file mode 100644 index 12c8ab9..0000000 --- a/LibMatrix.DebugDataValidationApi/appsettings.Development.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Information", - "Microsoft.AspNetCore.Routing": "Warning", - "Microsoft.AspNetCore.Mvc": "Warning", - "Microsoft.AspNetCore.Cors": "Warning" - } - } -} diff --git a/LibMatrix.DebugDataValidationApi/appsettings.json b/LibMatrix.DebugDataValidationApi/appsettings.json deleted file mode 100644 index 10f68b8..0000000 --- a/LibMatrix.DebugDataValidationApi/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -} -- cgit 1.4.1