文章分类
获取栏目导航
获取资讯、视频、直播、活动等栏目导航。
- URL:
/app-api/promotion/article-category/list - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| parentId | Long | 必传 | 栏目导航编号,传 0 获取顶级导航;传某个导航的 id 则返回其子导航 |
| isSub | Boolean | 必传 | 是否获取子导航,true-是,false-否 |
请求示例
{
"parentId": 0,
"isSub": true
}
响应示例
{
"code": 0,
"data": [
{
"id": 1,
"name": "资讯",
"parentId": 0,
"picUrl": "https://example.com/image.png",
"sort": 1,
"status": 0,
"route": null,
"subCategoryList": [
{
"id": 3,
"name": "艺术",
"parentId": 1,
"picUrl": "",
"sort": 1,
"status": 0,
"route": null,
"subCategoryList": null
},
{
"id": 4,
"name": "生活",
"parentId": 1,
"picUrl": "https://example.com/image.jpg",
"sort": 2,
"status": 0,
"route": null,
"subCategoryList": null
}
]
},
{
"id": 2,
"name": "视频",
"parentId": 0,
"picUrl": "https://example.com/image.png",
"sort": 2,
"status": 0,
"route": null,
"subCategoryList": []
}
],
"msg": "成功"
}
响应说明
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 导航编号 |
| name | String | 导航标题 |
| parentId | Long | 父导航编号 |
| sort | Long | 排序,严格按照顺序:1、2、3... 数字小的在前 |
| picUrl | String | 导航图片地址(如有则展示) |
| status | Long | 状态,0-正常,1-禁用 |
| route | String | 路由地址,即该导航的跳转地址 |
| subCategoryList | Array | 子导航列表 |
分页获取资讯
通过栏目导航接口获取到二级分类的 id,将 id 作为 categoryId 入参获取对应分类下的文章。
- URL:
/app-api/promotion/article/page - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| categoryId | Long | - | 文章分类编号,如艺术分类 id=3 则获取该分类下的资讯 |
| articleType | Long | 必传 | 文章类型,1-资讯,2-视频,3-活动 |
| title | String | - | 文章标题,模糊搜索,点击搜索按钮时调用 |
| recommendHot | Boolean | - | 是否热门资讯,true-是,false-否,不传则不筛选 |
请求示例
{
"categoryId": 3
}
响应示例
{
"code": 0,
"data": {
"list": [
{
"id": 1,
"title": "文章标题",
"author": "",
"categoryId": 2,
"picUrl": "https://example.com/image.jpg",
"introduction": "文章简介",
"content": "<p>文章内容</p>",
"createTime": 1730280944000,
"browseCount": 0,
"spuId": 633,
"recommendHot": true,
"videoUrl": null,
"activityStatus": null,
"activityStartTime": null,
"activityEndTime": null,
"activityPrice": null,
"activityAddress": null,
"shareTimes": null,
"commentTimes": null,
"collectTimes": null,
"likeTimes": 0
}
],
"total": 1
},
"msg": "成功"
}
响应说明
通用字段:
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 数据编号 |
| title | String | 标题 |
| author | String | 作者 |
| categoryId | Long | 分类编号 |
| picUrl | String | 封面 |
| introduction | String | 简介 |
| createTime | Long | 发布时间 |
| browseCount | Long | 浏览次数 |
| spuId | Long | 挂载商品编号 |
| shareTimes | Long | 分享次数 |
| commentTimes | Long | 评论次数 |
| collectTimes | Long | 收藏次数 |
| likeTimes | Long | 点赞次数 |
| articleType | Long | 文章类型 |
当 articleType 为资讯时:
| 参数 | 类型 | 说明 |
|---|---|---|
| recommendHot | Boolean | 是否热门资讯 |
| content | String | 资讯内容 |
当 articleType 为视频时:
| 参数 | 类型 | 说明 |
|---|---|---|
| videoUrl | String | 视频地址 |
当 articleType 为活动时:
| 参数 | 类型 | 说明 |
|---|---|---|
| content | String | 活动内容 |
| activityStatus | Long | 活动状态,0-未开始,1-已开始,2-已结束 |
| activityStartTime | Long | 开始时间 |
| activityEndTime | Long | 结束时间 |
| activityPrice | BigDecimal | 活动价格 |
| activityAddress | String | 活动地址 |
获取资讯详情
获取文章详情,不同类型数据结构不同。
- URL:
/app-api/promotion/article/get - Method:
POST - 需要鉴权:是
请求参数
| 参数 | 类型 | 约束 | 说明 |
|---|---|---|---|
| id | Long | 必传 | 文章数据编号 |
| articleType | Long | 必传 | 文章类型,1-资讯,2-视频,3-活动 |
请求示例
{
"id": 3
}
响应示例
{
"code": 0,
"data": {
"id": 7,
"title": "文章标题",
"author": "aa",
"categoryId": 6,
"picUrl": "https://example.com/image.jpg",
"introduction": "文章简介",
"createTime": 1732376365000,
"browseCount": 2,
"spuId": 633,
"shareTimes": 0,
"commentTimes": 0,
"collectTimes": 0,
"likeTimes": 0,
"articleType": 3,
"recommendHot": false,
"content": "<p>活动内容</p>",
"activityStatus": 0,
"activityStartTime": 1732204800000,
"activityEndTime": 1732896000000,
"activityPrice": 111,
"activityAddress": "活动地址",
"isCollect": false,
"isLike": false
},
"msg": "成功"
}
响应说明
通用字段:
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 数据编号 |
| title | String | 标题 |
| author | String | 作者 |
| categoryId | Long | 分类编号 |
| picUrl | String | 封面 |
| introduction | String | 简介 |
| createTime | Long | 发布时间 |
| browseCount | Long | 浏览次数 |
| spuId | Long | 挂载商品编号,如需展示商品详情需调用商品详情接口 |
| shareTimes | Long | 分享次数 |
| commentTimes | Long | 评论次数 |
| collectTimes | Long | 收藏次数 |
| likeTimes | Long | 点赞次数 |
| isCollect | Boolean | 当前用户是否收藏 |
| isLike | Boolean | 当前用户是否点赞 |
| articleType | Long | 文章类型 |
当 articleType 为资讯时:
| 参数 | 类型 | 说明 |
|---|---|---|
| recommendHot | Boolean | 是否热门资讯 |
| content | String | 资讯内容 |
当 articleType 为视频时:
| 参数 | 类型 | 说明 |
|---|---|---|
| videoUrl | String | 视频地址 |
当 articleType 为活动时:
| 参数 |
|---|