简要描述:
- 自定义分类功能接口
请求域名:
- http://xx.com
请求URL:
route=plugin.aggregation-cps.api.link-category.getCategory
参数:
参数名 | 是否必须 | 类型 | 说明 |
---|---|---|---|
parent_id | 否 | int | 父分类id,不传或者传0时,取一级分类 |
get_type | 否 | int | 遍历下级层级,0为不遍历,1为遍历1层,2为遍历2层,超过最大层级不会继续遍历 |
举例:
- 获取所有分类:parent_id=0&get_type=2
- 只获取一级分类:parent_id=0&get_type=0
- 获取一级分类和二级分类:parent_id=0&get_type=1
- 获取指定一级分类下的所有分类:parent_id=1&get_type=2
- 获取指定一级分类下的所有二级分类:parent_id=1&get_type=0
返回示例:
正确时返回:
{
"result": 1,
"msg": "成功",
"data": {
"max_level": 3,
"shape": 2,
"radius": 70,
"list": [
{
"id": 2205,
"title": "新增功能测试分类",
"level": 1,
"parent_id": 0,
"need_login": 0,
"target_type": -1,
"target": {
"keyword": "新增功能测试分类",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "",
"list_type": "",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/291cbfd431992ee3147c1071706aa906.jpg",
"sort": 9999,
"child": [
{
"id": 2206,
"title": "活动转链",
"level": 2,
"parent_id": 2205,
"need_login": 0,
"target_type": -1,
"target": {
"keyword": "活动转链",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "",
"list_type": "",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/471435d59394dab64caa6ec711bcdb06.jpg",
"sort": 5,
"child": [
{
"id": 2210,
"title": "京东活动转链",
"level": 3,
"parent_id": 2206,
"need_login": 1,
"target_type": -9,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "3",
"activity_info": "https:www.baidu.com",
"list_id": "",
"list_type": "",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/5220181ecb15f2ee33f8b0dfa5c33387.jpg",
"sort": 2
},
{
"id": 2209,
"title": "淘宝活动转链",
"level": 3,
"parent_id": 2206,
"need_login": 1,
"target_type": -9,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "1",
"activity_info": "1571715733668",
"list_id": "",
"list_type": "",
"album_type": "",
"album_id": ""
},
"cover": "http://zouye.yunzmall.com/static/upload/images/1/2020/10/ZOm9nJZ94knX4vpoVQppp7B664mvX9.jpg",
"sort": 1
}
]
},
{
"id": 2207,
"title": "特殊商品资源",
"level": 2,
"parent_id": 2205,
"need_login": 0,
"target_type": -1,
"target": {
"keyword": "特殊商品资源",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "",
"list_type": "",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/thumb/goods_gallery/app/2020/09/26418293aa1b21275bb615142ba0f045.jpg",
"sort": 3,
"child": [
{
"id": 2211,
"title": "京东爆品",
"level": 3,
"parent_id": 2207,
"need_login": 1,
"target_type": -10,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "112",
"list_type": "2",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/291cbfd431992ee3147c1071706aa906.jpg",
"sort": 1
},
{
"id": 2213,
"title": "拼多多今日爆款",
"level": 3,
"parent_id": 2207,
"need_login": 1,
"target_type": -10,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "1",
"list_type": "3",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/thumb/goods_gallery/app/2020/09/719836b3abe2ed48cce605ab38772bc1.jpg",
"sort": 0
},
{
"id": 2212,
"title": "淘宝聚划算满减满折",
"level": 3,
"parent_id": 2207,
"need_login": 1,
"target_type": -10,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "32366",
"list_type": "1",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/5f9a4af715b36248653f62d177f7d7a4.jpg",
"sort": 0
}
]
},
{
"id": 2208,
"title": "专辑",
"level": 2,
"parent_id": 2205,
"need_login": 0,
"target_type": -1,
"target": {
"keyword": "专辑",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "",
"list_type": "",
"album_type": "",
"album_id": ""
},
"cover": "https://images.renrencai.cn/sku_goods_img/2020/09/71647eda34cf1200cb0f440c83bc7e69.jpg",
"sort": 1,
"child": [
{
"id": 2215,
"title": "专辑列表",
"level": 3,
"parent_id": 2208,
"need_login": 1,
"target_type": -11,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "",
"list_type": "",
"album_type": "1",
"album_id": ""
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/fe541d13229ac364041522b5320c7cd7.jpg",
"sort": 0
},
{
"id": 2214,
"title": "专辑商品1",
"level": 3,
"parent_id": 2208,
"need_login": 1,
"target_type": -11,
"target": {
"keyword": "",
"app_route": "",
"web_title": "",
"web_url": "",
"mini_route": "",
"mini_id": "",
"brand_id": 0,
"brand_goods_id": 0,
"another_plat": "",
"activity_info": "",
"list_id": "",
"list_type": "",
"album_type": "2",
"album_id": "55"
},
"cover": "https://images.renrencai.cn/goods_desc/2020/09/a231c18518b52a14170e4d85dc65ce69.jpg",
"sort": 0
}
]
}
]
}
]
}
}
错误时返回:
{
}
返回参数说明:
参数名 | 类型 | 说明 |
---|---|---|
名称 | 类型 | 说明 |
max_level | int | 最大层级,2或3 |
shape | int | 分类形状 1圆形 2直角矩形 3圆角矩形 |
radius | int | 圆角矩形的圆角半径,小数,单位px |
list[ ]->id | int | 分类id |
list[ ]->parent_id | int | 父级分类id,没有则为0 |
list[ ]->title | string | 分类名称 |
list[ ]->level | int | 分类层级 |
list[ ]->need_login | int | 是否需要登录,0不需要,1需要 |
list[ ]->cover | string | 分类图标链接 |
list[ ]->child | arr | 下级遍历分类数据,注:该字段不一定存在 |
list[ ]->target_type | int | 按钮类型 0分类 -1淘宝 -2京东 -3拼多多 -4网页 -5自定义(app) -6小程序 -7品牌券 -8品牌券商品 -9大促转链 -10特色资源列表 -11专辑 |
list[ ]->target | arr | 按钮数据详情 |
list[ ]->target->keyword | string | 关键词,跳转淘宝京东拼多多用 |
list[ ]->target->web_url | string | 网页链接,跳转网页用 |
list[ ]->target->web_title | string | 网页标题,跳转网页用 |
list[ ]->target->app_route | string | app路径,自定义跳转app用 |
list[ ]->target->mini_route | string | 小程序路径,跳转小程序用 |
list[ ]->target->mini_id | string | 小程序原生id,跳转小程序用 |
list[ ]->target->brand_id | int | 品牌id |
list[ ]->target->brand_goods_id | int | 品牌商品id |
list[ ]->target->list_type | string | 特色资源列表类型 1淘宝特色物料 2京东特色列表 3拼多多特色列表 4拼多多爆款排行 |
list[ ]->target->list_id | string | 特色资源列表标识,4时为空字符串,2和3时为请求接口的channel_type,1时为请求接口的material_id |
list[ ]->target->another_plat | string | 大促转链平台类型 1淘宝 3京东 |
list[ ]->target->activity_info | string | 大促转链淘宝会场id或京东活动链接 |
list[ ]->target->album_type | string | 专辑页面类型 1专辑列表 2专辑详情 |
list[ ]->target->album_id | string | 专辑id,页面类型为1时是空字符串 |