跳到主要内容

文章分类

获取栏目导航

获取资讯、视频、直播、活动等栏目导航。

  • URL/app-api/promotion/article-category/list
  • MethodPOST
  • 需要鉴权:是

请求参数

参数类型约束说明
parentIdLong必传栏目导航编号,传 0 获取顶级导航;传某个导航的 id 则返回其子导航
isSubBoolean必传是否获取子导航,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": "成功"
}

响应说明

参数类型说明
idLong导航编号
nameString导航标题
parentIdLong父导航编号
sortLong排序,严格按照顺序:1、2、3... 数字小的在前
picUrlString导航图片地址(如有则展示)
statusLong状态,0-正常,1-禁用
routeString路由地址,即该导航的跳转地址
subCategoryListArray子导航列表

分页获取资讯

通过栏目导航接口获取到二级分类的 id,将 id 作为 categoryId 入参获取对应分类下的文章。

  • URL/app-api/promotion/article/page
  • MethodPOST
  • 需要鉴权:是

请求参数

参数类型约束说明
categoryIdLong-文章分类编号,如艺术分类 id=3 则获取该分类下的资讯
articleTypeLong必传文章类型,1-资讯,2-视频,3-活动
titleString-文章标题,模糊搜索,点击搜索按钮时调用
recommendHotBoolean-是否热门资讯,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": "成功"
}

响应说明

通用字段:

参数类型说明
idLong数据编号
titleString标题
authorString作者
categoryIdLong分类编号
picUrlString封面
introductionString简介
createTimeLong发布时间
browseCountLong浏览次数
spuIdLong挂载商品编号
shareTimesLong分享次数
commentTimesLong评论次数
collectTimesLong收藏次数
likeTimesLong点赞次数
articleTypeLong文章类型

当 articleType 为资讯时:

参数类型说明
recommendHotBoolean是否热门资讯
contentString资讯内容

当 articleType 为视频时:

参数类型说明
videoUrlString视频地址

当 articleType 为活动时:

参数类型说明
contentString活动内容
activityStatusLong活动状态,0-未开始,1-已开始,2-已结束
activityStartTimeLong开始时间
activityEndTimeLong结束时间
activityPriceBigDecimal活动价格
activityAddressString活动地址

获取资讯详情

获取文章详情,不同类型数据结构不同。

  • URL/app-api/promotion/article/get
  • MethodPOST
  • 需要鉴权:是

请求参数

参数类型约束说明
idLong必传文章数据编号
articleTypeLong必传文章类型,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": "成功"
}

响应说明

通用字段:

参数类型说明
idLong数据编号
titleString标题
authorString作者
categoryIdLong分类编号
picUrlString封面
introductionString简介
createTimeLong发布时间
browseCountLong浏览次数
spuIdLong挂载商品编号,如需展示商品详情需调用商品详情接口
shareTimesLong分享次数
commentTimesLong评论次数
collectTimesLong收藏次数
likeTimesLong点赞次数
isCollectBoolean当前用户是否收藏
isLikeBoolean当前用户是否点赞
articleTypeLong文章类型

当 articleType 为资讯时:

参数类型说明
recommendHotBoolean是否热门资讯
contentString资讯内容

当 articleType 为视频时:

参数类型说明
videoUrlString视频地址

当 articleType 为活动时:

参数类型说明
contentString活动内容
activityStatusLong活动状态,0-未开始,1-已开始,2-已结束
activityStartTimeLong开始时间
activityEndTimeLong结束时间
activityPriceBigDecimal活动价格
activityAddressString活动地址

增加浏览次数

增加资讯、视频、活动页面的浏览次数。

  • URL/app-api/promotion/article/addBrowseCount
  • MethodPOST
  • 需要鉴权:是

请求参数

参数类型约束说明
idLong必传文章数据编号

请求示例

{
"id": 7
}

响应示例

{
"code": 0,
"data": true,
"msg": "成功"
}

响应说明

参数类型说明
dataBooleantrue 成功,false 失败