查询我收藏的主题接口[列表]

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

请求参数

参数名称类型是否必须描述
includestring关联数据
  1. 示例:
  2. include=user,firstPost

include 可关联的数据

关联名称模型类型是否默认描述
userusersobject发表用户
firstPostpostsobject首帖
threadVideothread-videoobject视频
lastPostedUserusersobject最后回复用户
categorycategoriesobject主题分类
user.groupsgroupsobject用户所在群组
deletedUserusersobject删除用户
firstPost.imagesattachmentsarray首贴图片
firstPost.likedUsersusersarray点赞首帖的用户
lastThreePostspostsarray最后三条回复
lastThreePosts.userusersobject最后三条回复的作者
lastThreePosts.replyUserusersobject最后三条回复所回复的用户
rewardedUsersusersarray打赏主题的用户

请求示例

返回说明

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

返回结果

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

参数名称类型出现要求描述
linksobject接口链接
dataobject基础数据
typestring数据类型
idint数据 id
attributesobject数据属性
typeint文章类型(0 普通 1 长文 2 视频)
titlestring长文主题标题
pricefloat长文主题主题价格
viewCountint查看数
postCountint帖子数
paidCountint付费数
createdAtdatetime创建时间
updatedAtdatetime修改时间
deletedAtdatetime在回收站时删除时间
isApprovedbool是否合法(0/1/2)
0 不合法
1 正常
2 忽略
isStickybool是否置顶
isEssencebool是否加精
isFavoritebool已收藏时是否收藏
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. "viewCount": 0,
  15. "postCount": 1,
  16. "likeCount": 0,
  17. "createdAt": "2019-11-12T17:10:59+08:00",
  18. "updatedAt": "2019-11-12T17:10:59+08:00",
  19. "isApproved": 1,
  20. "isSticky": true,
  21. "isEssence": true,
  22. "canApprove": true,
  23. "canSticky": true,
  24. "canEssence": true,
  25. "canDelete": true,
  26. "canFavorite": true,
  27. "isFavorite": true,
  28. "favoriteAt": "2019-11-18T14:13:18+08:00"
  29. },
  30. "relationships": {
  31. "user": {
  32. "data": {
  33. "type": "users",
  34. "id": "1"
  35. }
  36. },
  37. "firstPost": {
  38. "data": {
  39. "type": "posts",
  40. "id": "31"
  41. }
  42. }
  43. }
  44. }
  45. ],
  46. "included": [
  47. {
  48. "type": "users",
  49. "id": "1",
  50. "attributes": {
  51. "id": 1,
  52. "username": "admin",
  53. "mobile": "",
  54. "avatarUrl": null,
  55. "threadCount": null,
  56. "registerIp": null,
  57. "lastLoginIp": "127.0.0.1",
  58. "createdAt": "2019-10-11T00:00:00+08:00",
  59. "updatedAt": "2019-11-11T14:51:34+08:00"
  60. }
  61. },
  62. {
  63. "type": "posts",
  64. "id": "31",
  65. "attributes": {
  66. "content": "Pants Personal Loan Account == grey == Ergonomic Metal Tuna generating",
  67. "ip": "127.0.0.1",
  68. "replyCount": 0,
  69. "likeCount": 0,
  70. "createdAt": "2019-11-12T17:10:59+08:00",
  71. "updatedAt": "2019-11-12T17:10:59+08:00",
  72. "isFirst": true,
  73. "isApproved": 1,
  74. "canApprove": true,
  75. "canDelete": true,
  76. "canLike": true
  77. }
  78. }
  79. ],
  80. "meta": {
  81. "threadCount": 5,
  82. "pageCount": 5
  83. }
  84. }