- 新增 GatewayAggregate 领域实体 (GwTenant, GwTenantRoute, GwServiceInstance) - 新增 IRouteStore, RouteStore, IInstanceStore, InstanceStore - 新增 IRouteManager, RouteManager - 合并 GatewayDbContext 到 PlatformDbContext - 统一 Extensions.AddPlatformCore 注册所有服务
4.3 KiB
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-gateway-routing | 01 | execute | 1 |
|
true |
|
|
计划 01: 网关领域实体
目标
创建从 fengling-gateway 项目迁移的网关路由领域实体。
目的: 在 Platform 领域层建立网关聚合,包含符合 YARP 要求的实体。
输出: 新建 GatewayAggregate 文件夹中的三个实体文件。
上下文
@Fengling.Platform.Domain/AggregatesModel/ (现有 Tenant 聚合结构) @../fengling-gateway/src/Models/ (源实体)
任务
任务 1: 创建 GatewayEnums Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GatewayEnums.cs 创建网关实体使用的枚举类型: - RouteStatus (Active=1, Inactive=0) - InstanceHealth (Healthy=1, Unhealthy=0) - InstanceStatus (Active=1, Inactive=0)参考现有: Fengling.Platform.Domain/AggregatesModel/TenantAggregate/Tenant.cs 文件可编译,枚举可访问 GatewayEnums.cs 已创建,包含 RouteStatus, InstanceHealth, InstanceStatus
任务 2: 创建 GwTenant 实体 Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwTenant.cs 创建 GwTenant 实体,包含: - Id (long), TenantCode (string), TenantName (string) - Status (int), IsDeleted (bool), Version (int) - CreatedTime, UpdatedTime, CreatedBy, UpdatedBy参考源: ../fengling-gateway/src/Models/GwTenant.cs 参考模式: Fengling.Platform.Domain/AggregatesModel/TenantAggregate/Tenant.cs dotnet build 通过 GwTenant 实体包含 Id, TenantCode, TenantName, Status 字段
任务 3: 创建 GwTenantRoute 实体 Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwTenantRoute.cs 创建 GwTenantRoute 实体,包含: - Id (long), TenantCode (string), ServiceName (string) - ClusterId (string), PathPattern (string), Priority (int) - Status (int), IsGlobal (bool) - IsDeleted (bool), Version (int) - CreatedTime, UpdatedTime, CreatedBy, UpdatedBy参考源: ../fengling-gateway/src/Models/GwTenantRoute.cs dotnet build 通过 GwTenantRoute 实体包含路由配置字段
任务 4: 创建 GwServiceInstance 实体 Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwServiceInstance.cs 创建 GwServiceInstance 实体,包含: - Id (long), ClusterId (string), DestinationId (string) - Address (string), Health (int), Weight (int) - Status (int) - IsDeleted (bool), Version (int) - CreatedTime, UpdatedTime, CreatedBy, UpdatedBy参考源: ../fengling-gateway/src/Models/GwServiceInstance.cs dotnet build 通过 GwServiceInstance 实体包含实例管理字段
验证
- 所有 4 个实体文件已创建
- Build 无错误通过
- 实体遵循 Platform 约定 (long ID, PascalCase, 时间戳)
成功标准
领域实体准备好进行基础设施层实现。