party migrate to Pilz.Net
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
internal class ApiBuilder : IApiBuilder
|
||||
{
|
||||
private readonly Dictionary<ApiMapInfo, Delegate> handlers = [];
|
||||
|
||||
public IReadOnlyDictionary<ApiMapInfo, Delegate> Handlers => handlers;
|
||||
|
||||
public void Map(string pattern, Delegate action)
|
||||
{
|
||||
handlers.Add(new(pattern, "POST"), action);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
public record struct ApiMapInfo(string Pattern, string Method);
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Net;
|
||||
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
public static class ApiRequestMethods
|
||||
{
|
||||
public static string Get => WebRequestMethods.Http.Get;
|
||||
public static string Put => WebRequestMethods.Http.Put;
|
||||
public static string Post => WebRequestMethods.Http.Post;
|
||||
public static string Patch => "PATCH";
|
||||
public static string Delete => "DELETE";
|
||||
}
|
||||
@@ -1,7 +1,4 @@
|
||||
using OwnChar.Server.Api;
|
||||
using OwnChar.Server.Api.Endpoint;
|
||||
|
||||
namespace OwnChar.Server.Api.Endpoint.Implementations;
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
internal class CharactersApi(IServer server) : IApiEndpoint
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using OwnChar.Data.Model.Client;
|
||||
using OwnChar.Server.Data.Model;
|
||||
using OwnChar.Server.Extensions;
|
||||
|
||||
namespace OwnChar.Server.Api.Endpoint.Implementations;
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
internal class GroupsApi(IServer server) : IApiEndpoint
|
||||
{
|
||||
@@ -58,7 +58,7 @@ internal class GroupsApi(IServer server) : IApiEndpoint
|
||||
return TypedResults.Unauthorized();
|
||||
|
||||
var group = new GroupDb();
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(request.Name))
|
||||
group.Name = request.Name;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
public interface IApiBuilder
|
||||
{
|
||||
public IReadOnlyDictionary<ApiMapInfo, Delegate> Handlers { get; }
|
||||
|
||||
void Map(string path, Delegate action);
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using OwnChar.Api.Packets.General;
|
||||
using OwnChar.Server.Data.Model;
|
||||
using OwnChar.Server.Extensions;
|
||||
|
||||
namespace OwnChar.Server.Api.Endpoint.Implementations;
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
internal class LoginApi(ServerContext server) : IApiEndpoint
|
||||
{
|
||||
@@ -1,6 +1,4 @@
|
||||
using OwnChar.Server.Api;
|
||||
|
||||
namespace OwnChar.Server.Api.Endpoint.Implementations;
|
||||
namespace OwnChar.Server.Api.Endpoint;
|
||||
|
||||
internal class UsersApi(IServer server) : IApiEndpoint
|
||||
{
|
||||
Reference in New Issue
Block a user