fix: align backend APIs and upload flow

This commit is contained in:
2026-09-15 14:10:55 +08:00
parent 32177a7293
commit 53e6195938
149 changed files with 4791 additions and 435 deletions
@@ -15,12 +15,14 @@ namespace FileService.Infrastructure.Configs
{
builder.ToTable("upload_files");
builder.Property(x => x.FileName)
.HasMaxLength(255)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.FileName(b)
);
builder.Property(x => x.ContentType)
.HasMaxLength(255)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.ContentType(b)
@@ -29,24 +31,32 @@ namespace FileService.Infrastructure.Configs
builder.ComplexProperty(x => x.CheckSum, c =>
{
c.Property(p => p.Value)
.HasMaxLength(128)
.HasColumnName("checksum_value");
c.Property(p => p.Algorithm)
.HasMaxLength(16)
.HasColumnName("checksum_algorithm");
});
builder.HasIndex(x => x.SourceTaskId).IsUnique();
builder.Property(x => x.ChatType).HasMaxLength(16);
builder.ComplexProperty(x => x.StorageLocation, c =>
{
c.Property(p => p.StorageProvider)
.HasMaxLength(64)
.HasColumnName("storage_provider");
c.Property(p => p.ObjectKey)
.HasMaxLength(1024)
.HasColumnName("storage_key");
c.Property(p => p.Region)
.HasMaxLength(128)
.HasColumnName("storage_region");
c.Property(p => p.Bucket)
.HasMaxLength(255)
.HasColumnName("storage_bucket");
});
}
@@ -15,12 +15,14 @@ namespace FileService.Infrastructure.Configs
{
builder.ToTable("upload_tasks");
builder.Property(x => x.FileName)
.HasMaxLength(255)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.FileName(b)
);
builder.Property(x => x.ContentType)
.HasMaxLength(255)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.ContentType(b)
@@ -29,24 +31,32 @@ namespace FileService.Infrastructure.Configs
builder.ComplexProperty(x => x.CheckSum, c =>
{
c.Property(p => p.Value)
.HasMaxLength(128)
.HasColumnName("checksum_value");
c.Property(p => p.Algorithm)
.HasMaxLength(16)
.HasColumnName("checksum_algorithm");
});
builder.Property(x => x.FailureReason).HasMaxLength(500);
builder.Property(x => x.ChatType).HasMaxLength(16);
builder.ComplexProperty(x => x.StorageLocation, c =>
{
c.Property(p => p.StorageProvider)
.HasMaxLength(64)
.HasColumnName("storage_provider");
c.Property(p => p.ObjectKey)
.HasMaxLength(1024)
.HasColumnName("storage_key");
c.Property(p => p.Region)
.HasMaxLength(128)
.HasColumnName("storage_region");
c.Property(p => p.Bucket)
.HasMaxLength(255)
.HasColumnName("storage_bucket");
});
}