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

70 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
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