MDClub API 文档

User:getMyFollowingArticles

注意:该接口需要登陆后才能调用。

获取登录用户关注的文章。

HTTP 请求

GET /api/user/following_articles

参数

参数名 参数位置 类型 默认值 说明
page query integer 1

当前页数

per_page query integer 15

每页条数(最大为 100)

include query string

响应中需要包含的关联数据,用 , 分隔。可以为 user, topics, is_following, voting

响应

文章列表

示例

{
  "code": 0,
  "data": [
    {
      "article_id": 1,
      "user_id": 1,
      "title": "欢迎使用 MDClub 开源社区系统",
      "content_markdown": "MDClub 是一个开源社区系统,使用 [mdui](https://mdui.org) 作为前端框架。

系统的所有功能都通过 Restful Api 开放,共提供了超过 200 个接口。你可以使用这些接口开发任意客户端。
",
      "content_rendered": "<p>MDClub 是一个开源社区系统,使用 <a href="https://mdui.org" target="_blank">mdui</a> 作为前端框架。</p><p>系统的所有功能都通过 Restful Api 开放,共提供了超过 200 个接口。你可以使用这些接口开发任意客户端。</p>",
      "comment_count": 22,
      "follower_count": 12,
      "vote_count": 44,
      "vote_up_count": 96,
      "vote_down_count": 52,
      "create_time": 1563512214,
      "update_time": 1563512214,
      "delete_time": 0,
      "relationships": {
        "user": {
          "user_id": 1,
          "username": "zdhxiong",
          "headline": "mdui作者",
          "avatar": {
            "original": "https://mdclub.org/user-avatar/c4/ca/bc03445db47540eea79148252e7a91fe.jpg",
            "small": "https://mdclub.org/user-avatar/c4/ca/bc03445db47540eea79148252e7a91fe_small.jpg",
            "middle": "https://mdclub.org/user-avatar/c4/ca/bc03445db47540eea79148252e7a91fe_middle.jpg",
            "large": "https://mdclub.org/user-avatar/c4/ca/bc03445db47540eea79148252e7a91fe_large.jpg"
          }
        },
        "topics": [
          {
            "topic_id": 1,
            "name": "MDClub",
            "cover": {
              "original": "https://mdclub.org/topic-cover/c4/ca/bc03445db47540eea79148252e7a91fe.jpg",
              "small": "https://mdclub.org/topic-cover/c4/ca/bc03445db47540eea79148252e7a91fe_small.jpg",
              "middle": "https://mdclub.org/topic-cover/c4/ca/bc03445db47540eea79148252e7a91fe_middle.jpg",
              "large": "https://mdclub.org/topic-cover/c4/ca/bc03445db47540eea79148252e7a91fe_large.jpg"
            }
          }
        ],
        "is_following": true,
        "voting": "up"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 15,
    "previous": null,
    "next": 2,
    "total": 124,
    "pages": 9
  }
}

参数说明

参数名 类型 说明
code integer

无任何错误时,状态码为 0

data[].article_id integer

文章ID

data[].user_id integer

用户ID

data[].title string

文章标题

data[].content_markdown string

Markdown 格式的文章内容

data[].content_rendered string

HTML 格式的文章内容

data[].comment_count integer

评论数量

data[].follower_count integer

关注者数量

data[].vote_count integer

投票数(赞成票 - 反对票,可能为负数)

data[].vote_up_count integer

赞成票总数

data[].vote_down_count integer

反对票总数

data[].create_time integer

创建时间

data[].update_time integer

更新时间(用户可以更新自己的文章)

data[].delete_time integer

🔐删除时间

data[].relationships.user.user_id integer

用户ID

data[].relationships.user.username string

用户名

data[].relationships.user.headline string

一句话介绍

data[].relationships.user.avatar.original string

头像原图地址

data[].relationships.user.avatar.small string

小头像地址

data[].relationships.user.avatar.middle string

中头像地址

data[].relationships.user.avatar.large string

大头像地址

data[].relationships.topics[].topic_id integer

话题 ID

data[].relationships.topics[].name string

话题名称

data[].relationships.topics[].cover.original string

封面原图地址

data[].relationships.topics[].cover.small string

小型封面地址

data[].relationships.topics[].cover.middle string

中型封面地址

data[].relationships.topics[].cover.large string

大型封面地址

data[].relationships.is_following boolean

当前登录用户是否已关注该文章

data[].relationships.voting string

当前登录用户的投票类型(updown),未投过票则为空字符串

取值范围包括:up, down, ``

pagination.page integer

当前页码

pagination.per_page integer

每页条数

pagination.previous integer

上一页页码,为 null 表示没有上一页

pagination.next integer

下一页页码,为 null 表示没有下一页

pagination.total integer

数据总数

pagination.pages integer

总页数