feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
|
|
@ -203,6 +203,58 @@ public class SttUsageLog
|
|||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class AdminOperationRequest
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required, MaxLength(150)]
|
||||
public string ActorEmail { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(36)]
|
||||
public string IdempotencyKey { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(100)]
|
||||
public string Operation { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(64)]
|
||||
public string RequestHash { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string ResponseJson { get; set; } = string.Empty;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class AdminAuditEntry
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required, MaxLength(150)]
|
||||
public string ActorEmail { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(100)]
|
||||
public string Action { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(80)]
|
||||
public string TargetType { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(200)]
|
||||
public string TargetId { get; set; } = string.Empty;
|
||||
|
||||
public string? BeforeJson { get; set; }
|
||||
public string? AfterJson { get; set; }
|
||||
|
||||
[Required, MaxLength(1000)]
|
||||
public string Memo { get; set; } = string.Empty;
|
||||
|
||||
[Required, MaxLength(36)]
|
||||
public string IdempotencyKey { get; set; } = string.Empty;
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public class AppDbContext : DbContext
|
||||
{
|
||||
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
|
||||
|
|
@ -213,6 +265,8 @@ public class AppDbContext : DbContext
|
|||
public DbSet<ServerErrorLog> ErrorLogs => Set<ServerErrorLog>();
|
||||
public DbSet<SttProviderEndpoint> SttProviderEndpoints => Set<SttProviderEndpoint>();
|
||||
public DbSet<SttUsageLog> SttUsageLogs => Set<SttUsageLog>();
|
||||
public DbSet<AdminOperationRequest> AdminOperationRequests => Set<AdminOperationRequest>();
|
||||
public DbSet<AdminAuditEntry> AdminAuditEntries => Set<AdminAuditEntry>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
|
|
@ -231,5 +285,12 @@ public class AppDbContext : DbContext
|
|||
|
||||
modelBuilder.Entity<SttProviderEndpoint>()
|
||||
.HasIndex(s => s.IsDefault);
|
||||
|
||||
modelBuilder.Entity<AdminOperationRequest>()
|
||||
.HasIndex(operation => new { operation.ActorEmail, operation.IdempotencyKey })
|
||||
.IsUnique();
|
||||
|
||||
modelBuilder.Entity<AdminAuditEntry>()
|
||||
.HasIndex(entry => entry.CreatedAt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue