Appearance
4.1.1获取商品分类列表
接口说明:
Method | URL | ContentType |
---|---|---|
GET | /api/v1/product/category | application/json |
URL参数说明:
参数 | 类型说明 | 是否必须 | 长度 | 描述 |
---|---|---|---|---|
name | string | 非必须 | 50 | 分类名称(支持模糊查询) |
codes | string | 非必须 | 50 | 分类编号(多个逗号分割) |
level | int | 非必须 | 50 | 分类等级(1/2/3) |
leaf | bool | 非必须 | 10 | 是否末级(true-末级分类,false-非末级分类) |
parentCode | string | 非必须 | 50 | 父级分类编码 |
size | int | 非必须 | 50 | 返回分类数量(不传值,默认只返回20条分类) |
返回结果说明:
参数 | 类型说明 | 描述 |
---|---|---|
name | string | 分类名称 |
code | string | 分类编码 |
level | int | 分类等级 |
leaf | bool | 是否末级分类,true-末级分类,false-非末级分类 |
parentCode | string | 父分类编码 |
请求参数示例:
/api/v1/product/category?name=笔
返回数据示例:
json
{
"success": true,
"code": "000",
"message": "成功",
"data": [
{
"name": "中性笔",
"code": "20152",
"level": 3,
"leaf": true,
"parentCode": "2016"
},
{
"name": "记号笔",
"code": "20153",
"level": 3,
"leaf": true,
"parentCode": "2016"
},
{
"name": "白板笔",
"code": "20154",
"level": 3,
"leaf": true,
"parentCode": "2016"
},
{
"name": "高档笔",
"code": "20155",
"level": 3,
"leaf": true,
"parentCode": "2016"
},
{
"name": "圆珠笔",
"code": "20156",
"level": 3,
"leaf": true,
"parentCode": "2016"
}
]
}