feat: 身份操作日志改造为Outbox并修正日志库连接
This commit is contained in:
@@ -35,6 +35,11 @@ public sealed class TakeoutLogsDbContext(
|
||||
/// </summary>
|
||||
public DbSet<OperationLog> OperationLogs => Set<OperationLog>();
|
||||
|
||||
/// <summary>
|
||||
/// 操作日志消息去重集合。
|
||||
/// </summary>
|
||||
public DbSet<OperationLogInboxMessage> OperationLogInboxMessages => Set<OperationLogInboxMessage>();
|
||||
|
||||
/// <summary>
|
||||
/// 成长值日志集合。
|
||||
/// </summary>
|
||||
@@ -50,6 +55,7 @@ public sealed class TakeoutLogsDbContext(
|
||||
ConfigureTenantAuditLog(modelBuilder.Entity<TenantAuditLog>());
|
||||
ConfigureMerchantAuditLog(modelBuilder.Entity<MerchantAuditLog>());
|
||||
ConfigureOperationLog(modelBuilder.Entity<OperationLog>());
|
||||
ConfigureOperationLogInboxMessage(modelBuilder.Entity<OperationLogInboxMessage>());
|
||||
ConfigureMemberGrowthLog(modelBuilder.Entity<MemberGrowthLog>());
|
||||
}
|
||||
|
||||
@@ -91,6 +97,15 @@ public sealed class TakeoutLogsDbContext(
|
||||
builder.HasIndex(x => x.CreatedAt);
|
||||
}
|
||||
|
||||
private static void ConfigureOperationLogInboxMessage(EntityTypeBuilder<OperationLogInboxMessage> builder)
|
||||
{
|
||||
builder.ToTable("operation_log_inbox_messages");
|
||||
builder.HasKey(x => x.Id);
|
||||
builder.Property(x => x.MessageId).IsRequired();
|
||||
builder.Property(x => x.ConsumedAt).IsRequired();
|
||||
builder.HasIndex(x => x.MessageId).IsUnique();
|
||||
}
|
||||
|
||||
private static void ConfigureMemberGrowthLog(EntityTypeBuilder<MemberGrowthLog> builder)
|
||||
{
|
||||
builder.ToTable("member_growth_logs");
|
||||
|
||||
Reference in New Issue
Block a user