Download rework (#9)
* adjust api for handling download ready from signalr * add cancel request to api * adjust api for cancel * remove outdated method from api * up api version Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
@@ -12,7 +12,7 @@ namespace MareSynchronos.API
|
||||
}
|
||||
public interface IMareHub
|
||||
{
|
||||
const int ApiVersion = 19;
|
||||
const int ApiVersion = 20;
|
||||
const string Path = "/mare";
|
||||
|
||||
Task FilesAbortUpload();
|
||||
@@ -46,9 +46,6 @@ namespace MareSynchronos.API
|
||||
Task GroupUnbanUser(string gid, string uid);
|
||||
Task<List<string>> GroupCreateTempInvite(string gid, int amount);
|
||||
Task<ConnectionDto> GetConnectionDto();
|
||||
[Obsolete]
|
||||
|
||||
Task<ConnectionDto> Heartbeat(string characterIdentification);
|
||||
Task<bool> FilesIsUploadFinished();
|
||||
Task UserPushData(CharacterCacheDto characterCache, List<string> visibleCharacterIds);
|
||||
Task<List<UploadFileDto>> FilesSend(List<string> fileListHashes);
|
||||
@@ -71,6 +68,7 @@ namespace MareSynchronos.API
|
||||
Task Client_AdminUpdateOrAddBannedUser(BannedUserDto dto);
|
||||
Task Client_AdminUpdateOrAddForbiddenFile(ForbiddenFileDto dto);
|
||||
Task Client_ReceiveServerMessage(MessageSeverity messageSeverity, string message);
|
||||
Task Client_DownloadReady(Guid requestId);
|
||||
}
|
||||
|
||||
public interface IMareHubClient : IMareHub
|
||||
@@ -87,5 +85,6 @@ namespace MareSynchronos.API
|
||||
void OnAdminUpdateOrAddBannedUser(Action<BannedUserDto> dto);
|
||||
void OnAdminUpdateOrAddForbiddenFile(Action<ForbiddenFileDto> dto);
|
||||
void OnReceiveServerMessage(Action<MessageSeverity, string> act);
|
||||
void OnDownloadReady(Action<Guid> act);
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,10 @@ namespace MareSynchronos.API
|
||||
public const string Request = "/request";
|
||||
public const string Request_Enqueue = "enqueue";
|
||||
public const string Request_RequestFile = "file";
|
||||
public const string Request_CheckQueue = "status";
|
||||
public const string Request_Cancel = "cancel";
|
||||
|
||||
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());
|
||||
public static Uri RequestCancelFullPath(Uri baseUri, Guid guid) => new Uri(baseUri, Request + "/" + Request_Cancel + "?requestId=" + guid.ToString());
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
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