♻️ Extract the Storage service to DysonNetwork.Drive microservice
This commit is contained in:
61
DysonNetwork.Drive/Models/CloudFileReference.cs
Normal file
61
DysonNetwork.Drive/Models/CloudFileReference.cs
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user