♻️ 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,67 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json;
using NodaTime;
namespace DysonNetwork.Drive.Models;
public class CloudFile : ModelBase
{
public Guid Id { get; set; } = Guid.NewGuid();
[MaxLength(256)]
public string Name { get; set; } = null!;
[MaxLength(1024)]
public string OriginalName { get; set; } = null!;
[MaxLength(256)]
public string MimeType { get; set; } = null!;
public long Size { get; set; }
[MaxLength(1024)]
public string StoragePath { get; set; } = null!;
[MaxLength(64)]
public string StorageProvider { get; set; } = "local";
[MaxLength(64)]
public string? ContentHash { get; set; }
[MaxLength(1024)]
public string? ThumbnailPath { get; set; }
[MaxLength(1024)]
public string? PreviewPath { get; set; }
public int? Width { get; set; }
public int? Height { get; set; }
public float? Duration { get; set; }
[MaxLength(1024)]
public string? Metadata { get; set; }
[Column(TypeName = "jsonb")]
public JsonDocument? ExtendedMetadata { get; set; }
public bool IsPublic { get; set; }
public bool IsTemporary { get; set; }
public bool IsDeleted { get; set; }
public Instant? ExpiresAt { get; set; }
public new Instant? DeletedAt { get; set; }
public Guid? UploadedById { get; set; }
public string? UploadedByType { get; set; }
public ICollection<CloudFileReference> References { get; set; } = new List<CloudFileReference>();
public void Dispose()
{
ExtendedMetadata?.Dispose();
GC.SuppressFinalize(this);
}
}