forked from ddrilling/AsbCloudServer
53 lines
1.7 KiB
C#
53 lines
1.7 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, IWellRelated
|
|
{
|
|
[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; } = null!;
|
|
|
|
[Column("date", TypeName = "timestamp with time zone")]
|
|
public DateTimeOffset UploadDate { get; set; }
|
|
|
|
[Column("file_size"), Comment("Размер файла")]
|
|
public long Size { get; set; }
|
|
|
|
[Column("is_deleted"), Comment("Удален ли файл")]
|
|
public bool IsDeleted { get; set; }
|
|
|
|
[JsonIgnore]
|
|
[ForeignKey(nameof(IdWell))]
|
|
public virtual Well Well { get; set; } = null!;
|
|
|
|
[JsonIgnore]
|
|
[ForeignKey(nameof(IdAuthor))]
|
|
public virtual User? Author { get; set; }
|
|
|
|
[JsonIgnore]
|
|
[ForeignKey(nameof(IdCategory))]
|
|
public virtual FileCategory FileCategory { get; set; } = null!;
|
|
|
|
[InverseProperty(nameof(FileMark.FileInfo))]
|
|
public virtual ICollection<FileMark> FileMarks { get; set; } = null!;
|
|
}
|
|
} |