HaniBlindBox/.kiro/specs/api-migration-remaining/tasks.md
2026-01-03 19:38:08 +08:00

375 lines
12 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.

# Implementation Plan: API Migration Remaining
## Overview
本任务列表将54个待迁移API接口按模块和优先级组织每个接口迁移遵循标准流程PHP分析 → SQL Server验证 → 数据表创建 → C#实现。
## Tasks
- [x] 1. 地址模块迁移 (7个接口) - 高优先级
- [x] 1.1 分析PHP地址相关代码
- 查看 `server/php/app/api/controller/User.php` 中地址相关方法
- 查看 `server/php/app/common/model/` 中地址模型
- 记录业务逻辑和数据库操作
- _Requirements: 1.1-1.7, 16.1_
- [x] 1.2 验证SQL Server地址表结构
- 使用MCP查询 `user_address` 表是否存在
- 验证表字段与PHP模型一致
- _Requirements: 16.2_
- [x] 1.3 创建AddressService服务
- 实现 `IAddressService` 接口
- 实现地址CRUD业务逻辑
- 注册到Autofac容器
- _Requirements: 1.1-1.7, 16.4_
- [x] 1.4 创建AddressController控制器
- 实现 `/addAddress` POST接口
- 实现 `/updateAddress` POST接口
- 实现 `/getDefaultAddress` GET接口
- 实现 `/getAddressList` GET接口
- 实现 `/deleteAddress` POST接口
- 实现 `/setDefaultAddress` POST接口
- 实现 `/getAddressDetail` GET接口
- _Requirements: 1.1-1.7, 16.4, 16.5_
- [ ]* 1.5 编写地址模块单元测试
- 测试AddressService各方法
- 测试边界条件和异常情况
- _Requirements: 1.1-1.7_
- [ ]* 1.6 编写地址模块属性测试
- **Property 1: 地址操作一致性**
- **Property 2: 默认地址唯一性**
- **Validates: Requirements 1.1-1.7**
- [x] 2. 签到功能迁移 (3个接口) - 高优先级
- [x] 2.1 分析PHP签到相关代码
- 查看 `server/php/app/api/controller/Sign.php`
- 查看签到配置和奖励逻辑
- 记录连续签到计算规则
- _Requirements: 3.1-3.3, 16.1_
- [x] 2.2 验证SQL Server签到表结构
- 使用MCP查询 `user_sign`
- 使用MCP查询 `sign_config`
- _Requirements: 16.2_
- [x] 2.3 创建SignService服务
- 实现签到信息查询
- 实现签到执行和奖励发放
- 实现连续签到天数计算
- _Requirements: 3.1-3.3, 16.4_
- [x] 2.4 创建SignController控制器
- 实现 `/sign_info` GET接口
- 实现 `/sign` POST接口
- 实现 `/sign_add` POST接口
- _Requirements: 3.1-3.3, 16.4, 16.5_
- [ ]* 2.5 编写签到模块属性测试
- **Property 4: 签到幂等性**
- **Property 5: 签到连续天数计算**
- **Validates: Requirements 3.1-3.3**
- [x] 3. Checkpoint - 地址和签到模块
- 确保所有测试通过
- 验证API响应格式与PHP一致
- 如有问题请询问用户
- [x] 4. 支付模块扩展 (6个接口) - 高优先级
- [x] 4.1 分析PHP支付相关代码
- 查看 `server/php/app/api/controller/Pay.php`
- 分析微信支付、余额支付、充值逻辑
- _Requirements: 2.1-2.6, 16.1_
- [x] 4.2 验证SQL Server支付相关表
- 使用MCP查询 `user_recharge`
- 使用MCP查询支付订单相关表
- _Requirements: 16.2_
- [x] 4.3 扩展PaymentService服务
- 实现 `/wx_pay` 微信支付逻辑
- 实现 `/balance_pay` 余额支付逻辑
- 实现 `/recharge` 充值逻辑
- 实现 `/recharge_config` 配置查询
- 实现 `/create_recharge_order` 订单创建
- 实现 `/query_pay_status` 状态查询
- _Requirements: 2.1-2.6, 16.4_
- [x] 4.4 扩展PayController控制器
- 添加6个新接口端点
- _Requirements: 2.1-2.6, 16.4, 16.5_
- [ ]* 4.5 编写支付模块属性测试
- **Property 3: 余额支付扣减正确性**
- **Validates: Requirements 2.2**
- [x] 5. 福利屋模块扩展 (2个接口) - 高优先级
- [x] 5.1 分析PHP福利屋相关代码
- 查看 `server/php/app/api/controller/FuLiWu.php`
- 分析福利屋列表和购买逻辑
- _Requirements: 4.1-4.2, 16.1_
- [x] 5.2 扩展WelfareService服务
- 实现 `/fuliwu` 列表查询
- 实现 `/fuliwu_buy` 购买逻辑
- _Requirements: 4.1-4.2, 16.4_
- [x] 5.3 扩展WelfareController控制器
- 添加2个新接口端点
- _Requirements: 4.1-4.2, 16.4, 16.5_
- [ ]* 5.4 编写福利屋模块属性测试
- **Property 6: 福利屋积分扣减**
- **Validates: Requirements 4.2**
- [x] 6. Checkpoint - 支付和福利屋模块
- 确保所有测试通过
- 验证支付流程正确性
- 如有问题请询问用户
- [x] 7. 商品详情模块扩展 (5个接口)
- [x] 7.1 分析PHP商品详情相关代码
- 查看 `server/php/app/api/controller/Goods.php`
- 查看 `server/php/app/api/controller/Infinite.php`
- 分析无限赏、一番赏、连击赏详情逻辑
- _Requirements: 5.1-5.5, 16.1_
- [x] 7.2 扩展GoodsService服务
- 实现 `/infinite_goodsdetail` 无限赏详情
- 实现 `/goodsdetail` 一番赏详情(POST)
- 实现 `/infinite_goodsdetail2` 连击赏详情
- 实现 `/shang_log` 一番赏中奖记录
- 实现 `/ling_zhu_king` 领主王数据
- _Requirements: 5.1-5.5, 16.4_
- [x] 7.3 扩展GoodsController控制器
- 添加5个新接口端点
- _Requirements: 5.1-5.5, 16.4, 16.5_
- [x] 8. 订单模块扩展 (9个接口)
- [x] 8.1 分析PHP订单相关代码
- 查看 `server/php/app/api/controller/Order.php`
- 分析订单状态、列表、支付订单逻辑
- _Requirements: 6.1-6.9, 16.1_
- [x] 8.2 验证SQL Server订单相关表
- 使用MCP查询订单相关表结构
- _Requirements: 16.2_
- [x] 8.3 扩展OrderService服务
- 实现 `/get_order_status` 订单状态查询
- 实现 `/get_order_list` 订单列表
- 实现 `/create_web_pay_order` 网页支付订单
- 实现 `/get_order_url_link` 订单链接
- 实现 `/mall_orderbuy` 商城下单
- 实现 `/prize_order_log` 抽奖结果
- 实现 `/item_card_list` 道具卡列表
- 实现 `/infinite_mibao_orderbuy` 连击赏秘宝下单
- 实现 `/get_user_test` 测试接口
- _Requirements: 6.1-6.9, 16.4_
- [x] 8.4 扩展OrderController控制器
- 添加9个新接口端点
- _Requirements: 6.1-6.9, 16.4, 16.5_
- [x] 9. Checkpoint - 商品和订单模块
- 确保所有测试通过
- 验证商品详情数据完整性
- 如有问题请询问用户
- [x] 10. 优惠券模块扩展 (5个接口)
- [x] 10.1 分析PHP优惠券相关代码
- 查看 `server/php/app/api/controller/Coupon.php`
- 分析优惠券领取、列表逻辑
- _Requirements: 7.1-7.5, 16.1_
- [x] 10.2 扩展CouponService服务
- 实现 `/receive` 批量领取
- 实现 `/coupon` 可领取列表
- 实现 `/used` 可使用列表
- 实现 `/t_coupon_list` 领券中心列表
- 实现 `/t_coupon_ling` 领券中心领取
- _Requirements: 7.1-7.5, 16.4_
- [x] 10.3 扩展CouponController控制器
- 添加5个新接口端点
- _Requirements: 7.1-7.5, 16.4, 16.5_
- [x] 11. 用户权益模块扩展 (2个接口)
- [x] 11.1 分析PHP权益相关代码
- 查看 `server/php/app/api/controller/QuanYi.php`
- 分析权益查询和领取逻辑
- _Requirements: 8.1-8.2, 16.1_
- [x] 11.2 验证SQL Server权益相关表
- 使用MCP查询 `user_vip_reward`
- 使用MCP查询 `vip_level_reward`
- _Requirements: 16.2_
- [x] 11.3 扩展UserService服务
- 实现 `/quan_yi` 权益信息查询
- 实现 `/quan_yi_ling` 权益领取
- _Requirements: 8.1-8.2, 16.4_
- [x] 11.4 扩展UserController控制器
- 添加2个新接口端点
- _Requirements: 8.1-8.2, 16.4, 16.5_
- [x] 12. 收藏模块扩展 (3个接口)
- [x] 12.1 分析PHP收藏相关代码
- 查看 `server/php/app/api/controller/Goods.php` 中收藏方法
- _Requirements: 9.1-9.3, 16.1_
- [x] 12.2 扩展CollectionService服务
- 实现 `/collect_list` 收藏列表(GET)
- 实现 `/cancelCollect` 取消收藏
- 实现 `/collect_status` 收藏状态
- _Requirements: 9.1-9.3, 16.4_
- [x] 12.3 扩展CollectionController控制器
- 添加3个新接口端点
- _Requirements: 9.1-9.3, 16.4, 16.5_
- [ ]* 12.4 编写收藏模块属性测试
- **Property 7: 收藏状态一致性**
- **Validates: Requirements 9.1-9.3**
- [x] 13. Checkpoint - 优惠券、权益、收藏模块
- 确保所有测试通过
- 如有问题请询问用户
- [x] 14. 排行榜模块扩展 (2个接口)
- [x] 14.1 分析PHP排行榜相关代码
- 查看 `server/php/app/api/controller/Rank.php`
- _Requirements: 10.1-10.2, 16.1_
- [x] 14.2 扩展RankService服务
- 实现 `/getRankList` 排行榜列表
- 实现 `/record` 中奖记录排行榜
- _Requirements: 10.1-10.2, 16.4_
- [x] 14.3 扩展RankController控制器
- 添加2个新接口端点
- _Requirements: 10.1-10.2, 16.4, 16.5_
- [x] 15. 兑换码模块扩展 (2个接口)
- [x] 15.1 分析PHP兑换码相关代码
- 查看 `server/php/app/api/controller/Other.php`
- _Requirements: 11.1-11.2, 16.1_
- [x] 15.2 扩展RedeemService服务
- 实现 `/redeem_code` 使用兑换码
- 实现 `/redeem_record` 兑换记录
- _Requirements: 11.1-11.2, 16.4_
- [x] 15.3 扩展RedeemController控制器
- 添加2个新接口端点
- _Requirements: 11.1-11.2, 16.4, 16.5_
- [ ]* 15.4 编写兑换码模块属性测试
- **Property 8: 兑换码使用唯一性**
- **Validates: Requirements 11.1**
- [x] 16. 仓库保险柜模块扩展 (2个接口)
- [x] 16.1 分析PHP仓库相关代码
- 查看 `server/php/app/api/controller/Warehouse.php`
- 分析保险柜移入移出逻辑
- _Requirements: 12.1-12.2, 16.1_
- [x] 16.2 扩展WarehouseService服务
- 实现 `/warehouse_movein` 移入保险柜
- 实现 `/warehouse_remove` 移出保险柜
- _Requirements: 12.1-12.2, 16.4_
- [x] 16.3 扩展WarehouseController控制器
- 添加2个新接口端点
- _Requirements: 12.1-12.2, 16.4, 16.5_
- [ ]* 16.4 编写仓库模块属性测试
- **Property 9: 保险柜移入移出一致性**
- **Validates: Requirements 12.1-12.2**
- [x] 17. 认证模块扩展 (1个接口)
- [x] 17.1 分析PHP认证相关代码
- 查看 `server/php/app/api/controller/Login.php`
- 分析H5绑定手机号逻辑
- _Requirements: 13.1, 16.1_
- [x] 17.2 扩展AuthService服务
- 实现 `/login_bind_mobile_h5` H5绑定手机号
- _Requirements: 13.1, 16.4_
- [x] 17.3 扩展AuthController控制器
- 添加1个新接口端点
- _Requirements: 13.1, 16.4, 16.5_
- [x] 18. 配置模块扩展 (1个接口)
- [x] 18.1 分析PHP配置相关代码
- 查看 `server/php/app/api/controller/Config.php`
- _Requirements: 14.1, 16.1_
- [x] 18.2 扩展ConfigService服务
- 实现 `/danye` 单页内容(POST)
- _Requirements: 14.1, 16.4_
- [x] 18.3 扩展ConfigController控制器
- 添加1个新接口端点
- _Requirements: 14.1, 16.4, 16.5_
- [x] 19. Checkpoint - 排行榜、兑换码、仓库、认证、配置模块
- 确保所有测试通过
- 如有问题请询问用户
- [x] 20. 商城模块迁移 (3个接口) - 低优先级
- [x] 20.1 分析PHP商城相关代码
- 查看 `server/php/app/api/controller/Mall.php`
- 分析钻石商品和订单逻辑
- _Requirements: 15.1-15.3, 16.1_
- [x] 20.2 验证SQL Server商城相关表
- 使用MCP查询 `diamond_product`
- 使用MCP查询 `diamond_order`
- _Requirements: 16.2_
- [x] 20.3 创建MallService服务
- 实现 `/get_diamond_list` 钻石商品列表
- 实现 `/createOrderProducts` 创建钻石订单
- 实现 `/get_diamond_order_log` 订单状态
- _Requirements: 15.1-15.3, 16.4_
- [x] 20.4 创建MallController控制器
- 添加3个新接口端点
- _Requirements: 15.1-15.3, 16.4, 16.5_
- [x] 21. 最终验证和文档更新
- [x] 21.1 运行所有测试
- 确保单元测试全部通过
- 确保属性测试全部通过
- _Requirements: 1-15_
- [x] 21.2 更新API接口清单
- 将已迁移接口状态更新为 ✅ 已迁移
- 更新迁移率统计
- _Requirements: 16.5_
- [x] 21.3 API集成测试
- 使用.http文件测试所有新接口
- 验证响应格式与PHP一致
- _Requirements: 16.5_
- [ ] 22. Final Checkpoint
- 确保所有54个接口迁移完成
- 确保所有测试通过
- 如有问题请询问用户
## Notes
- 任务标记 `*` 的为可选测试任务,可根据时间跳过
- 每个Checkpoint是验证点确保阶段性成果正确
- 迁移顺序按优先级排列:高优先级 → 中优先级 → 低优先级
- 每个接口迁移前必须先分析PHP源码理解业务逻辑
- 使用MCP SQL Server工具验证数据表结构