♻️ Extract the Storage service to DysonNetwork.Drive microservice

This commit is contained in:
2025-07-06 17:29:26 +08:00
parent 6a3d04af3d
commit 14b79f16f4
71 changed files with 2629 additions and 346 deletions

View File

@ -0,0 +1,61 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json;
using System.Text.Json.Serialization;
using NodaTime;
namespace DysonNetwork.Drive.Models;
public class CloudFileReference : ModelBase
{
public Guid Id { get; set; } = Guid.NewGuid();
[MaxLength(2048)]
public string ResourceId { get; set; } = null!;
[MaxLength(256)]
public string ResourceType { get; set; } = null!;
[MaxLength(256)]
public string ReferenceType { get; set; } = null!;
[MaxLength(256)]
public string? ReferenceId { get; set; }
[MaxLength(256)]
public string? ReferenceName { get; set; }
[MaxLength(256)]
public string? ReferenceMimeType { get; set; }
public long? ReferenceSize { get; set; }
[MaxLength(1024)]
public string? ReferenceUrl { get; set; }
[MaxLength(1024)]
public string? ReferenceThumbnailUrl { get; set; }
[MaxLength(1024)]
public string? ReferencePreviewUrl { get; set; }
[MaxLength(1024)]
public string? ReferenceMetadata { get; set; }
[Column(TypeName = "jsonb")]
public JsonDocument? Metadata { get; set; }
public bool IsActive { get; set; } = true;
public Instant? ExpiresAt { get; set; }
public Guid FileId { get; set; }
public virtual CloudFile File { get; set; } = null!;
public void Dispose()
{
Metadata?.Dispose();
GC.SuppressFinalize(this);
}
}