增加事件类型简单名称,方便配置枚举,知道是什么事件
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
f41bf281fe
commit
650f4706a8
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
17800
IRaCIS.Core.Infra.EFCore/Migrations/20241012022610_AddEventTypeName.Designer.cs
generated
Normal file
17800
IRaCIS.Core.Infra.EFCore/Migrations/20241012022610_AddEventTypeName.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -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: "完整的事件类型名");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue