fengling-platform/.planning/phases/03-/03-gateway-di-update-PLAN.md

74 lines
2.0 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: 04
type: execute
wave: 3
depends_on:
- 03-gateway-infrastructure-update
files_modified:
- Fengling.Platform.Infrastructure/Extensions.cs
- Fengling.Platform.Infrastructure/GatewayExtensions.cs
autonomous: true
requirements:
- GATEWAY-RESTRUCTURE-07
must_haves:
truths:
- "Extensions.cs 注册 IClusterStore 而非 IInstanceStore"
- "GatewayExtensions 可独立使用"
---
# 计划 04: 更新 Extensions 和 DI 注册
## 目标
更新 Extensions.cs 以注册新的 IClusterStore清理旧的 IInstanceStore 注册。
**目的:** 完成 DI 容器配置的更新,使新服务可被注入使用。
**输出:** 更新的 Extensions.cs。
## 上下文
@Fengling.Platform.Infrastructure/Extensions.cs
@Fengling.Platform.Infrastructure/GatewayExtensions.cs
## 任务
<task type="auto">
<name>任务 1: 更新 Extensions.cs</name>
<files>Fengling.Platform.Infrastructure/Extensions.cs</files>
<action>
在 AddPlatformCore 方法中:
1. 移除旧注册:
- 移除 services.AddScoped&lt;IInstanceStore, InstanceStore&lt;TContext&gt;&gt;()
- 移除 services.AddScoped&lt;IRouteManager, RouteManager&gt;()(如果之前在 Gateway 部分)
2. 添加新注册:
- 添加 services.AddScoped&lt;IClusterStore, ClusterStore&lt;TContext&gt;&gt;()
注意:保持与现有 GatewayExtensions 的兼容性。
</action>
<verify>dotnet build 通过</verify>
<done>Extensions.cs 已更新</done>
</task>
<task type="auto">
<name>任务 2: 更新 GatewayExtensions.cs如需要</name>
<files>Fengling.Platform.Infrastructure/GatewayExtensions.cs</files>
<action>
检查 GatewayExtensions.cs
- 如果已注册 IClusterStore确保与 Extensions.cs 一致
- 如果需要,添加注释说明两种注册方式
</action>
<verify>dotnet build 通过</verify>
<done>GatewayExtensions 检查完成</done>
</task>
## 验证
- [ ] Extensions.cs 已更新
- [ ] Build 无错误通过
## 成功标准
Gateway 模块重构完成,所有服务正确注册。