forked from ddrilling/AsbCloudServer
56 lines
1.9 KiB
C#
56 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel.DataAnnotations;
|
||
using System.ComponentModel.DataAnnotations.Schema;
|
||
using System.Text.Json.Serialization;
|
||
|
||
namespace AsbCloudDb.Model
|
||
{
|
||
[Table("t_file_info"), Comment("Файлы всех категорий")]
|
||
public class FileInfo : IId, IIdWell
|
||
{
|
||
[Key]
|
||
[Column("id")]
|
||
public int Id { get; set; }
|
||
|
||
[Column("id_well"), Comment("id скважины")]
|
||
public int IdWell { get; set; }
|
||
|
||
[Column("id_author"), Comment("Id пользователя, загрузившего файл")]
|
||
public int? IdAuthor { get; set; }
|
||
|
||
[Column("id_category"), Comment("id категории файла")]
|
||
public int IdCategory { get; set; }
|
||
|
||
[Column("name"), Comment("Название файла")]
|
||
public string Name { get; set; }
|
||
|
||
[Column("date", TypeName = "timestamp with time zone")]
|
||
public DateTimeOffset UploadDate { get; set; }
|
||
|
||
[Column("file_size"), Comment("Размер файла")]
|
||
public long Size { get; set; }
|
||
|
||
[Column("publish_info", TypeName = "jsonb"), Comment("Информация о файле в облаке")]
|
||
public FilePublishInfo PublishInfo { get; set; }
|
||
|
||
[Column("is_deleted"), Comment("Удален ли файл")]
|
||
public bool IsDeleted { get; set; }
|
||
|
||
[JsonIgnore]
|
||
[ForeignKey(nameof(IdWell))]
|
||
public virtual Well Well { get; set; }
|
||
|
||
[JsonIgnore]
|
||
[ForeignKey(nameof(IdAuthor))]
|
||
public virtual User Author { get; set; }
|
||
|
||
[JsonIgnore]
|
||
[ForeignKey(nameof(IdCategory))]
|
||
public virtual FileCategory FileCategory { get; set; }
|
||
|
||
[InverseProperty(nameof(FileMark.FileInfo))]
|
||
public virtual ICollection<FileMark> FileMarks { get; set; }
|
||
}
|
||
} |