按用途取地址
按收货、发货、退货等用途取地址,可选传地址 ID 精确指定,下单时自动带出常用地址。
| 请求方式 | GET/POST |
| 接口路径 | /api/address/getAddressByType |
| Content-Type | - |
| 鉴权 | X-Nideshop-Token |
请求参数
| 参数 | 类型 | 必填 | 位置 |
addressType | 对象 | 否 | URL 参数 |
addressId | Integer | 否 | URL 参数 |
curl 调用
curl -s 'https://www.8shu8.com/api/address/getAddressByType?addressType=xxx&addressId=1' \
-H 'X-Nideshop-Token: YOUR_LOGIN_TOKEN'
响应示例
{
"code": 200,
"message": "操作成功",
"success": true,
"data": {
"id": 1,
"userId": 1,
"userName": "string",
"telNumber": "string",
"postalCode": "string",
"nationalCode": "string",
"provinceName": "string",
"cityName": "string",
"countyName": "string",
"detailInfo": "string",
"lat": 0.0,
"lon": 0.0,
"addTime": "string",
"updateTime": "string",
"addressType": "...",
"recyclePoint": 1,
"addressTypeDesc": "string",
"distanceKm": 0.0,
"fullRegion": "string",
"allInfo": "string"
}
}
返回字段(data)
| 字段 | 类型 | 说明 |
id | Integer | - |
userId | Long | - |
userName | String | 收货人姓名 |
telNumber | String | 手机 |
postalCode | String | 邮编 |
nationalCode | String | - |
provinceName | String | 省 |
cityName | String | 市 |
countyName | String | 区 |
detailInfo | String | 详细收货地址信息 |
lat | Double | 纬度 |
lon | Double | 经度 |
addTime | LocalDateTime | 添加时间 |
updateTime | LocalDateTime | 更新时间 |
addressType | 对象 | - |
recyclePoint | Integer | 1 设为回收点,回收订单送往此地址;默认 0 |
addressTypeDesc | String | - |
distanceKm | Double | 距当前用户的距离(公里),仅附近列表返回 |
fullRegion | String | - |
allInfo | String | - |