# HoneyBox API 订单系统接口测试文件
# 用于验证所有订单系统相关的控制器接口
# Checkpoint 18: 控制器测试验证

@baseUrl = http://localhost:5238/api
@contentType = application/json

# 测试用Token（需要通过登录接口获取真实Token后替换）
# 下面是一个有效的测试Token（用户ID: 21583），有效期至2026年
@authToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoi5b6u5L-h55So5oi3MTMxMCIsImV4cCI6MTc2NzQzMTM1OCwidWlkIjoiMzMyMjY2IiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiIyMTU4MyIsImF1ZCI6IkhvbmV5Qm94VXNlcnMiLCJpc3MiOiJIb25leUJveCJ9.700XWIUmzEumNk5tNYRshh7M42A8MG1X4yTHuz9PZbc

# 测试用参数（需要替换为数据库中存在的数据）
@testGoodsId = 1
@testPrizeNum = 1
@testOrderNum = TEST_ORDER_001
@testDeliveryId = 1
@testOrderListIds = 1,2,3

### ============================================
### 1. 健康检查接口
### ============================================

### 1.1 健康检查 - 验证服务是否正常运行
# GET /api/health
GET {{baseUrl}}/health
Accept: {{contentType}}

### ============================================
### 2. 一番赏订单金额计算接口 (OrderController)
### Requirements: 1.1-1.6
### ============================================

### 2.1 一番赏订单金额计算 - 基本计算
# POST /api/ordermoney
# Requirements: 1.1
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### 2.2 一番赏订单金额计算 - 使用余额抵扣
# POST /api/ordermoney
# Requirements: 1.2
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 1,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### 2.3 一番赏订单金额计算 - 使用积分抵扣
# POST /api/ordermoney
# Requirements: 1.3
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 2,
    "use_integral_is": 1,
    "use_money2_is": 2
}

### 2.4 一番赏订单金额计算 - 使用哈尼券抵扣
# POST /api/ordermoney
# Requirements: 1.4
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 1
}

### 2.5 一番赏订单金额计算 - 使用优惠券
# POST /api/ordermoney
# Requirements: 1.5
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "coupon_id": "1",
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### 2.6 一番赏订单金额计算 - 组合抵扣
# POST /api/ordermoney
# Requirements: 1.2, 1.3, 1.4
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 1,
    "use_integral_is": 1,
    "use_money2_is": 1
}

### ============================================
### 3. 一番赏订单创建接口 (OrderController)
### Requirements: 2.1-2.6
### ============================================

### 3.1 一番赏订单创建 - 基本创建
# POST /api/orderbuy
# Requirements: 2.1, 2.2
POST {{baseUrl}}/orderbuy
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### 3.2 一番赏订单创建 - 使用余额支付
# POST /api/orderbuy
# Requirements: 2.1, 2.4
POST {{baseUrl}}/orderbuy
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}},
    "use_money_is": 1,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### ============================================
### 4. 无限赏订单金额计算接口 (OrderController)
### Requirements: 3.1-3.3
### ============================================

### 4.1 无限赏订单金额计算 - 基本计算
# POST /api/infinite_ordermoney
# Requirements: 3.1
POST {{baseUrl}}/infinite_ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "prize_num": {{testPrizeNum}},
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### 4.2 无限赏订单金额计算 - 使用抵扣
# POST /api/infinite_ordermoney
# Requirements: 3.2
POST {{baseUrl}}/infinite_ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "prize_num": {{testPrizeNum}},
    "use_money_is": 1,
    "use_integral_is": 1,
    "use_money2_is": 1
}

### ============================================
### 5. 无限赏订单创建接口 (OrderController)
### Requirements: 4.1-4.3
### ============================================

### 5.1 无限赏订单创建 - 基本创建
# POST /api/infinite_orderbuy
# Requirements: 4.1, 4.2
POST {{baseUrl}}/infinite_orderbuy
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "prize_num": {{testPrizeNum}},
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### ============================================
### 6. 商城订单金额计算接口 (OrderController)
### Requirements: 5.1-5.3
### ============================================

### 6.1 商城订单金额计算 - 基本计算
# POST /api/mall_ordermoney
# Requirements: 5.1, 5.2
POST {{baseUrl}}/mall_ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "prize_num": {{testPrizeNum}},
    "goods_num": 1,
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### 6.2 商城订单金额计算 - 多数量
# POST /api/mall_ordermoney
# Requirements: 5.2
POST {{baseUrl}}/mall_ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "prize_num": {{testPrizeNum}},
    "goods_num": 3,
    "use_money_is": 2,
    "use_integral_is": 2,
    "use_money2_is": 2
}

### ============================================
### 7. 订单列表查询接口 (OrderController)
### Requirements: 6.1-6.4
### ============================================

### 7.1 订单列表查询 - 默认分页
# POST /api/order_list
# Requirements: 6.1, 6.2
POST {{baseUrl}}/order_list
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "page_size": 10
}

### 7.2 订单列表查询 - 第二页
# POST /api/order_list
# Requirements: 6.3
POST {{baseUrl}}/order_list
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 2,
    "page_size": 10
}

### 7.3 订单列表查询 - 自定义分页大小
# POST /api/order_list
# Requirements: 6.3, 6.4
POST {{baseUrl}}/order_list
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "page_size": 20
}

### ============================================
### 8. 订单详情查询接口 (OrderController)
### Requirements: 7.1-7.3
### ============================================

### 8.1 订单详情查询
# POST /api/order_detail
# Requirements: 7.1, 7.2
POST {{baseUrl}}/order_detail
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "order_num": "{{testOrderNum}}"
}

### ============================================
### 9. 一番赏抽奖结果查询接口 (OrderController)
### Requirements: 8.1-8.3
### ============================================

### 9.1 一番赏抽奖结果查询
# POST /api/prizeorderlog
# Requirements: 8.1, 8.2, 8.3
POST {{baseUrl}}/prizeorderlog
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "order_num": "{{testOrderNum}}"
}

### ============================================
### 10. 无限赏抽奖结果查询接口 (OrderController)
### Requirements: 9.1-9.2
### ============================================

### 10.1 无限赏抽奖结果查询
# POST /api/infinite_prizeorderlog
# Requirements: 9.1, 9.2
POST {{baseUrl}}/infinite_prizeorderlog
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "order_num": "{{testOrderNum}}"
}

### ============================================
### 11. 仓库首页查询接口 (WarehouseController)
### Requirements: 10.1-10.3
### ============================================

### 11.1 仓库首页查询 - 待选择状态
# POST /api/warehouse_index
# Requirements: 10.1, 10.2
POST {{baseUrl}}/warehouse_index
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "status": 0
}

### 11.2 仓库首页查询 - 已回收状态
# POST /api/warehouse_index
# Requirements: 10.2
POST {{baseUrl}}/warehouse_index
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "status": 1
}

### 11.3 仓库首页查询 - 已发货状态
# POST /api/warehouse_index
# Requirements: 10.2
POST {{baseUrl}}/warehouse_index
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "status": 2
}

### 11.4 仓库首页查询 - 集市状态
# POST /api/warehouse_index
# Requirements: 10.2
POST {{baseUrl}}/warehouse_index
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "status": 3
}

### ============================================
### 12. 奖品回收接口 (WarehouseController)
### Requirements: 11.1-11.5
### ============================================

### 12.1 奖品回收
# POST /api/warehouse_recovery
# Requirements: 11.1, 11.2, 11.3, 11.4
POST {{baseUrl}}/warehouse_recovery
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "recovery_info": "{{testOrderListIds}}"
}

### ============================================
### 13. 奖品发货接口 (WarehouseController)
### Requirements: 12.1-12.5
### ============================================

### 13.1 奖品发货申请
# POST /api/warehouse_send
# Requirements: 12.1, 12.2, 12.3, 12.4
POST {{baseUrl}}/warehouse_send
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "recovery_info": "{{testOrderListIds}}",
    "name": "测试用户",
    "mobile": "13800138000",
    "address": "北京市朝阳区测试地址",
    "message": "请小心轻放"
}

### ============================================
### 14. 确认发货接口 (WarehouseController)
### Requirements: 13.1-13.2
### ============================================

### 14.1 确认发货
# POST /api/warehouse_send_confirm
# Requirements: 13.1, 13.2
POST {{baseUrl}}/warehouse_send_confirm
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": {{testDeliveryId}}
}

### ============================================
### 15. 发货记录查询接口 (WarehouseController)
### Requirements: 14.1-14.3
### ============================================

### 15.1 发货记录查询 - 默认分页
# POST /api/warehouse_send_record
# Requirements: 14.1, 14.2
POST {{baseUrl}}/warehouse_send_record
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1,
    "status": 1
}

### 15.2 发货记录查询 - 第二页
# POST /api/warehouse_send_record
# Requirements: 14.3
POST {{baseUrl}}/warehouse_send_record
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 2,
    "status": 1
}

### ============================================
### 16. 发货记录详情接口 (WarehouseController)
### Requirements: 15.1-15.3
### ============================================

### 16.1 发货记录详情查询
# POST /api/warehouse_send_record_detail
# Requirements: 15.1, 15.2
POST {{baseUrl}}/warehouse_send_record_detail
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": {{testDeliveryId}}
}

### ============================================
### 17. 回收记录查询接口 (WarehouseController)
### Requirements: 16.1-16.2
### ============================================

### 17.1 回收记录查询 - 默认分页
# POST /api/warehouse_recovery_record
# Requirements: 16.1
POST {{baseUrl}}/warehouse_recovery_record
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 1
}

### 17.2 回收记录查询 - 第二页
# POST /api/warehouse_recovery_record
# Requirements: 16.2
POST {{baseUrl}}/warehouse_recovery_record
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "page": 2
}

### ============================================
### 18. 物流信息查询接口 (WarehouseController)
### Requirements: 17.1-17.3
### ============================================

### 18.1 物流信息查询
# POST /api/warehouse_order_logistics
# Requirements: 17.1, 17.2, 17.3
POST {{baseUrl}}/warehouse_order_logistics
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": {{testDeliveryId}}
}

### ============================================
### 19. 错误场景测试 - 未授权访问
### ============================================

### 19.1 未授权访问 - 订单金额计算（无Token）
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}}
}

### 19.2 未授权访问 - 订单创建（无Token）
POST {{baseUrl}}/orderbuy
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": {{testPrizeNum}}
}

### 19.3 未授权访问 - 订单列表（无Token）
POST {{baseUrl}}/order_list
Content-Type: {{contentType}}

{
    "page": 1,
    "page_size": 10
}

### 19.4 未授权访问 - 仓库首页（无Token）
POST {{baseUrl}}/warehouse_index
Content-Type: {{contentType}}

{
    "page": 1,
    "status": 0
}

### 19.5 未授权访问 - 奖品回收（无Token）
POST {{baseUrl}}/warehouse_recovery
Content-Type: {{contentType}}

{
    "recovery_info": "1,2,3"
}

### ============================================
### 20. 错误场景测试 - 参数缺失
### ============================================

### 20.1 参数缺失 - 订单金额计算（无商品ID）
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "num": 1,
    "prize_num": {{testPrizeNum}}
}

### 20.2 参数缺失 - 订单金额计算（商品ID为0）
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": 0,
    "num": 1,
    "prize_num": {{testPrizeNum}}
}

### 20.3 参数缺失 - 订单金额计算（抽奖次数为0）
POST {{baseUrl}}/ordermoney
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "num": 1,
    "prize_num": 0
}

### 20.4 参数缺失 - 订单创建（无商品ID）
POST {{baseUrl}}/orderbuy
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "num": 1,
    "prize_num": {{testPrizeNum}}
}

### 20.5 参数缺失 - 订单详情（无订单号）
POST {{baseUrl}}/order_detail
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}

### 20.6 参数缺失 - 订单详情（订单号为空）
POST {{baseUrl}}/order_detail
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "order_num": ""
}

### 20.7 参数缺失 - 抽奖结果（无订单号）
POST {{baseUrl}}/prizeorderlog
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}

### 20.8 参数缺失 - 奖品回收（无奖品ID）
POST {{baseUrl}}/warehouse_recovery
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}

### 20.9 参数缺失 - 奖品回收（奖品ID为空）
POST {{baseUrl}}/warehouse_recovery
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "recovery_info": ""
}

### 20.10 参数缺失 - 奖品发货（无收货人姓名）
POST {{baseUrl}}/warehouse_send
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "recovery_info": "{{testOrderListIds}}",
    "mobile": "13800138000",
    "address": "北京市朝阳区测试地址"
}

### 20.11 参数缺失 - 奖品发货（无手机号）
POST {{baseUrl}}/warehouse_send
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "recovery_info": "{{testOrderListIds}}",
    "name": "测试用户",
    "address": "北京市朝阳区测试地址"
}

### 20.12 参数缺失 - 奖品发货（无地址）
POST {{baseUrl}}/warehouse_send
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "recovery_info": "{{testOrderListIds}}",
    "name": "测试用户",
    "mobile": "13800138000"
}

### 20.13 参数缺失 - 确认发货（无ID）
POST {{baseUrl}}/warehouse_send_confirm
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}

### 20.14 参数缺失 - 确认发货（ID为0）
POST {{baseUrl}}/warehouse_send_confirm
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": 0
}

### 20.15 参数缺失 - 发货记录详情（无ID）
POST {{baseUrl}}/warehouse_send_record_detail
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}

### 20.16 参数缺失 - 物流信息（无ID）
POST {{baseUrl}}/warehouse_order_logistics
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}


### ============================================
### 21. 无限赏中奖记录查询接口 (OrderController)
### Requirements: 4.1-4.3
### ============================================

### 21.1 无限赏中奖记录查询 - 基本查询
# POST /api/infinite_shang_log
# Requirements: 4.1
POST {{baseUrl}}/infinite_shang_log
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "shang_id": 0,
    "is_mibao": 0,
    "page": 1,
    "page_size": 10
}

### 21.2 无限赏中奖记录查询 - 按赏品等级过滤
# POST /api/infinite_shang_log
# Requirements: 4.2
POST {{baseUrl}}/infinite_shang_log
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "shang_id": 10,
    "is_mibao": 0,
    "page": 1,
    "page_size": 10
}

### 21.3 无限赏中奖记录查询 - 秘宝池过滤
# POST /api/infinite_shang_log
# Requirements: 4.1
POST {{baseUrl}}/infinite_shang_log
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "shang_id": 0,
    "is_mibao": 1,
    "page": 1,
    "page_size": 10
}

### 21.4 无限赏中奖记录查询 - 分页第二页
# POST /api/infinite_shang_log
# Requirements: 4.1
POST {{baseUrl}}/infinite_shang_log
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "shang_id": 0,
    "is_mibao": 0,
    "page": 2,
    "page_size": 10
}

### ============================================
### 22. 无限赏用户抽奖记录查询接口 (OrderController)
### Requirements: 5.1-5.3
### ============================================

### 22.1 无限赏用户抽奖记录查询 - 基本查询
# POST /api/infinite_prizerecords
# Requirements: 5.1
POST {{baseUrl}}/infinite_prizerecords
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "page": 1,
    "page_size": 10
}

### 22.2 无限赏用户抽奖记录查询 - 分页第二页
# POST /api/infinite_prizerecords
# Requirements: 5.1
POST {{baseUrl}}/infinite_prizerecords
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "page": 2,
    "page_size": 10
}

### 22.3 无限赏用户抽奖记录查询 - 自定义分页大小
# POST /api/infinite_prizerecords
# Requirements: 5.1
POST {{baseUrl}}/infinite_prizerecords
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": {{testGoodsId}},
    "page": 1,
    "page_size": 20
}

### ============================================
### 23. 错误场景测试 - 抽奖记录查询
### ============================================

### 23.1 无限赏中奖记录查询 - 商品ID为空
POST {{baseUrl}}/infinite_shang_log
Content-Type: {{contentType}}

{
    "goods_id": 0,
    "shang_id": 0,
    "page": 1,
    "page_size": 10
}

### 23.2 无限赏用户抽奖记录查询 - 未授权
POST {{baseUrl}}/infinite_prizerecords
Content-Type: {{contentType}}

{
    "goods_id": {{testGoodsId}},
    "page": 1,
    "page_size": 10
}

### 23.3 无限赏用户抽奖记录查询 - 商品ID为空
POST {{baseUrl}}/infinite_prizerecords
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "goods_id": 0,
    "page": 1,
    "page_size": 10
}
