简要描述:
- 获取商品分类
请求域名:
- http://xx.com
请求URL:
GET/plugin.wechat-chat-sidebar.frontend.controller.customer.home-page.get-category
参数:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
client | 是 | string | 值是:work 代表是企业微信端 |
type | 是 | int | 值是:17 代表是企业微信端 |
plugin_type | 否 | int | 插件类型 |
plugin_data_id | 否 | 门店或者酒店id.plugin_type是0就不传 |
返回示例:
正确时返回:
{
"result": 1,
"msg": "ok",
"data": [
{
"id": 169,
"name": "水果",
"parent_id": 0,
"has_many_children": [
{
"id": 170,
"name": "苹果",
"parent_id": 169,
"has_many_children": [
{
"id": 178,
"name": "红苹果",
"parent_id": 170
}
]
}
]
},
{
"id": 167,
"name": "餐具",
"parent_id": 0,
"has_many_children": [
{
"id": 168,
"name": "碗",
"parent_id": 167,
"has_many_children": []
}
]
},
{
"id": 165,
"name": "电子产品",
"parent_id": 0,
"has_many_children": [
{
"id": 166,
"name": "手机",
"parent_id": 165,
"has_many_children": []
}
]
},
{
"id": 161,
"name": "家具",
"parent_id": 0,
"has_many_children": [
{
"id": 162,
"name": "桌子",
"parent_id": 161,
"has_many_children": []
}
]
},
{
"id": 159,
"name": "食品",
"parent_id": 0,
"has_many_children": [
{
"id": 160,
"name": "糖",
"parent_id": 159,
"has_many_children": []
}
]
}
]
}
错误时返回:
{}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
id | int | 分类id |
name | string | 名称 |
parent_id | int | 上级id |
has_many_children | array | 下级 |
备注:
- 更多返回错误代码请看首页的错误代码描述