3.6 KiB
3.6 KiB
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 03- | 03 | execute | 2 |
|
|
true |
|
|
计划 03: 更新 Infrastructure 层
目标
更新 PlatformDbContext 配置,创建 IClusterStore 接口和实现,替换原有的 IInstanceStore。
目的: 支持新的 GwCluster 聚合根,移除已废弃的实体 DbSet。
输出: 更新的 PlatformDbContext、IClusterStore/ClusterStore。
上下文
@Fengling.Platform.Infrastructure/PlatformDbContext.cs @Fengling.Platform.Infrastructure/IInstanceStore.cs @Fengling.Platform.Infrastructure/RouteStore.cs (参考模式)
任务
任务 1: 更新 PlatformDbContext Fengling.Platform.Infrastructure/PlatformDbContext.cs 1. 移除 DbSet: - 移除 DbSet<GwTenant> GwTenants - 移除 DbSet<GwServiceInstance> GwServiceInstances-
添加 DbSet:
- 添加 DbSet<GwCluster> GwClusters
-
在 OnModelCreating 中配置:
- GwCluster 聚合根配置
- OwnsMany GwDestinations 配置
- OwnsOne GwHealthCheckConfig 配置
- OwnsOne GwSessionAffinityConfig 配置
参考 03-RESEARCH.md 中的 EF Core 配置代码。 dotnet build 通过 PlatformDbContext 已更新
任务 2: 创建 IClusterStore 接口 Fengling.Platform.Infrastructure/IClusterStore.cs 创建 IClusterStore 接口,包含: - FindByIdAsync, FindByClusterIdAsync - GetAllAsync, GetPagedAsync, GetCountAsync - CreateAsync, UpdateAsync, DeleteAsync - AddDestinationAsync, UpdateDestinationAsync, RemoveDestinationAsync参考 IRouteStore 模式。 文件可编译 IClusterStore 接口已创建
任务 3: 创建 ClusterStore 实现 Fengling.Platform.Infrastructure/ClusterStore.cs 创建 ClusterStore<TContext> 实现 IClusterStore: - 泛型约束: where TContext : PlatformDbContext - 实现所有接口方法 - 支持软删除 - 支持内嵌 Destination 的 CRUD参考 RouteStore 模式。 dotnet build 通过 ClusterStore 实现已创建
任务 4: 删除 IInstanceStore 和 InstanceStore Fengling.Platform.Infrastructure/IInstanceStore.cs Fengling.Platform.Infrastructure/InstanceStore.cs 删除这两个文件: - 已被 IClusterStore/ClusterStore 替代 - 确认无其他引用 dotnet build 通过 旧文件已删除验证
- PlatformDbContext 已更新
- IClusterStore/ClusterStore 已创建
- 旧文件已删除
- Build 无错误通过
成功标准
Infrastructure 层更新完成,准备更新 DI 注册。