查询用户点赞的主题列表接口[列表]

  • 接口说明: 查询我收藏的主题[列表]
  • 接口地址: /api/threads/likes
  • 请求方式: GET

请求参数

参数名称类型是否必须描述
includestring关联数据
filter[user_id]int用户 ID
  1. 示例:
  2. {{host}}/api/threads/likes?include=user,firstPost,user.groups,firstPost,firstPost.images,threadVideo,firstPost.likedUsers&page[number]=1&page[limit]=20&filter[user_id]=4

include 可选值:

参数名称类型是否必须是否默认描述
userusersobject发表用户
firstPostpostsobject首帖
threadVideothread-videoobject视频
categorycategoriesobject主题分类
user.groupsgroupsobject用户所在群组
firstPost.imagesattachmentsarray首贴图片
firstPost.likedUsersusersarray点赞首帖的用户

请求示例

返回说明

  • 成功,http 状态码: 200
  • 失败,http 状态码: 404

返回结果

关联数据模型字段释义参见请参见相应文档

参数名称类型出现要求描述
linksobject接口链接
dataobject基础数据
typestring数据类型
idint数据 id
attributesobject数据属性
typeint文章类型(0 普通 1 长文 2 视频)
titlestring长文主题标题
pricefloat长文主题主题价格
attachment_pricefloat附件价格
viewCountint查看数
postCountint帖子数
paidCountint付费数
createdAtdatetime创建时间
updatedAtdatetime修改时间
deletedAtdatetime在回收站时删除时间
isApprovedbool是否合法(0/1/2)
0 不合法
1 正常
2 忽略
isStickybool是否置顶
isEssencebool是否加精
isFavoritebool已收藏时是否收藏
isSitebool是否推荐到站点信息页
paidbool付费主题是否付费
canViewPostsbool是否有权查看详情
canReplybool是否有权回复
canApprovebool是否有权审核
canStickybool是否有权置顶
canEssencebool是否有权加精
canDeletebool是否有权永久删除
canHidebool是否有权放入回收站
canFavoritebool是否有权收藏
relationshipsobject关联关系
thread-video. statusint视频状态 0:转码中 1 转码完成 2 转码失败
thread-video. reasonstring转码失败原因
thread-video. file_namestring视频文件名称
thread-video. file_idstring媒体文件唯一标识
thread-video. media_urlstring媒体播放地址
thread-video. cover_urlstring媒体封面地址
includedobject关联数据

返回示例

  1. {
  2. "links": {
  3. "first": "http://discuz.test/api/threads?page%5Blimit%5D=1",
  4. "next": "http://discuz.test/api/threads?page%5Blimit%5D=1&page%5Boffset%5D=1",
  5. "last": "http://discuz.test/api/threads?page%5Blimit%5D=1&page%5Boffset%5D=4"
  6. },
  7. "data": [
  8. {
  9. "type": "threads",
  10. "id": "31",
  11. "attributes": {
  12. "title": "",
  13. "price": "0.00",
  14. "attachment_price": "0.00",
  15. "viewCount": 0,
  16. "postCount": 1,
  17. "likeCount": 0,
  18. "createdAt": "2019-11-12T17:10:59+08:00",
  19. "updatedAt": "2019-11-12T17:10:59+08:00",
  20. "isApproved": 1,
  21. "isSticky": true,
  22. "isEssence": true,
  23. "canApprove": true,
  24. "canSticky": true,
  25. "canEssence": true,
  26. "canDelete": true,
  27. "canFavorite": true,
  28. "isFavorite": true,
  29. "favoriteAt": "2019-11-18T14:13:18+08:00"
  30. },
  31. "relationships": {
  32. "user": {
  33. "data": {
  34. "type": "users",
  35. "id": "1"
  36. }
  37. },
  38. "firstPost": {
  39. "data": {
  40. "type": "posts",
  41. "id": "31"
  42. }
  43. }
  44. }
  45. }
  46. ],
  47. "included": [
  48. {
  49. "type": "users",
  50. "id": "1",
  51. "attributes": {
  52. "id": 1,
  53. "username": "username",
  54. "mobile": "",
  55. "avatarUrl": null,
  56. "threadCount": null,
  57. "registerIp": null,
  58. "lastLoginIp": "127.0.0.1",
  59. "createdAt": "2019-10-11T00:00:00+08:00",
  60. "updatedAt": "2019-11-11T14:51:34+08:00"
  61. }
  62. },
  63. {
  64. "type": "posts",
  65. "id": "31",
  66. "attributes": {
  67. "content": "Pants Personal Loan Account == grey == Ergonomic Metal Tuna generating",
  68. "ip": "127.0.0.1",
  69. "replyCount": 0,
  70. "likeCount": 0,
  71. "createdAt": "2019-11-12T17:10:59+08:00",
  72. "updatedAt": "2019-11-12T17:10:59+08:00",
  73. "isFirst": true,
  74. "isApproved": 1,
  75. "canApprove": true,
  76. "canDelete": true,
  77. "canLike": true
  78. }
  79. }
  80. ],
  81. "meta": {
  82. "threadCount": 5,
  83. "pageCount": 5
  84. }
  85. }