增加事件类型简单名称,方便配置枚举,知道是什么事件
continuous-integration/drone/push Build is passing Details

IRC_NewDev
hang 2024-10-12 10:29:03 +08:00
parent f41bf281fe
commit 650f4706a8
5 changed files with 17867 additions and 2 deletions

View File

@ -10,6 +10,11 @@ namespace IRaCIS.Core.Domain.Models;
[Table("EventStoreRecord")]
public class EventStoreRecord : BaseFullAuditEntity
{
[Comment("简单的事件类型名")]
public string EventTypeName { get; set; }
[Comment("完整的事件类型名")]
public string EventType { get; set; }
[MaxLength]

View File

@ -274,7 +274,7 @@ public static class DBContext_Ext
private static List<EventStoreRecord> GetStoreEvents(IReadOnlyCollection<DomainEvent> domainEvents)
{
return domainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventData = t.ToJsonStr() }).ToList();
return domainEvents.Select(t => new EventStoreRecord() { Id = t.EventId, EventType = t.GetType().AssemblyQualifiedName, EventTypeName=t.GetType().Name, EventData = t.ToJsonStr() }).ToList();
}
public class EnrollmentConfirmAndPD
{

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class AddEventTypeName : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "EventType",
table: "EventStoreRecord",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
comment: "完整的事件类型名",
oldClrType: typeof(string),
oldType: "nvarchar(400)",
oldMaxLength: 400);
migrationBuilder.AddColumn<string>(
name: "EventTypeName",
table: "EventStoreRecord",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "",
comment: "简单的事件类型名");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EventTypeName",
table: "EventStoreRecord");
migrationBuilder.AlterColumn<string>(
name: "EventType",
table: "EventStoreRecord",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(400)",
oldMaxLength: 400,
oldComment: "完整的事件类型名");
}
}
}

View File

@ -2130,7 +2130,14 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<string>("EventType")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
.HasColumnType("nvarchar(400)")
.HasComment("完整的事件类型名");
b.Property<string>("EventTypeName")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)")
.HasComment("简单的事件类型名");
b.Property<DateTime>("UpdateTime")
.HasColumnType("datetime2");