Add API for FileServiceRequests (#8)
* add paths to api * add queue request dto * update api for pathing * update pathing again * update api Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com> Co-authored-by: Stanley Dimant <stanley.dimant@varian.com>
This commit is contained in:
@@ -10,17 +10,9 @@ namespace MareSynchronos.API
|
||||
Warning,
|
||||
Error
|
||||
}
|
||||
|
||||
public class MareAuth
|
||||
{
|
||||
public const string Auth = "/auth";
|
||||
public const string AuthCreate = "create";
|
||||
public const string AuthCreateIdent = "createWithIdent";
|
||||
public static string AuthFullPath = Auth + "/" + AuthCreateIdent;
|
||||
}
|
||||
public interface IMareHub
|
||||
{
|
||||
const int ApiVersion = 17;
|
||||
const int ApiVersion = 18;
|
||||
const string Path = "/mare";
|
||||
|
||||
Task FilesAbortUpload();
|
||||
|
||||
12
MareSynchronosAPI/MareAuth.cs
Normal file
12
MareSynchronosAPI/MareAuth.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace MareSynchronos.API
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
24
MareSynchronosAPI/MareFiles.cs
Normal file
24
MareSynchronosAPI/MareFiles.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace MareSynchronos.API
|
||||
{
|
||||
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_CheckQueue = "status";
|
||||
|
||||
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 RequestCheckQueueFullPath(Uri baseUri, Guid requestId) => new(baseUri, Request + "/" + Request_CheckQueue + "?requestId=" + requestId.ToString());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
15
MareSynchronosAPI/QueueRequestDto.cs
Normal file
15
MareSynchronosAPI/QueueRequestDto.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MareSynchronos.API;
|
||||
|
||||
public record QueueRequestDto(Guid RequestId, QueueStatus QueueStatus);
|
||||
|
||||
public enum QueueStatus
|
||||
{
|
||||
Ready,
|
||||
Waiting
|
||||
}
|
||||
Reference in New Issue
Block a user