#收货地址接口
- 添加地址
- 删除地址
- 修改地址
- 选中查看具体的地址
- 地址列表
- 设置默认地址
==1.添加地址==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/shipping/v1/shippingAdd
Request:
请求头:
Authorization:"token"
表单数据:
receiverName=geely
receiverPhone=010
receiverMobile=18688888888
receiverProvince=北京
receiverCity=北京市
receiverDistrict=海淀区
receiverAddress=中关村
receiverZip=100000
success
{
"status": 0,
"msg": "新建地址成功",
"data": {
"shippingId": 28
}
}
fail
{
"status": 1,
"msg": "新建地址失败"
}
==2.删除地址==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/shipping/v1/shippingDel
Request:
请求头:
Authorization:"token"
表单数据:
shippingId = xx
success
{
"status": 0,
"msg": "删除地址成功"
}
fail
{
"status": 1,
"msg": "删除地址失败"
}
==3.修改地址==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/shipping/v1/shippingUpdate
Request:
请求头:
Authorization:"token"
表单数据:
id=1
receiverName=geely
receiverPhone=010
receiverMobile=18688888888
receiverProvince=北京
receiverCity=北京市
receiverAddress=中关村
receiverZip=100000
success
{
"status": 0,
"msg": "更新地址成功"
}
fail
{
"status": 1,
"msg": "更新地址失败"
}
==4.选中查看具体的地址==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/shipping/v1/shippingSelect
Request:
请求头:
Authorization:"token"
表单数据:
shippingId = xx
success
{
"status": 0,
"data": {
"id": 4,
"userId": 13,
"receiverName": "geely",
"receiverPhone": "010",
"receiverMobile": "18688888888",
"receiverProvince": "北京",
"receiverCity": "北京市",
"receiverAddress": "中关村",
"receiverZip": "100000",
"createTime": 1485066385000,
"updateTime": 1485066385000
}
}
fail
{
"status": 1,
"msg": "请登录之后查询"
}
==5.地址列表==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/shipping/v1/shippingList
Request:
请求头:
Authorization:"token"
表单数据:
pageNum = (可选)(默认1)
pageSize = (可选)(默认10)
success
{
"status": 0,
"data": {
"pageNum": 1,
"pageSize": 3,
"size": 3,
"startRow": 0,
"endRow": 2,
"total": 3,
"pages": 1,
"list": [
{
"id": 30,
"userId": 30,
"receiverName": "geely",
"receiverPhone": "10086",
"receiverMobile": "18688888888",
"receiverProvince": "北京",
"receiverCity": "北京市",
"receiverAddress": "中关村",
"receiverZip": "100000",
"modify": "default",
"default": false
},
{
"id": 31,
"userId": 30,
"receiverName": "geely",
"receiverPhone": "10086",
"receiverMobile": "18688888888",
"receiverProvince": "北京",
"receiverCity": "北京市",
"receiverAddress": "中关村",
"receiverZip": "100000",
"modify": "default",
"default": false
},
{
"id": 32,
"userId": 30,
"receiverName": "geely",
"receiverPhone": "10086",
"receiverMobile": "18688888888",
"receiverProvince": "北京",
"receiverCity": "北京市",
"receiverAddress": "中关村",
"receiverZip": "100000",
"modify": "default",
"default": true
}
],
"firstPage": 1,
"prePage": 0,
"nextPage": 0,
"lastPage": 1,
"isFirstPage": true,
"isLastPage": true,
"hasPreviousPage": false,
"hasNextPage": false,
"navigatePages": 8,
"navigatepageNums": [
1
]
},
"success": true
}
fail
{
"status": 1,
"msg": "请登录之后查询"
}
==6.设置默认地址==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/shipping/v1/setDefaultAddress
Request:
请求头:
Authorization:"token"
表单数据:
shippingId=xx
success
{
"status": 0,
"data": "更新成功",
"success": true
}
fail
{
"status": 1,
"msg": "无效地址"
}