收藏

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

收藏资讯

POST /news/{news}/collections

Response

Headers

Status: 201 Created

取消收藏资讯

DELETE /news/{news}/collections

Response

Headers

Status: 204 No Content

获取收藏资讯

GET /news/collections

可选参数

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

Response

Headers

Status: 200 Ok
[
  {
    "id": 2,
    "title": "asdasdasdad",
    "subject": "阿拉拉啊拉",
    "created_at": "2017-08-02 03:28:38",
    "updated_at": "2017-08-03 07:53:34",
    "from": "原创",
    "author": "root",
    "user_id": 1,
    "hits": 5,
    "has_collect": true,
    "has_like": false,
    "category": {
      "id": 1,
      "name": "1121",
      "rank": 0
    },
    "image": {
      "id": 2,
      "size": "370x370"
    }
  }
]

返回参数

名称类型说明
idint数据id
titlestring资讯标题
subjectstring副标题
fromstring来源
authorstring作者
user_idint发布者id
hitsint点击数
has_collectbool当前用户是否已收藏
has_likebool当前用户是否已点赞
categoryarray所属分类信息
category.idint所属分类id
category.namestring所属分类名称
category.rankint所属分类排序
imagearray资讯封面信息
image.idint资讯封面附件id
image.sizestring资讯封面尺寸