49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace FileShare_EFCore.Models
|
|
{
|
|
/// <summary>
|
|
/// 文件缩略图映射记录,存储视频缩略图的文件路径与内容类型。
|
|
/// </summary>
|
|
[Comment("文件缩略图映射记录")]
|
|
[Table("managed-thumbnail-map")]
|
|
public class ManagedThumbnailMap
|
|
{
|
|
/// <summary>主键 ID。</summary>
|
|
[Key]
|
|
[Column("id")]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>所属根目录 ID。</summary>
|
|
[Column("library-root-id")]
|
|
public int LibraryRootId { get; set; }
|
|
|
|
/// <summary>缩略图相对于缩略图存储根目录的路径。</summary>
|
|
[Column("relative-path")]
|
|
[MaxLength(1024)]
|
|
public string RelativePath { get; set; } = string.Empty;
|
|
|
|
/// <summary>缩略图的 MIME 类型。</summary>
|
|
[Column("content-type")]
|
|
[MaxLength(100)]
|
|
public string ContentType { get; set; } = "image/jpeg";
|
|
|
|
/// <summary>创建时间 UTC。</summary>
|
|
[Column("created-at")]
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
/// <summary>更新时间 UTC。</summary>
|
|
[Column("updated-at")]
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
/// <summary>所属根目录。</summary>
|
|
public ManagedLibraryRoot? LibraryRoot { get; set; }
|
|
|
|
/// <summary>引用了此缩略图的文件记录。</summary>
|
|
public List<ManagedFileRecord> Files { get; set; } = new();
|
|
}
|
|
}
|