Skip to content

文章 Api

getPosts

  • 含义:获取文章列表数据
  • 请求类型: get
  • 所传参数: 空

getPostById

  • 含义:通过 id 获取具体文章数据
  • 请求类型:get
  • 所传参数:
    参数名参数类型备注
    postIdstring需要查询的文章 id

getPostsByUserId

  • 含义:通过用户 id 获取该用户所发文章数据
  • 请求类型:get
  • 所传参数:
    参数名参数类型备注
    userIdstring需要查询的用户 id

addPost

  • 含义:新增一条文章数据
  • 请求类型:post
  • 所传参数:
    参数名参数类型备注
    userIdstring需要新增文章的用户 id
    bodystring文章内容
    titlestring文章标题

getCommentsByPostId

  • 含义:通过文章 id 查询该文章下的评论数据
  • 请求类型:get
  • 所传参数:
    参数名参数类型备注
    postIdstring需要查询的文章 id

getAllComments

  • 含义:获取全部评论
  • 请求类型:get
  • 所传参数:空

getAllCommentsByPostId

  • 含义:查询该文章下的全部评论数据
  • 请求类型:get
  • 所传参数:
    参数名参数类型备注
    postIdstring需要查询的文章 id

Released under the MIT License.