用户 收藏的回答

优质
小牛编辑
131浏览
2023-12-01

收藏一个回答

POST /api/v2/user/question-answer/collections/:answer

响应

Header 201 Created

{
  "message": [
    "操作成功"
  ]
}

取消收藏一个回答

DELETE /api/v2/user/question-answer/collections/:answer

响应

Header 204 No Content

回答收藏列表

GET /api/v2/user/question-answer/collections

可选参数

名称类型必填说明
limitint-数据返回条数 默认20条
afterint-数据翻页标识

响应

Header 200 Ok

[
  {
    "id": 4,
    "user_id": 1,
    "collectible_id": 2,
    "collectible_type": "question-answers",
    "created_at": "2017-08-08 08:51:37",
    "updated_at": "2017-08-08 08:51:37",
    "collectible": {
      "id": 2,
      "question_id": 4,
      "user_id": 2,
      "body": null,
      "anonymity": 0,
      "adoption": 0,
      "invited": 1,
      "comments_count": 0,
      "rewards_amount": 0,
      "rewarder_count": 0,
      "likes_count": 1,
      "created_at": "2017-08-07 14:19:58",
      "updated_at": "2017-08-07 06:29:40",
      "could": false
    }
  },
  {
    "id": 3,
    "user_id": 1,
    "collectible_id": 1,
    "collectible_type": "question-answers",
    "created_at": "2017-08-08 08:51:37",
    "updated_at": "2017-08-08 08:51:37",
    "collectible": {
      "id": 1,
      "question_id": 4,
      "user_id": 1,
      "body": "阿斯顿发生的",
      "anonymity": 0,
      "adoption": 0,
      "invited": 0,
      "comments_count": 0,
      "rewards_amount": 0,
      "rewarder_count": 0,
      "likes_count": 1,
      "created_at": "2017-08-07 14:19:58",
      "updated_at": "2017-08-07 06:29:40"
    }
  }
]

返回参数

名称类型说明
idint收藏记录id 用于翻页
user_idint收藏用户id
created_atdate收藏时间
collectiblearray收藏数据信息
collectible.idint回答数据id
collectible.question_idint回答所属问题id
collectible.user_idint回答用户id 如果为匿名回答且回答者不是当前用户,该项值为0
collectible.bodystring回答内容 需要付费围观时为null
collectible.anonymityint

是否匿名

1-匿名回答

0-非匿名回答

collectible.adoptionint

是否被采纳

1-被采纳

0-未被采纳

collectible.invitedint

是否被邀请回答

1-被邀请

0-未被邀请

collectible.comments_countint评论数
collectible.rewards_amountint被打赏总额
collectible.rewarder_countint打赏者统计
collectible.likes_countint点赞数
collectible.couldbool是否可以查看,当收藏的回答需要付费围观时出现该字段且值为false