Глобальный рефакторинг пространств имён
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Pf2e.Database.Model.Base.Targets;
|
||||
|
||||
/// <summary>
|
||||
/// Внешняя ссылка сущности.
|
||||
/// </summary>
|
||||
[PrimaryKey(nameof(EntityId), nameof(TargetId))]
|
||||
public class EntityExternal
|
||||
{
|
||||
/// <summary>
|
||||
/// Идентификатор сущности.
|
||||
/// </summary>
|
||||
[Column(Order = 1)]
|
||||
[Comment("Идентификатор сущности")]
|
||||
public int EntityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор цели.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[Comment("Идентификатор цели")]
|
||||
public int TargetId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Идентификатор элемента по ссылке.
|
||||
/// </summary>
|
||||
[Column(Order = 3)]
|
||||
[MaxLength(255)]
|
||||
[Comment("Идентификатор элемента в ссылке")]
|
||||
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 Entity Entity { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Цель внешней ссылки.
|
||||
/// </summary>
|
||||
public ExternalTarget Target { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Pf2e.Database.Model.Base.Targets;
|
||||
|
||||
/// <summary>
|
||||
/// Цель внешней ссылки.
|
||||
/// </summary>
|
||||
public class ExternalTarget
|
||||
{
|
||||
/// <summary>
|
||||
/// Идентификатор цели.
|
||||
/// </summary>
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column(Order = 1)]
|
||||
[Comment("Идентификатор")]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Название цели.
|
||||
/// </summary>
|
||||
[Column(Order = 2)]
|
||||
[StringLength(Pf2eDbContext.NameLength)]
|
||||
[Comment("Отображаемое имя")]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Иконка цели.
|
||||
/// </summary>
|
||||
[Column(Order = 3)]
|
||||
[StringLength(255)]
|
||||
[Comment("Иконка цели")]
|
||||
public string Icon { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Префикс для URL-адреса внешней ссылки.
|
||||
/// </summary>
|
||||
[Column(Order = 3)]
|
||||
[StringLength(Pf2eDbContext.NameLength)]
|
||||
[Comment("Префикс для URL-адреса внешней ссылки")]
|
||||
public string Prefix { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Коллекция сущностей, которые ссылаются на эту цель.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public ICollection<EntityExternal> EntityExternals { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user