2:产品接口
- 产品搜索及动态排序List
- 产品detail
- 属性选择
==产品搜索及动态排序List==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/product/v1/productList
Request:
param | type | nullable | description |
---|
categoryId | str | 可选 | 分类id |
keyword | str | 可选 | 关键字 |
pageNum | str | 可选 | 页码(default=1) |
pageSize | str | 可选 | 每页数量(default=10) |
orderBy | str | 可选 | 排序方式(default=""):排序参数:例如price_desc,price_asc |
success
{
"status": 0,
"data": {
"pageNum": 1,
"pageSize": 2,
"size": 2,
"startRow": 0,
"endRow": 1,
"total": 2,
"pages": 1,
"list": [
{
"productId": 4,
"categoryId": 100005,
"productSpecs": "mode:free;",
"name": "自由模式",
"detail": "运动轨和影片的匹配模式,分自由模式和休闲模式,运动轨和影片的可自由组合。",
"subtitle": "运动轨和影片的可自由组合",
"price": 500,
"point": 5000,
"isBought": false,
"status": 1,
"imageHost": "http://192.168.1.6:8080/img/"
},
{
"productId": 5,
"categoryId": 100005,
"productSpecs": "mode:leisure;",
"name": "休闲模式",
"detail": "运动轨和影片的匹配模式,分自由模式和休闲模式,休闲模式运动轨和影片绑定,不可更改",
"subtitle": "运动轨和影片绑定",
"price": 600,
"point": 6000,
"isBought": false,
"status": 1,
"imageHost": "http://192.168.1.6:8080/img/"
}
],
"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": "参数错误"
}
==产品detail==
HttpMethod: POST
Content-Type: application/x-www-form-urlencoded
Url: http://192.168.1.6:8080/player/product/v1/productDetail
Request:
param | type | nullable | description |
---|
productId | str | false | 产品id |
specs | str | false | 产品规格,格式如 "颜色:蓝色;尺寸:20cm;" |
success
{
"status": 0,
"data": {
"productId": 1,
"categoryId": 100003,
"parentCategoryId": 100001,
"price": 2088,
"stock": 88,
"status": 1,
"specsConfigList": {
"color": [
"黑色",
"蓝色",
"银色"
],
"size": [
"16cm",
"20cm",
"30cm"
]
}, //属性(key-value)表
"specsSelf": {
"color": "蓝色",
"size": "20cm"
}, //当前规格
"specsNone": "color:黑色;size:20cm;", //无库存规格
"createTime": "2017-05-02 15:47:06",
"updateTime": "2017-05-02 15:47:07"
},
"success": true
}
fail
{
"status": 1,
"msg": "该商品已下架或删除"
}