⚗️ Experimental new file upload API

This commit is contained in:
2025-09-21 16:33:34 +08:00
parent f63c934cee
commit 4d83c2de31
6 changed files with 404 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
using DysonNetwork.Drive.Storage;
using NodaTime;
namespace DysonNetwork.Drive.Storage.Model
{
public class CreateUploadTaskRequest
{
public string Hash { get; set; } = null!;
public string FileName { get; set; } = null!;
public long FileSize { get; set; }
public string ContentType { get; set; } = null!;
public string PoolId { get; set; } = null!;
public string? BundleId { get; set; }
public string? EncryptPassword { get; set; }
public Instant? ExpiredAt { get; set; }
public long? ChunkSize { get; set; }
}
public class CreateUploadTaskResponse
{
public bool FileExists { get; set; }
public CloudFile? File { get; set; }
public string? TaskId { get; set; }
public long? ChunkSize { get; set; }
public int? ChunksCount { get; set; }
}
internal class UploadTask
{
public string TaskId { get; set; } = null!;
public string FileName { get; set; } = null!;
public long FileSize { get; set; }
public string ContentType { get; set; } = null!;
public long ChunkSize { get; set; }
public int ChunksCount { get; set; }
public string PoolId { get; set; } = null!;
public string? BundleId { get; set; }
public string? EncryptPassword { get; set; }
public Instant? ExpiredAt { get; set; }
public string Hash { get; set; } = null!;
}
}