Fast upload API

This commit is contained in:
2025-08-09 01:20:51 +08:00
parent d8c1c63e56
commit 0ed47be689
4 changed files with 86 additions and 3 deletions

View File

@@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using DysonNetwork.Shared.Data;
using DysonNetwork.Shared.Proto;
using Google.Protobuf;
using NodaTime;
using NodaTime.Serialization.Protobuf;
@@ -13,7 +12,7 @@ public class CloudFile : ModelBase, ICloudFile, IIdentifiedResource
{
/// The id generated by TuS, basically just UUID remove the dash lines
[MaxLength(32)]
public string Id { get; set; } = Guid.NewGuid().ToString();
public string Id { get; set; } = Guid.NewGuid().ToString().Replace("-", string.Empty);
[MaxLength(1024)] public string Name { get; set; } = string.Empty;
[MaxLength(4096)] public string? Description { get; set; }
@@ -58,6 +57,10 @@ public class CloudFile : ModelBase, ICloudFile, IIdentifiedResource
[MaxLength(4096)]
public string? StorageUrl { get; set; }
[NotMapped]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FastUploadLink { get; set; }
public Guid AccountId { get; set; }
public CloudFileReferenceObject ToReferenceObject()
@@ -138,4 +141,4 @@ public class CloudFileReference : ModelBase
ExpiredAt = ExpiredAt?.ToTimestamp()
};
}
}
}