文档
测试

获取文章信息列表

GET
http://{{host}}/API/V1/articles?pagesize=10&order=clicks&reverse=1&offset=0

接口描述

获取文章的描述性信息,包括文章id 点击量,作者,分类,标题,摘要,发布日期,点赞量,点击量,可以通过查询参数限制获取数量上限,类别,排列方式

请求参数

参数名
类型
描述
必填
pagesize
number
限制获取文章的数据上限
可选
offset
number
偏移量,默认为0
可选
order
string
pubdate: 按发布时间排序;clicks: 点击量排序, 默认按id排列
可选
reverse
number
是否反序排列,在使用order参数时生效,默认为0,升序排列
可选
category
string
类别名称
必填
author
string
作者姓名
必填
title
string
标题
必填

响应参数

application/json
参数名
类型
描述
必填
code
int
示例:1
必填
message
string
示例:成功
必填
result
object
数据字典
必填
total
int
示例:9
必填
article_infos
array
数据列表
必填
id
int
示例:6
必填
article_id
number
文章ID
必填
title
string
文章标题
必填
category_id
number
分类代号,需要包含在分类代号表中
必填
pubdate
string<Date>
可为空,默认值为上传至数据库的时间
必填
author
string
作者
必填
abstract
string
内容摘要
必填
clicks
number
点击量
必填
alias
string
类别别名
必填
title
string
示例:test3
必填
author
string
示例:test
必填
category_id
int
示例:3
必填
alias
string
示例:美食
必填
pubdate
string
示例:2021-12-13 18:11:52
必填
abstract
string
示例:test
必填
clicks
int
示例:110
必填

说明 / 示例

成功响应 ```js { "code": 1, "message": "成功", "result": { "total": 9, "article_infos": [ { "id": 6, "title": "test3", "author": "test", "category_id": 3, "alias": "美食", "pubdate": "2021-12-13 18:11:52", "abstract": "test", "clicks": 110 }, { "id": 5, "title": "test2", "author": "test", "category_id": 2, "alias": "时政", "pubdate": "2021-12-13 18:09:40", "abstract": "test", "clicks": 10 }, { "id": 11, "title": "test", "author": "test", "category_id": 1, "alias": "航空航天", "pubdate": "2021-08-09 11:00:00", "abstract": "test", "clicks": 0 }, { "id": 12, "title": "test", "author": "test", "category_id": 1, "alias": "航空航天", "pubdate": "2021-08-09 11:00:00", "abstract": "test", "clicks": 0 } ] } } ```