# HoneyBox API 地址和签到模块接口测试文件
# Checkpoint 3: 地址和签到模块验证

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

# 测试用Token（需要通过登录接口获取真实Token后替换）
@authToken = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoi5b6u5L-h55So5oi3MTMxMCIsImV4cCI6MTc2NzQzMTM1OCwidWlkIjoiMzMyMjY2IiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiIyMTU4MyIsImF1ZCI6IkhvbmV5Qm94VXNlcnMiLCJpc3MiOiJIb25leUJveCJ9.700XWIUmzEumNk5tNYRshh7M42A8MG1X4yTHuz9PZbc

### ============================================
### 1. 地址模块接口 (AddressController)
### Requirements: 1.1-1.7
### ============================================

### 1.1 添加收货地址
# POST /api/addAddress
# Requirements: 1.1
POST {{baseUrl}}/addAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "receiver_name": "张三",
    "receiver_phone": "13800138000",
    "detailed_address": "北京市朝阳区xxx街道xxx号",
    "is_default": 0
}

### 1.2 添加收货地址 - 设为默认
# POST /api/addAddress
# Requirements: 1.1
POST {{baseUrl}}/addAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "receiver_name": "李四",
    "receiver_phone": "13900139000",
    "detailed_address": "上海市浦东新区xxx路xxx号",
    "is_default": 1
}

### 1.3 获取收货地址列表
# GET /api/getAddressList
# Requirements: 1.4
GET {{baseUrl}}/getAddressList
Authorization: Bearer {{authToken}}

### 1.4 获取默认收货地址
# GET /api/getDefaultAddress
# Requirements: 1.3
GET {{baseUrl}}/getDefaultAddress
Authorization: Bearer {{authToken}}

### 1.5 获取地址详情
# GET /api/getAddressDetail?id=1
# Requirements: 1.7
# 注意：需要替换为有效的地址ID
GET {{baseUrl}}/getAddressDetail?id=1
Authorization: Bearer {{authToken}}

### 1.6 更新收货地址
# POST /api/updateAddress
# Requirements: 1.2
# 注意：需要替换为有效的地址ID
POST {{baseUrl}}/updateAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": 1,
    "receiver_name": "张三（已更新）",
    "receiver_phone": "13800138001",
    "detailed_address": "北京市海淀区xxx街道xxx号",
    "is_default": 0
}

### 1.7 设置默认收货地址
# POST /api/setDefaultAddress
# Requirements: 1.6
# 注意：需要替换为有效的地址ID
POST {{baseUrl}}/setDefaultAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": 1
}

### 1.8 删除收货地址
# POST /api/deleteAddress
# Requirements: 1.5
# 注意：需要替换为有效的地址ID
POST {{baseUrl}}/deleteAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "id": 1
}

### ============================================
### 2. 签到模块接口 (SignController)
### Requirements: 3.1-3.3
### ============================================

### 2.1 获取签到信息
# GET /api/sign_info
# Requirements: 3.1
GET {{baseUrl}}/sign_info
Authorization: Bearer {{authToken}}

### 2.2 执行签到
# POST /api/sign
# Requirements: 3.2
POST {{baseUrl}}/sign
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

### 2.3 执行签到（兼容旧接口）
# POST /api/sign_add
# Requirements: 3.3
POST {{baseUrl}}/sign_add
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

### ============================================
### 3. 错误场景测试
### ============================================

### 3.1 未授权访问 - 获取地址列表（无Token）
GET {{baseUrl}}/getAddressList

### 3.2 未授权访问 - 获取签到信息（无Token）
GET {{baseUrl}}/sign_info

### 3.3 参数缺失 - 添加地址（缺少收货人姓名）
POST {{baseUrl}}/addAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "receiver_phone": "13800138000",
    "detailed_address": "北京市朝阳区xxx街道xxx号"
}

### 3.4 参数错误 - 添加地址（手机号格式错误）
POST {{baseUrl}}/addAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{
    "receiver_name": "张三",
    "receiver_phone": "1380013800",
    "detailed_address": "北京市朝阳区xxx街道xxx号"
}

### 3.5 参数缺失 - 删除地址（无ID）
POST {{baseUrl}}/deleteAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}

### 3.6 参数缺失 - 设置默认地址（无ID）
POST {{baseUrl}}/setDefaultAddress
Content-Type: {{contentType}}
Authorization: Bearer {{authToken}}

{}
