Files
Swarm/DysonNetwork.Drive/Models/CloudFile.cs

68 lines
1.7 KiB
C#

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);
}
}