查询回复接口[列表]

  • 接口说明: 查询回复[列表]
  • 接口地址: /api/posts
  • 请求方式: GET

请求参数

参数名称类型是否必须描述
includestring关联数据
filter[q]string关键词
filter[userId]int作者 ID
filter[username]string作者用户名
filter[deletedUserId]int操作删除者 ID
filter[deletedUsername]string操作删除者用户名
filter[createdAtBegin]string发表于(开始时间)
filter[createdAtEnd]string发表于(结束时间)
filter[deletedAtBegin]string删除于(开始时间)
filter[deletedAtEnd]string删除于(结束时间)
filter[categoryId]int分类 ID
filter[thread]int主题 ID
filter[reply]int回复 ID
filter[isApproved]string是否合法(0/1/2)
0 不合法
1 正常
2 忽略
filter[isDeleted]string是否删除(yes/no)
filter[isComment]string是否是回复的评论(yes/no)
filter[highlight]string是否高亮敏感词(yes/no)

include 可关联的数据

关联名称模型类型是否默认描述
userusersobject发表用户
replyUserusersobject所回复的用户
imagesattachmentsarray回复下的图片
threadthreadsobject所属主题
user.groupsgroupsobject用户所在群组
thread.categorycategoriesobject所属主题的分类
thread.firstPostpostsobject所属主题的首贴
lastThreeCommentspostsobject最后三条回复
lastThreeComments.userpostsobject最后三条回复的作者
lastThreeComments.replyUserpostsobject最后三条回复被回复的用户
lastThreeComments.imagesattachmentsobject最后三条回复的图片
deletedUserusersobject删除用户
lastDeletedLogoperation-logsobject最后一次被删除的操作日志

请求示例

  1. // 用户 ID
  2. /api/posts?filter[userId]=1
  3. // 主题 ID
  4. /api/posts?filter[thread]=1
  5. // 回复 ID
  6. /api/posts?filter[reply]=1
  7. // 查看待审核 filter[isApproved]=0
  8. /api/posts?filter[isApproved]=0
  9. // 查看回收站 filter[isDeleted]=yes
  10. /api/posts?filter[isDeleted]=yes

返回说明

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

返回结果

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

参数名称类型出现要求描述
linksobject接口链接
dataobject基础数据
typestring数据类型
idint数据 id
attributesobject数据属性
replyUserIdint|null所回复的用户 ID
summarystring摘要
contentstring内容
contentHtmlstringhtml 内容
ipstring发布 ip
replyCountint回复数
likeCountint喜欢数
createdAtdatetime创建时间
updatedAtdatetime修改时间
deletedAtdatetime在回收站时删除时间
isFirstbool是否首帖
isCommentbool是否是评论
isApprovedbool是否合法(0/1/2)
0 不合法
1 正常
2 忽略
isLikedbool是否喜欢
canEditbool是否有权编辑
canApprovebool是否有权审核
canDeletebool是否有权永久删除
canHidebool是否有权放入回收站
canLikebool是否有权点赞
isLikedbool是否喜欢
relationshipsobject关联关系
includedobject关联数据

返回示例

  1. {
  2. "data": [
  3. {
  4. "type": "Posts",
  5. "id": "1",
  6. "attributes": {
  7. "content": "<span>asdaasd</span><i>hahahahh</i> :ku: Idaho Yuan Renminbi Gorgeous Soft <span class=\"highlight\">Car</span> eco-centric == purple == neural Orchard Computer fuchsia optimizing",
  8. "contentHtml": "<span>asdaasd</span>&lt;i&gt;hahahahh&lt;/i&gt; <img src=\"emoji/qq/ku.gif\" alt=\":ku:\"> Idaho Yuan Renminbi Gorgeous Soft <span class=\"highlight\">Car</span> eco-centric == purple == neural Orchard Computer fuchsia optimizing",
  9. "ip": "127.0.0.1",
  10. "replyCount": 0,
  11. "likeCount": 0,
  12. "createdAt": "2019-11-12T17:10:23+08:00",
  13. "updatedAt": "2019-11-12T17:10:23+08:00",
  14. "isFirst": true,
  15. "isApproved": true,
  16. "isLiked": false
  17. },
  18. "relationships": {
  19. "user": {
  20. "data": {
  21. "type": "users",
  22. "id": "1"
  23. }
  24. }
  25. }
  26. },
  27. {
  28. "type": "Posts",
  29. "id": "2",
  30. "attributes": {
  31. "content": "Berkshire Legacy Public-key Bedfordshire Auto Loan Account == lime == Group incentivize exploit backing up port",
  32. "ip": "127.0.0.1",
  33. "replyCount": 0,
  34. "likeCount": 0,
  35. "createdAt": "2019-11-12T17:10:27+08:00",
  36. "updatedAt": "2019-11-12T17:10:27+08:00",
  37. "isFirst": true,
  38. "isApproved": true,
  39. "isLiked": false
  40. },
  41. "relationships": {
  42. "user": {
  43. "data": {
  44. "type": "users",
  45. "id": "1"
  46. }
  47. }
  48. }
  49. }
  50. ],
  51. "included": [
  52. {
  53. "type": "users",
  54. "id": "1",
  55. "attributes": {
  56. "username": "username",
  57. "nickname": null,
  58. "mobile": "",
  59. "unionId": "",
  60. "lastLoginIp": "127.0.0.1",
  61. "createdAt": "2019-10-11T00:00:00+08:00",
  62. "updatedAt": "2019-11-11T14:51:34+08:00"
  63. }
  64. }
  65. ]
  66. }