Переосмысление аттрибутов переберающих процессоров и устаревшых элементов
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base.Keywords;
|
||||
using Pf2eModel.Model.Base.Legacy;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
@@ -99,4 +100,9 @@ public class Entity
|
||||
/// Коллекция внешних ссылок, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<EntityExternal> Externals { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция устаревших сущностей.
|
||||
/// </summary>
|
||||
public IEnumerable<LegacyEntity> LegacyEntities { get; set; } = [];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
|
||||
namespace Pf2eModel.Model.Base.Legacy;
|
||||
|
||||
/// <summary>
|
||||
/// Информация об устаревшей сущности
|
||||
/// </summary>
|
||||
public class LegacyEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Идентификатор сущности.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column(Order = 1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Отображаемое имя сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[Comment("Отображаемое имя")]
|
||||
public LocaleString Name { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция обновлённых сущностей.
|
||||
/// </summary>
|
||||
public ICollection<Entity> RemasterEntities { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция источников, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<LegacyEntitySource> Sources { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция внешних ссылок, связанных с сущностью.
|
||||
/// </summary>
|
||||
public ICollection<LegacyEntityExternal> Externals { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
|
||||
namespace Pf2eModel.Model.Base.Legacy;
|
||||
|
||||
/// <summary>
|
||||
/// Внешняя ссылка сущности.
|
||||
/// </summary>
|
||||
[PrimaryKey(nameof(LegacyEntityId), nameof(TargetId))]
|
||||
public class LegacyEntityExternal
|
||||
{
|
||||
/// <summary>
|
||||
/// Идентификатор сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 1)]
|
||||
[Comment("Идентификатор сущности")]
|
||||
public int LegacyEntityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор цели.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[Comment("Идентификатор цели")]
|
||||
public int TargetId { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(255)]
|
||||
public string? ExternalId { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Конечная часть URL внешней ссылки.
|
||||
/// Для источников Foundry - полный UUID объекта.
|
||||
/// </summary>
|
||||
[Column(Order = 4)]
|
||||
[MaxLength(255)]
|
||||
[Comment("Часть URL до объекта. Для источников Foundry - полный UUID объекта")]
|
||||
public string Suffix { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Контрольная сумма объекта.
|
||||
/// </summary>
|
||||
[Column(Order = 5)]
|
||||
[MaxLength(32)]
|
||||
[Comment("Контрольная сумма объекта")]
|
||||
public string Md5 { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Сущность, которая ссылается на внешнюю ссылку.
|
||||
/// </summary>
|
||||
public LegacyEntity LegacyEntity { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Цель внешней ссылки.
|
||||
/// </summary>
|
||||
public ExternalTarget Target { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Pf2eModel.Model.Base.Legacy;
|
||||
|
||||
/// <summary>
|
||||
/// Связь между сущностью и источником.
|
||||
/// </summary>
|
||||
public class LegacyEntitySource
|
||||
{
|
||||
/// <summary>
|
||||
/// Идентификатор связи.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column(Order = 0)]
|
||||
[Comment("Идентификатор")]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор устаревшей сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 1)]
|
||||
[Comment("Идентификатор устаревшей сущности")]
|
||||
public int LegacyEntityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор источника.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[Comment("Идентификатор источника")]
|
||||
public int SourceId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Дополнительная информация о источнике, например, номер страницы, номер тома и т.д.
|
||||
/// </summary>
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(255)]
|
||||
[Comment("Номер страницы, эррата и т.д.")]
|
||||
public string Suffix { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Флаг, указывающий, что объект является частью ремастера.
|
||||
/// </summary>
|
||||
[Column(Order = 4)]
|
||||
[Comment("Флаг, указывающий, что объект является частью ремастера")]
|
||||
public bool IsRemaster { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Сущность, к которой относится источник.
|
||||
/// </summary>
|
||||
public LegacyEntity LegacyEntity { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Источник, к которому относится сущность.
|
||||
/// </summary>
|
||||
public Source.Source Source { get; set; } = null!;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base.Legacy;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Base.Source;
|
||||
@@ -45,4 +46,9 @@ public class Source
|
||||
/// Связанные сущности.
|
||||
/// </summary>
|
||||
public ICollection<EntitySource> EntitySources { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Связанные сущности.
|
||||
/// </summary>
|
||||
public ICollection<LegacyEntitySource> LegacyEntitySources { get; set; } = [];
|
||||
}
|
||||
|
||||
@@ -24,11 +24,9 @@ public class EntityExternal
|
||||
[Comment("Идентификатор цели")]
|
||||
public int TargetId { get; set; }
|
||||
|
||||
/*
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(255)]
|
||||
public string ExternalId { get; set; } = "";
|
||||
*/
|
||||
public string? ExternalId { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Конечная часть URL внешней ссылки.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base.Legacy;
|
||||
|
||||
namespace Pf2eModel.Model.Base.Targets;
|
||||
|
||||
@@ -46,4 +47,9 @@ public class ExternalTarget
|
||||
/// Коллекция сущностей, которые ссылаются на эту цель.
|
||||
/// </summary>
|
||||
public ICollection<EntityExternal> EntityExternals { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция устаревших сущностей, которые ссылаются на эту цель.
|
||||
/// </summary>
|
||||
public ICollection<LegacyEntityExternal> LegacyEntityExternals { get; set; } = [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user