2021-07-23 17:40:31 +05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
2021-07-26 11:54:50 +05:00
|
|
|
|
using System.Text.Json.Serialization;
|
2021-07-23 17:40:31 +05:00
|
|
|
|
|
|
|
|
|
namespace AsbCloudDb.Model
|
|
|
|
|
{
|
2021-08-13 17:26:19 +05:00
|
|
|
|
[Table("t_file_info"), Comment("Файлы всех категорий")]
|
|
|
|
|
public class FileInfo : IId, IIdWell
|
2021-07-23 17:40:31 +05:00
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
[Column("id")]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("id_well"), Comment("id скважины")]
|
|
|
|
|
public int IdWell { get; set; }
|
|
|
|
|
|
2021-07-27 16:55:32 +05:00
|
|
|
|
[Column("id_author"), Comment("Id пользователя, загрузившего файл")]
|
2021-09-01 15:55:10 +05:00
|
|
|
|
public int? IdAuthor { get; set; }
|
2021-07-26 11:54:50 +05:00
|
|
|
|
|
2021-07-23 17:40:31 +05:00
|
|
|
|
[Column("id_category"), Comment("id категории файла")]
|
|
|
|
|
public int IdCategory { get; set; }
|
|
|
|
|
|
2021-07-26 11:54:50 +05:00
|
|
|
|
[Column("name"), Comment("Название файла")]
|
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
|
2021-07-23 17:40:31 +05:00
|
|
|
|
[Column("date", TypeName = "timestamp with time zone")]
|
2021-08-13 17:26:19 +05:00
|
|
|
|
public DateTime UploadDate { get; set; }
|
2021-07-23 17:40:31 +05:00
|
|
|
|
|
2021-08-31 12:29:27 +05:00
|
|
|
|
[Column("file_size"), Comment("Размер файла")]
|
|
|
|
|
public long Size { get; set; }
|
2021-10-27 17:00:27 +05:00
|
|
|
|
|
2021-10-29 12:47:18 +05:00
|
|
|
|
[Column("publish_info", TypeName = "jsonb"), Comment("Информация о файле в облаке")]
|
|
|
|
|
public FilePublishInfo PublishInfo { get; set; }
|
2021-08-31 12:29:27 +05:00
|
|
|
|
|
2021-07-27 16:55:32 +05:00
|
|
|
|
[Column("is_deleted"), Comment("Удален ли файл")]
|
|
|
|
|
public bool IsDeleted { get; set; }
|
|
|
|
|
|
2021-07-26 11:54:50 +05:00
|
|
|
|
[JsonIgnore]
|
|
|
|
|
[ForeignKey(nameof(IdWell))]
|
|
|
|
|
public virtual Well Well { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
2021-07-27 16:55:32 +05:00
|
|
|
|
[ForeignKey(nameof(IdAuthor))]
|
2021-08-13 17:26:19 +05:00
|
|
|
|
public virtual User Author { get; set; }
|
2021-07-26 11:54:50 +05:00
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
[ForeignKey(nameof(IdCategory))]
|
|
|
|
|
public virtual FileCategory FileCategory { get; set; }
|
2021-07-23 17:40:31 +05:00
|
|
|
|
}
|
|
|
|
|
}
|