修改回复接口[单条]

  • 接口说明: 修改回复[单条]
  • 接口地址: /api/posts/{id}
  • 请求方式: PATCH

请求参数

参数名称类型是否必须描述示例
contentstring内容
isApprovedint是否合法(0/1/2)
0 不合法
1 正常
2 忽略
isDeletedbool是否删除(回收站)
isLikedbool是否喜欢
messagestring操作原因

请求示例

  1. {
  2. "data": {
  3. "type": "posts",
  4. "attributes": {
  5. "isApproved": 0,
  6. "isDeleted": 0,
  7. "isLiked": 1
  8. }
  9. }
  10. }

返回说明

  • 成功,http 状态码 201
  • 失败,http 状态码 500

返回结果

参数名称类型出现要求描述
dataobject基础数据
typestring数据类型
idint数据 id
attributesobject数据属性
attributes.summarystring摘要
attributes.contentstring内容
attributes.contentHtmlstringhtml 内容
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. "data": {
  3. "type": "Posts",
  4. "id": "24",
  5. "attributes": {
  6. "id": 24,
  7. "user_id": 2,
  8. "thread_id": 4,
  9. "reply_id": 0,
  10. "content": "Ruike & modity is coming!!!",
  11. "ip": "127.0.0.1",
  12. "reply_count": 0,
  13. "like_count": 0,
  14. "created_at": "2019-10-18T14:14:10+08:00",
  15. "updated_at": "2019-10-24T17:01:41+08:00",
  16. "deleted_at": null,
  17. "deleted_user_id": 0,
  18. "is_first": false,
  19. "is_approved": true
  20. }
  21. }
  22. }{
  23. "data": {
  24. "type": "Posts",
  25. "id": "19",
  26. "attributes": {
  27. "content": "4th generation back up implementation RAM == azure == Lake Garden",
  28. "ip": "127.0.0.1",
  29. "replyCount": 0,
  30. "likeCount": 0,
  31. "createdAt": "2019-11-12T17:10:51+08:00",
  32. "updatedAt": "2019-11-12T17:10:51+08:00",
  33. "isFirst": true,
  34. "isApproved": false,
  35. "isLiked": true
  36. },
  37. "relationships": {
  38. "thread": {
  39. "data": {
  40. "type": "Threads",
  41. "id": "19"
  42. }
  43. }
  44. }
  45. },
  46. "included": [
  47. {
  48. "type": "Threads",
  49. "id": "19",
  50. "attributes": {
  51. "title": "",
  52. "price": "0.00",
  53. "viewCount": 0,
  54. "postCount": 1,
  55. "likeCount": 0,
  56. "createdAt": "2019-11-12T17:10:51+08:00",
  57. "updatedAt": "2019-11-12T17:10:51+08:00",
  58. "isApproved": true,
  59. "isSticky": false,
  60. "isEssence": false,
  61. "isFavorite": false
  62. }
  63. }
  64. ]
  65. }