添加项目文件。

This commit is contained in:
2026-05-09 17:06:30 +08:00
parent c60f5fe117
commit 720ef957d4
378 changed files with 14843 additions and 0 deletions
@@ -0,0 +1,54 @@
using FileService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FileService.Infrastructure.Configs
{
public class UploadFileConfig : IEntityTypeConfiguration<UploadFile>
{
public void Configure(EntityTypeBuilder<UploadFile> builder)
{
builder.ToTable("upload_files");
builder.Property(x => x.FileName)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.FileName(b)
);
builder.Property(x => x.ContentType)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.ContentType(b)
);
builder.ComplexProperty(x => x.CheckSum, c =>
{
c.Property(p => p.Value)
.HasColumnName("checksum_value");
c.Property(p => p.Algorithm)
.HasColumnName("checksum_algorithm");
});
builder.ComplexProperty(x => x.StorageLocation, c =>
{
c.Property(p => p.StorageProvider)
.HasColumnName("storage_provider");
c.Property(p => p.ObjectKey)
.HasColumnName("storage_key");
c.Property(p => p.Region)
.HasColumnName("storage_region");
c.Property(p => p.Bucket)
.HasColumnName("storage_bucket");
});
}
}
}
@@ -0,0 +1,54 @@
using FileService.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FileService.Infrastructure.Configs
{
public class UploadTaskConfig : IEntityTypeConfiguration<UploadTask>
{
public void Configure(EntityTypeBuilder<UploadTask> builder)
{
builder.ToTable("upload_tasks");
builder.Property(x => x.FileName)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.FileName(b)
);
builder.Property(x => x.ContentType)
.HasConversion(
a => a.Value,
b => new Domain.ValueObjects.ContentType(b)
);
builder.ComplexProperty(x => x.CheckSum, c =>
{
c.Property(p => p.Value)
.HasColumnName("checksum_value");
c.Property(p => p.Algorithm)
.HasColumnName("checksum_algorithm");
});
builder.ComplexProperty(x => x.StorageLocation, c =>
{
c.Property(p => p.StorageProvider)
.HasColumnName("storage_provider");
c.Property(p => p.ObjectKey)
.HasColumnName("storage_key");
c.Property(p => p.Region)
.HasColumnName("storage_region");
c.Property(p => p.Bucket)
.HasColumnName("storage_bucket");
});
}
}
}