Major API rework for paradigm change (#10)

* start with group permissions implementation

* refactor group dto stuff

* adjustments to api as necessary from client

* more api refactor for UserData

* use implicit usings and file scoped namespaces

* fix userpermissionsextensions

* fix extenions

* add more comparers

* adjust comparers

* remove admin stuff (tbd migration to discord bot)

* adjust extensions

* code style for api

---------

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
rootdarkarchon
2023-01-29 15:14:33 +01:00
committed by GitHub
parent 2015496ec0
commit 0d04aaafac
66 changed files with 669 additions and 378 deletions

View File

@@ -0,0 +1,9 @@
namespace MareSynchronos.API.Routes;
public class MareAuth
{
public const string Auth = "/auth";
public const string Auth_CreateIdent = "createWithIdent";
public static Uri AuthFullPath(Uri baseUri) => new Uri(baseUri, Auth + "/" + Auth_CreateIdent);
}

View File

@@ -0,0 +1,23 @@
namespace MareSynchronos.API.Routes;
public class MareFiles
{
public const string Cache = "/cache";
public const string Cache_Get = "get";
public static Uri CacheGetFullPath(Uri baseUri, Guid requestId) => new(baseUri, Cache + "/" + Cache_Get + "?requestId=" + requestId.ToString());
public const string ServerFiles = "/files";
public const string ServerFiles_Get = "get";
public static Uri ServerFilesGetFullPath(Uri baseUri, string hash) => new(baseUri, ServerFiles + "/" + ServerFiles_Get + "/" + hash);
public const string Request = "/request";
public const string Request_Enqueue = "enqueue";
public const string Request_RequestFile = "file";
public const string Request_Cancel = "cancel";
public const string Request_Check = "check";
public static Uri RequestEnqueueFullPath(Uri baseUri) => new(baseUri, Request + "/" + Request_Enqueue);
public static Uri RequestRequestFileFullPath(Uri baseUri, string hash) => new(baseUri, Request + "/" + Request_RequestFile + "?file=" + hash);
public static Uri RequestCancelFullPath(Uri baseUri, Guid guid) => new Uri(baseUri, Request + "/" + Request_Cancel + "?requestId=" + guid.ToString());
public static Uri RequestCheckQueueFullPath(Uri baseUri, Guid guid, string hash) => new Uri(baseUri, Request + "/" + Request_Check + "?requestId=" + guid.ToString() + "&file=" + hash);
}