发现板块下的“话题”

    内容展示参照返回数据的备注说明

    请求接口:
    /api/topics?page[number]=1&page[limit]=20&sort=recommended

    返回数据:

    1. {
    2. "links": {
    3. "first": "https://x.chat/api/topics?page%5Blimit%5D=20&sort=recommended",
    4. "next": "https://x.chat/api/topics?page%5Bnumber%5D=2&page%5Blimit%5D=20&sort=recommended",
    5. "last": "https://x.chat/api/topics?page%5Bnumber%5D=17&page%5Blimit%5D=20&sort=recommended"
    6. },
    7. "data": [
    8. {
    9. "type": "topics",
    10. "id": "256",
    11. "attributes": {
    12. "user_id": 18433,
    13. "content": "川宝也要当站长啦", // 话题
    14. "thread_count": 3,
    15. "view_count": 628, // 话题热度
    16. "recommended": 0, // 是否推荐 >0 则为推荐
    17. "updated_at": "2021-06-01T14:45:18+08:00",
    18. "created_at": "2021-01-09T10:57:41+08:00",
    19. "recommended_at": null
    20. }
    21. },
    22. {
    23. "type": "topics",
    24. "id": "7",
    25. "attributes": {
    26. "user_id": 3865,
    27. "content": "自己创个话题行不",
    28. "thread_count": 3,
    29. "view_count": 347,
    30. "recommended": 0,
    31. "updated_at": "2021-05-31T08:05:33+08:00",
    32. "created_at": "2020-06-30T23:18:52+08:00",
    33. "recommended_at": null
    34. }
    35. }
    36. ],
    37. "meta": {
    38. "total": 326,
    39. "pageCount": 17
    40. }
    41. }

    示意图:
    image.png