fengling-platform/.planning/phases/03-/03-gateway-route-update-SUMMARY.md
2026-03-03 16:10:45 +08:00

2.9 KiB
Raw Blame History

phase plan subsystem tags dependency_graph tech_stack key_files decisions metrics
03- 02 Gateway
gateway
domain
yarp
requires provides affects
03-gateway-cluster-entities
扩展的 GwTenantRoute 实体
PlatformDbContext (需要更新以移除已删除实体的 DbSet)
added patterns
GwTenantRoute 新字段Methods、Hosts、Headers、LoadBalancingPolicy、AuthorizationPolicy、CorsPolicy、Transforms
领域驱动设计实体扩展
created modified deleted
Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwTenantRoute.cs
Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwTenant.cs
Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwServiceInstance.cs
GwTenant 已移除 - 改用 Platform.Tenant 通过 TenantCode 关联
GwServiceInstance 已移除 - 改用 GwCluster 内嵌的 Destination 集合
扩展字段使用可空字符串类型,以支持可选的 YARP 配置
duration completed_date
~5 分钟 2026-03-03

阶段 03 计划 02: 网关路由更新总结

一句话概述

扩展 GwTenantRoute 以支持 YARP 路由匹配字段,并移除已废弃的 GwTenant/GwServiceInstance 实体。

已完成任务

任务 名称 提交 文件
1 扩展 GwTenantRoute 字段 3fbd9d0 GwTenantRoute.cs
2 删除 GwTenant 实体 3fbd9d0 GwTenant.cs
3 删除 GwServiceInstance 实体 3fbd9d0 GwServiceInstance.cs

总结

成功完成网关路由实体的领域层重构:

  • 扩展 GwTenantRoute 新增字段以支持完整的 YARP 路由能力:

    • MethodsHostsHeaders - 路由匹配
    • LoadBalancingPolicyAuthorizationPolicyCorsPolicy - 策略配置
    • Transforms - 请求/响应转换
  • 移除已废弃实体

    • GwTenant - 应使用 Platform.Tenant 聚合并通过 TenantCode 关联
    • GwServiceInstance - 应使用 GwCluster 内嵌的 Destination 集合

验证结果

  • 领域层构建:通过0 错误2 警告)
  • 基础设施层:需要更新 - 对已删除实体的引用需在后续计划中清理

计划偏差

基础设施层引用

发现时机: 构建验证 问题: 基础设施层PlatformDbContext、InstanceStore、IInstanceStore仍引用已删除的 GwTenant 和 GwServiceInstance 实体 影响: 基础设施层构建失败,直到更新完成 决策: 推迟到后续计划 - 领域层变更已按计划范围完成 受影响文件: PlatformDbContext.cs、IInstanceStore.cs、InstanceStore.cs

备注

  • 已删除的实体是初始网关实现的一部分,现已被以下替代:
    • Platform.Tenant 聚合用于租户信息
    • GwCluster 聚合的内嵌 Destination 集合用于服务实例
  • 基础设施层清理应在下一个涵盖基础设施更新的计划中处理