Minimum viable
This commit is contained in:
1 parent
476aff202f
commit
07229424a4
14 files changed
+564
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using UnityModManagerNet;
|
||||
|
||||
namespace CommunityMapLocation.Api
|
||||
{
|
||||
public abstract class Endpoint<T> : IEndpoint
|
||||
{
|
||||
public abstract HttpMethod HttpMethod { get; }
|
||||
public abstract string RoutePattern { get; }
|
||||
public bool Matches(Uri uri)
|
||||
{
|
||||
return String.Concat(uri.Segments).Equals(RoutePattern, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public abstract T Handle(UnityModManager.ModEntry.ModLogger logger, HttpListenerRequest request);
|
||||
|
||||
object IEndpoint.Handle(UnityModManager.ModEntry.ModLogger logger, HttpListenerRequest request)
|
||||
{
|
||||
return Handle(logger, request);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user