发现板块下的“话题”
内容展示参照返回数据的备注说明
请求接口:
/api/topics?page[number]=1&page[limit]=20&sort=recommended
返回数据:
{
"links": {
"first": "https://x.chat/api/topics?page%5Blimit%5D=20&sort=recommended",
"next": "https://x.chat/api/topics?page%5Bnumber%5D=2&page%5Blimit%5D=20&sort=recommended",
"last": "https://x.chat/api/topics?page%5Bnumber%5D=17&page%5Blimit%5D=20&sort=recommended"
},
"data": [
{
"type": "topics",
"id": "256",
"attributes": {
"user_id": 18433,
"content": "川宝也要当站长啦", // 话题
"thread_count": 3,
"view_count": 628, // 话题热度
"recommended": 0, // 是否推荐 >0 则为推荐
"updated_at": "2021-06-01T14:45:18+08:00",
"created_at": "2021-01-09T10:57:41+08:00",
"recommended_at": null
}
},
{
"type": "topics",
"id": "7",
"attributes": {
"user_id": 3865,
"content": "自己创个话题行不",
"thread_count": 3,
"view_count": 347,
"recommended": 0,
"updated_at": "2021-05-31T08:05:33+08:00",
"created_at": "2020-06-30T23:18:52+08:00",
"recommended_at": null
}
}
],
"meta": {
"total": 326,
"pageCount": 17
}
}
示意图: