--- phase: "03-" plan: 01 subsystem: Gateway tags: [gateway, cluster, domain-entities, yarp] dependency_graph: requires: [] provides: [GwCluster, GwDestination, GwHealthCheckConfig, GwSessionAffinityConfig] affects: [GwTenantRoute] tech_stack: added: - GwCluster (集群聚合根) - GwDestination (目标端点值对象) - GwHealthCheckConfig (健康检查配置值对象) - GwSessionAffinityConfig (会话亲和配置值对象) patterns: - 值对象使用 Owned Entity - GUID 字符串 ID - 软删除 + 乐观并发 key_files: created: - Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwCluster.cs - Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwDestination.cs - Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwHealthCheckConfig.cs - Fengling.Platform.Domain/AggregatesModel/GatewayAggregate/GwSessionAffinityConfig.cs decisions: - "GwCluster 使用 string Id (GUID) 以兼容 YARP" - "GwDestination 作为 Owned Entity 内嵌于 GwCluster" - "值对象在 EF Core 中配置为 Owned Entity" metrics: duration: "" completed_date: "2026-03-03" --- # 阶段 03 - 计划 01: 网关集群实体总结 ## 一句话概述 创建了 GwCluster 聚合根及其内嵌值对象(GwDestination、GwHealthCheckConfig、GwSessionAffinityConfig),替代旧的 GwServiceInstance 设计,与 YARP ClusterConfig 结构对齐。 ## 已完成任务 | 任务 | 名称 | 提交 | 文件 | |------|------|------|------| | 1 | 创建 GwHealthCheckConfig 值对象 | 198dc2a | GwHealthCheckConfig.cs | | 2 | 创建 GwSessionAffinityConfig 值对象 | b07f56c | GwSessionAffinityConfig.cs | | 3 | 创建 GwDestination 值对象 | 7ec34fa | GwDestination.cs | | 4 | 创建 GwCluster 聚合根 | 774e3fb | GwCluster.cs | ## 验证结果 - [x] 全部 4 个文件已创建 - [x] 构建通过,0 个错误 - [x] 值对象结构与 YARP 配置模型匹配 ## 计划偏差 无 - 完全按计划执行。 ## 认证门槛 无。 ## 备注 新的 GwCluster 聚合遵循现有的 GatewayAggregate 代码风格: - GUID 字符串 ID 以兼容 YARP - 软删除(IsDeleted)和乐观并发(Version)字段 - 内嵌 Destinations 列表和配置值对象 - 标准审计字段(CreatedBy、CreatedTime、UpdatedBy、UpdatedTime)