关注

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

列出一个用户的关注者

列出一个用户的关注者:

GET /users/:user/followers

列出授权用户的关注者:

GET /user/followers

参数

名称类型描述
limitInteger获取条数,默认 20
offsetInteger翻页偏移量,默认 0

响应

Status: 200 OK
[
  {
    "id": 1,
    "name": "Seven",
    "bio": "Seven 的个人传记",
    "sex": 2,
    "location": "成都 中国",
    "created_at": "2017-06-02 08:43:54",
    "updated_at": "2017-07-25 03:59:39",
    "following": false,
    "follower": false,
    "avatar": "http://plus.io/api/v2/users/1/avatar",
    "bg": "https://www.xnip.cn/wp-content/uploads/2021/docimg15/30-nrlv5b24hmp.png",
    "verified": null,
    "extra": {
      "user_id": 1,
      "likes_count": 0,
      "comments_count": 8,
      "followers_count": 0,
      "followings_count": 1,
      "updated_at": "2017-08-01 06:06:37",
      "feeds_count": 0,
      "questions_count": 5,
      "answers_count": 3
    }
  }
]

列出用户正在关注的人

列出一个用户正在关注的人:

GET /users/:user/followings

列出用户授权用户正在关注的人

GET /user/followings

参数

名称类型描述
limitInteger获取条数,默认 20
offsetInteger翻页偏移量,默认 0

响应

Status: 200 OK
[
  {
    "id": 1,
    "name": "Seven",
    "bio": "Seven 的个人传记",
    "sex": 2,
    "location": "成都 中国",
    "created_at": "2017-06-02 08:43:54",
    "updated_at": "2017-07-25 03:59:39",
    "following": false,
    "follower": false,
    "avatar": "http://plus.io/api/v2/users/1/avatar",
    "bg": "https://www.xnip.cn/wp-content/uploads/2021/docimg15/30-nrlv5b24hmp.png",
    "verified": null,
    "extra": {
      "user_id": 1,
      "likes_count": 0,
      "comments_count": 8,
      "followers_count": 0,
      "followings_count": 1,
      "updated_at": "2017-08-01 06:06:37",
      "feeds_count": 0,
      "questions_count": 5,
      "answers_count": 3
    }
  }
]

关注一个用户

PUT /user/followings/:user

响应

Status: 204 No Content

取消关注一个用户

DELETE /user/followings/:user

响应

Status: 204 No Content