fengling-gateway/.planning/quick/001-upgrade-platform/001-PLAN.md
movingsam 42b8c9cca5 fix: 升级 Fengling.Platform 包并修复编译警告
- 修复 CS0108: GatewayDbContext.Tenants 隐藏继承成员
- 修复 NU1506: 移除重复 PackageVersion 定义
- 修复 NU1507: 添加包源映射配置 (NuGet.Config)
2026-03-04 13:14:26 +08:00

40 lines
1.6 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.

# Plan: 升级 Fengling.Platform 包到最新
## 任务描述
升级 fengling-gateway 项目中的 Fengling.Platform.Infrastructure 包到最新版本,并修复现有编译警告。
## 变更分析
### fengling-platform 新版本主要变更
1. **主键类型变更**:从 `long Id` 改为 `string Id`Guid
2. **新增 GwCluster 聚合根**:包含内嵌 Destinations 列表
3. **GwTenantRoute 扩展**:新增 Match (GwRouteMatch)、Transforms 等字段
4. **移除GwServiceInstance**:作为 GwCluster 的内嵌值对象 GwDestination
5. **新增值对象**GwRouteMatch、GwTransform、GwLoadBalancingPolicy、GwHealthCheckConfig、GwSessionAffinityConfig
### 当前编译警告
1. **CS0108**: GatewayDbContext.Tenants 隐藏继承成员 PlatformDbContext.Tenants
2. **NU1506**: 重复 PackageVersion 定义
3. **NU1507**: 配置了多个包源
## 任务列表
### Task 1: 分析并修复 CS0108 警告
- **文件**: src/yarpgateway/Data/GatewayDbContext.cs
- **操作**: 将 `Tenants` 属性添加 `new` 关键字,或使用不同的名称避免隐藏
- **验证**: dotnet build 无 CS0108 警告
### Task 2: 修复 NU1506 重复包版本警告
- **文件**: Directory.Packages.props 或 YarpGateway.csproj
- **操作**: 检查并移除重复的 PackageVersion 定义
- **验证**: dotnet restore 无 NU1506 警告
### Task 3: 配置包源映射解决 NU1507
- **文件**: NuGet.Config 或 Directory.Build.props
- **操作**: 添加包源映射配置
- **验证**: dotnet restore 无 NU1507 警告
## 验证
- dotnet build 成功0 错误
- 无 CS0108、NU1506、NU1507 警告