38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
|
|
using Microsoft.EntityFrameworkCore;
|
||
|
|
using System.ComponentModel.DataAnnotations;
|
||
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
||
|
|
|
||
|
|
namespace FileShare_EFCore.Models
|
||
|
|
{
|
||
|
|
[Comment("文件缩略图映射记录")]
|
||
|
|
[Table("managed-thumbnail-map")]
|
||
|
|
public class ManagedThumbnailMap
|
||
|
|
{
|
||
|
|
[Key]
|
||
|
|
[Column("id")]
|
||
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||
|
|
public int Id { get; set; }
|
||
|
|
|
||
|
|
[Column("library-root-id")]
|
||
|
|
public int LibraryRootId { get; set; }
|
||
|
|
|
||
|
|
[Column("relative-path")]
|
||
|
|
[MaxLength(1024)]
|
||
|
|
public string RelativePath { get; set; } = string.Empty;
|
||
|
|
|
||
|
|
[Column("content-type")]
|
||
|
|
[MaxLength(100)]
|
||
|
|
public string ContentType { get; set; } = "image/jpeg";
|
||
|
|
|
||
|
|
[Column("created-at")]
|
||
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||
|
|
|
||
|
|
[Column("updated-at")]
|
||
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
||
|
|
|
||
|
|
public ManagedLibraryRoot? LibraryRoot { get; set; }
|
||
|
|
|
||
|
|
public List<ManagedFileRecord> Files { get; set; } = new();
|
||
|
|
}
|
||
|
|
}
|