28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
|
|
namespace Meezi.Core.Entities;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// A stored upload, recorded so identical files can be de-duplicated and reused
|
||
|
|
/// instead of written to disk again. Files with the same content hash within a
|
||
|
|
/// scope (café, or platform when <see cref="CafeId"/> is null) share one stored file.
|
||
|
|
/// </summary>
|
||
|
|
public class MediaAsset : BaseEntity
|
||
|
|
{
|
||
|
|
/// <summary>Owning café, or null for platform-level (admin) uploads.</summary>
|
||
|
|
public string? CafeId { get; set; }
|
||
|
|
|
||
|
|
/// <summary>SHA-256 of the file content, lowercase hex.</summary>
|
||
|
|
public string ContentHash { get; set; } = string.Empty;
|
||
|
|
|
||
|
|
public long SizeBytes { get; set; }
|
||
|
|
|
||
|
|
public string ContentType { get; set; } = string.Empty;
|
||
|
|
|
||
|
|
/// <summary>Public URL/path the file is served from (e.g. /uploads/{cafeId}/{name}).</summary>
|
||
|
|
public string Url { get; set; } = string.Empty;
|
||
|
|
|
||
|
|
/// <summary>Logical kind/prefix: menu_img, logo, cover, gallery, review, menu_3d, blog, ...</summary>
|
||
|
|
public string Kind { get; set; } = string.Empty;
|
||
|
|
|
||
|
|
public string? OriginalFileName { get; set; }
|
||
|
|
}
|