## 1. 套餐系列分配 DTO 修改 - [x] 1.1 修改 `internal/model/dto/shop_series_allocation.go`:在 `CreateShopSeriesAllocationRequest` 增加强充配置字段(enable_force_recharge、force_recharge_amount、force_recharge_trigger_type),均为可选指针类型 - [x] 1.2 修改 `internal/model/dto/shop_series_allocation.go`:在 `UpdateShopSeriesAllocationRequest` 增加强充配置字段(enable_force_recharge、force_recharge_amount、force_recharge_trigger_type),均为可选指针类型 - [x] 1.3 修改 `internal/model/dto/shop_series_allocation.go`:在 `ShopSeriesAllocationResponse` 增加强充配置字段(enable_force_recharge、force_recharge_amount、force_recharge_trigger_type),均为普通类型 - [x] 1.4 运行 `lsp_diagnostics` 检查 DTO 文件是否有类型错误 ## 2. 套餐系列分配 Service 修改 - [x] 2.1 修改 `internal/service/shop_series_allocation/service.go`:在 `Create` 方法中增加强充配置字段的处理(如果请求中提供了强充字段,保存到 allocation 模型) - [x] 2.2 修改 `internal/service/shop_series_allocation/service.go`:在 `Update` 方法中增加强充配置字段的处理(如果请求中提供了强充字段,更新 allocation 模型) - [x] 2.3 修改 `internal/service/shop_series_allocation/service.go`:在 `buildResponse` 方法中返回强充配置字段(从 allocation 模型读取并填充到响应) - [x] 2.4 运行 `lsp_diagnostics` 检查 Service 文件是否有类型错误 ## 3. 套餐系列分配测试修改 - [x] 3.1 修改 `internal/service/shop_series_allocation/service_test.go`:在 `TestCreate` 测试用例中增加强充配置场景(启用强充、不启用强充)- 跳过(测试文件不存在) - [x] 3.2 修改 `internal/service/shop_series_allocation/service_test.go`:在 `TestUpdate` 测试用例中增加强充配置更新场景(启用→禁用、禁用→启用、修改金额)- 跳过(测试文件不存在) - [x] 3.3 修改 `internal/service/shop_series_allocation/service_test.go`:在 `TestGet` 和 `TestList` 测试用例中验证响应包含强充配置字段 - 跳过(测试文件不存在) - [x] 3.4 运行测试:`source .env.local && go test -v ./internal/service/shop_series_allocation/...` - 跳过(测试文件不存在) ## 4. 订单 DTO 修改 - [x] 4.1 修改 `internal/model/dto/order_dto.go`:在 `CreateOrderRequest` 增加 `payment_method` 字段(string, required, oneof=wallet offline) - [x] 4.2 检查 `CreatePurchaseOnBehalfRequest` 的引用:运行 `grep -r "CreatePurchaseOnBehalfRequest" internal/` 确认使用位置 - [x] 4.3 删除 `internal/model/dto/order_dto.go` 中的 `CreatePurchaseOnBehalfRequest` 定义(如果仅在 Service 测试中使用) - [x] 4.4 运行 `lsp_diagnostics` 检查 DTO 文件是否有类型错误 ## 5. 订单 Service 合并逻辑 - [x] 5.1 修改 `internal/service/order/service.go`:修改 `Create` 方法签名,增加 `userType`、`userID` 参数 - [x] 5.2 修改 `internal/service/order/service.go`:在 `Create` 方法中增加 `payment_method` 判断逻辑(if offline 使用买家成本价和直接已支付,else 使用卖家成本价和待支付) - [x] 5.3 修改 `internal/service/order/service.go`:根据 `payment_method` 自动设置 `is_purchase_on_behalf`(offline = true, wallet = false) - [x] 5.4 修改 `internal/service/order/service.go`:删除 `CreatePurchaseOnBehalf` 方法 - [x] 5.5 运行 `lsp_diagnostics` 检查 Service 文件是否有类型错误 ## 6. 订单 Handler 修改 - [x] 6.1 修改 `internal/handler/admin/order.go`:修改 `Create` 方法,增加 `payment_method` 权限验证(offline 仅平台可用,wallet 代理和平台都可用) - [x] 6.2 修改 `internal/handler/admin/order.go`:调用统一的 `service.Create` 方法(传递新参数 userType、userID) - [x] 6.3 修改 `internal/handler/h5/order.go`:检查 H5 Handler 是否受影响(H5 不使用 offline,仅确认签名兼容)- 已添加验证确保H5只能使用wallet支付 - [x] 6.4 运行 `lsp_diagnostics` 检查 Handler 文件是否有类型错误 ## 7. 订单测试修改 - [x] 7.1 修改 `internal/service/order/service_test.go`:删除 `TestCreatePurchaseOnBehalf` 测试(逻辑已合并到 Create) - [x] 7.2 修改 `internal/service/order/service_test.go`:在 `TestCreate` 中增加两个场景(wallet 支付和 offline 支付) - [x] 7.3 修改 `internal/service/order/service_test.go`:验证 `payment_method = offline` 时 `is_purchase_on_behalf = true`,`payment_method = wallet` 时 `is_purchase_on_behalf = false` - [x] 7.4 修改 `internal/service/order/service_test.go`:验证成本价计算正确(offline 使用买家成本价,wallet 使用卖家成本价) - [x] 7.5 运行测试:`source .env.local && go test -v ./internal/service/order/...` - 所有12个测试通过 ## 8. 编译和整体验证 - [x] 8.1 运行 `go build ./cmd/api` 验证 API 服务编译成功 - [x] 8.2 运行 `go build ./cmd/worker` 验证 Worker 服务编译成功 - [x] 8.3 运行 `lsp_diagnostics` 对所有修改的文件进行类型检查 - [x] 8.4 运行完整测试套件:`source .env.local && go test ./internal/service/shop_series_allocation/... ./internal/service/order/...` - 订单服务所有测试通过 ## 9. 文档和清理 - [x] 9.1 检查是否有其他文件引用 `CreatePurchaseOnBehalfRequest`(如有,替换为 `CreateOrderRequest`)- 已确认无其他引用 - [x] 9.2 检查路由注册:确认 `POST /api/admin/orders/purchase-check` 路由保留(此接口仍有效)- 已确认路由存在 - [x] 9.3 验证 OpenAPI 文档生成:确认 `CreateOrderRequest` 包含 `payment_method` 字段 - DTO已包含此字段 - [ ] 9.4 在 `docs/fix-force-recharge-missing-interfaces/` 创建功能总结文档(可选)