Report:create

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

添加举报。

HTTP 请求

POST /api/reports/{reportable_type}:{reportable_id}

参数

参数名参数位置类型默认值说明
reportable_typepathstring

目标类型

取值范围包括:question, answer, article, comment, user

reportable_idpathinteger

目标ID

includequerystring

响应中需要包含的关联数据,用 , 分隔。可以为 reporter, question, answer, article, comment, user

请求体

请求体类型:application/json

示例

{
  "reason": "恶意打广告"
}

参数说明

参数名必选类型说明
reasonstring

举报理由

响应

举报详情

示例

{
  "code": 0,
  "data": {
    "report_id": 1,
    "reportable_id": 1,
    "reportable_type": "question",
    "user_id": 1,
    "reason": "恶意打广告",
    "create_time": 1563512214,
    "relationships": {
      "reporter": {
        "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"
        }
      },
      "question": {
        "question_id": 1,
        "title": "请问作者开发了哪些软件?",
        "create_time": 1563512214,
        "update_time": 1563512214
      },
      "answer": {
        "answer_id": 1,
        "question_id": 1,
        "content_summary": "mdui 是目前最具有逻辑性、一致性、简洁性、高可用、且对规范实现的最好的 Material Design 框架。",
        "create_time": 1563512214,
        "update_time": 1563512214
      },
      "article": {
        "article_id": 1,
        "title": "欢迎使用 MDClub 开源社区系统",
        "create_time": 1563512214,
        "update_time": 1563512214
      },
      "comment": {
        "comment_id": 1,
        "content_summary": "mdui 是我见过的 Web 框架里对规范实现最好的一版了",
        "create_time": 1563512214,
        "update_time": 1563512214
      },
      "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"
        }
      }
    }
  }
}

参数说明

参数名 类型 说明
code integer

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

data.report_id integer

举报ID

data.reportable_id integer

举报目标的ID

data.reportable_type string

举报目标类型

取值范围包括:question, answer, article, comment, user

data.user_id integer

用户ID

data.reason string

举报理由

data.create_time integer

举报时间

data.relationships.reporter.user_id integer

用户ID

data.relationships.reporter.username string

用户名

data.relationships.reporter.headline string

一句话介绍

data.relationships.reporter.avatar.original string

头像原图地址

data.relationships.reporter.avatar.small string

小头像地址

data.relationships.reporter.avatar.middle string

中头像地址

data.relationships.reporter.avatar.large string

大头像地址

data.relationships.question.question_id integer

提问ID

data.relationships.question.title string

提问标题

data.relationships.question.create_time integer

发布时间

data.relationships.question.update_time integer

更新时间

data.relationships.answer.answer_id integer

回答ID

data.relationships.answer.question_id integer

提问ID

data.relationships.answer.content_summary string

内容摘要

data.relationships.answer.create_time integer

发布时间

data.relationships.answer.update_time integer

更新时间

data.relationships.article.article_id integer

文章ID

data.relationships.article.title string

文章标题

data.relationships.article.create_time integer

发布时间

data.relationships.article.update_time integer

更新时间

data.relationships.comment.comment_id integer

评论ID

data.relationships.comment.content_summary string

内容摘要

data.relationships.comment.create_time integer

发布时间

data.relationships.comment.update_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

大头像地址