Stats:get

注意:该接口需要管理员权限才能调用。

获取站点统计数据。

HTTP 请求

GET /api/stats

参数

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

统计数据中包含的数据,用 , 分隔,可以为 system_info, total_user, total_question, total_article, total_answer, total_comment, new_user, new_question, new_article, new_answer, new_comment

start_datequerystring

统计数据的起始日期,例如 2017-3-14

end_datequerystring

统计数据的截止日期,例如 2020-5-12

响应

统计数据

示例

{
  "code": 0,
  "data": {
    "system_info": {
      "mdclub_version": "1.0",
      "os_version": "Windows NT 10.0 build 19041 (Windows 10) AMD64",
      "php_version": "7.4.3",
      "webserver_version": "Apache/2.4.39",
      "database_version": "mysql 8.0.17",
      "upload_max_filesize": "2M",
      "max_execution_time": "120秒",
      "disk_free_space": "120.02G",
      "database_size": "12M"
    },
    "total_user": 243235,
    "total_question": 5453,
    "total_article": 123,
    "total_answer": 5523,
    "total_comment": 234,
    "new_user": [
      {
        "date": "2020-5-19",
        "count": 12
      }
    ],
    "new_question": [
      {
        "date": "2020-5-19",
        "count": 12
      }
    ],
    "new_article": [
      {
        "date": "2020-5-19",
        "count": 12
      }
    ],
    "new_answer": [
      {
        "date": "2020-5-19",
        "count": 12
      }
    ],
    "new_comment": [
      {
        "date": "2020-5-19",
        "count": 12
      }
    ]
  }
}

参数说明

参数名 类型 说明
code integer

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

data.system_info.mdclub_version string

MDClub 的版本号

data.system_info.os_version string

操作系统版本

data.system_info.php_version string

PHP 版本号

data.system_info.webserver_version string

Web Server 版本号

data.system_info.database_version string

数据库版本

data.system_info.upload_max_filesize string

服务器上传文件大小限制

data.system_info.max_execution_time string

PHP 执行时间限制

data.system_info.disk_free_space string

服务器剩余硬盘容量

data.system_info.database_size string

数据库大小

data.total_user integer

用户总数(含被禁用)

data.total_question integer

提问总数

data.total_article integer

文章总数

data.total_answer integer

回答总数

data.total_comment integer

评论总数

data.new_user[].date string

日期

data.new_user[].count integer

当日新增数量

data.new_question[].date string

日期

data.new_question[].count integer

当日新增数量

data.new_article[].date string

日期

data.new_article[].count integer

当日新增数量

data.new_answer[].date string

日期

data.new_answer[].count integer

当日新增数量

data.new_comment[].date string

日期

data.new_comment[].count integer

当日新增数量