查询我点赞的帖子接口[列表]

  • 接口说明: 查询我点赞的帖子[列表]
  • 接口地址: /api/likes
  • 请求方式: GET

请求参数

参数名称类型是否必须描述
includestring关联数据

请求示例

  1. // include 可选值
  2. // user 作者(默认)
  3. // thread 主题(默认)
  4. /api/posts?include=user,thread

返回说明

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

返回结果

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

参数名称类型出现要求描述
linksobject接口链接
dataobject基础数据
typestring数据类型
idint数据 id
attributesobject数据属性
attributes.contentstring内容
attributes.ipstring发布 ip
attributes.replyCountint回复数
attributes.likeCountint喜欢数
attributes.createdAtdatetime创建时间
attributes.updatedAtdatetime修改时间
attributes.deletedAtdatetime在回收站时删除时间
attributes.isFirstbool是否首帖
attributes.isApprovedbool是否合法(0/1/2)
0 不合法
1 正常
2 忽略
attributes.isLikedbool是否喜欢
relationshipsobject关联关系
includedobject关联数据

返回示例

  1. {
  2. "links": {
  3. "first": "http://discuz.test/api/threads?page%5Blimit%5D=2",
  4. "next": "http://discuz.test/api/threads?page%5Blimit%5D=2&page%5Boffset%5D=2",
  5. "last": "http://discuz.test/api/threads?page%5Blimit%5D=2&page%5Boffset%5D=6"
  6. },
  7. "data": [
  8. {
  9. "type": "posts",
  10. "id": "8",
  11. "attributes": {
  12. "content": "Creative vertical == mint green == Berkshire Metical",
  13. "ip": "127.0.0.1",
  14. "replyCount": 0,
  15. "likeCount": 2,
  16. "createdAt": "2019-11-12T17:10:43+08:00",
  17. "updatedAt": "2019-11-12T17:10:43+08:00",
  18. "isFirst": true,
  19. "isApproved": 1,
  20. "canApprove": true,
  21. "canDelete": true,
  22. "canLike": true,
  23. "isLiked": true,
  24. "likedAt": "2019-11-25T14:45:46+08:00"
  25. },
  26. "relationships": {
  27. "user": {
  28. "data": {
  29. "type": "users",
  30. "id": "1"
  31. }
  32. },
  33. "thread": {
  34. "data": {
  35. "type": "threads",
  36. "id": "8"
  37. }
  38. }
  39. }
  40. },
  41. {
  42. "type": "posts",
  43. "id": "17",
  44. "attributes": {
  45. "content": "plug-and-play input Licensed == purple == Intelligent Gorgeous Web orange",
  46. "ip": "127.0.0.1",
  47. "replyCount": 0,
  48. "likeCount": 0,
  49. "createdAt": "2019-11-12T17:10:49+08:00",
  50. "updatedAt": "2019-11-12T17:10:49+08:00",
  51. "isFirst": true,
  52. "isApproved": 1,
  53. "canApprove": true,
  54. "canDelete": true,
  55. "canLike": true,
  56. "isLiked": true,
  57. "likedAt": "2019-11-25T10:45:45+08:00"
  58. },
  59. "relationships": {
  60. "user": {
  61. "data": {
  62. "type": "users",
  63. "id": "1"
  64. }
  65. },
  66. "thread": {
  67. "data": {
  68. "type": "threads",
  69. "id": "17"
  70. }
  71. }
  72. }
  73. }
  74. ],
  75. "included": [
  76. {
  77. "type": "users",
  78. "id": "1",
  79. "attributes": {
  80. "id": 1,
  81. "username": "username",
  82. "mobile": "",
  83. "avatarUrl": null,
  84. "threadCount": null,
  85. "registerIp": null,
  86. "lastLoginIp": "127.0.0.1",
  87. "createdAt": "2019-10-11T00:00:00+08:00",
  88. "updatedAt": "2019-11-11T14:51:34+08:00"
  89. }
  90. },
  91. {
  92. "type": "threads",
  93. "id": "8",
  94. "attributes": {
  95. "title": "",
  96. "price": "0.00",
  97. "viewCount": 0,
  98. "postCount": 1,
  99. "likeCount": 0,
  100. "createdAt": "2019-11-12T17:10:43+08:00",
  101. "updatedAt": "2019-11-12T17:10:43+08:00",
  102. "isApproved": 1,
  103. "isSticky": false,
  104. "isEssence": false,
  105. "canApprove": true,
  106. "canSticky": true,
  107. "canEssence": true,
  108. "canDelete": true,
  109. "canFavorite": true
  110. }
  111. },
  112. {
  113. "type": "threads",
  114. "id": "17",
  115. "attributes": {
  116. "title": "",
  117. "price": "0.00",
  118. "viewCount": 2,
  119. "postCount": 1,
  120. "likeCount": 0,
  121. "createdAt": "2019-11-12T17:10:49+08:00",
  122. "updatedAt": "2019-11-22T11:02:52+08:00",
  123. "isApproved": 1,
  124. "isSticky": false,
  125. "isEssence": false,
  126. "canApprove": true,
  127. "canSticky": true,
  128. "canEssence": true,
  129. "canDelete": true,
  130. "canFavorite": true,
  131. "isFavorite": true,
  132. "favoriteAt": "2019-11-14T14:25:01+08:00"
  133. }
  134. }
  135. ],
  136. "meta": {
  137. "postCount": 8,
  138. "pageCount": 4
  139. }
  140. }