Skip to content

check api doc #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
### 2.1 获取所有分类信息
PATH:`GET /api/v1/category/`

参数:无

响应:
```
{
Expand Down Expand Up @@ -102,8 +104,8 @@ PATH:`GET /api/v1/volume/`
比如:要请求 2019年11月16日 的数据,则 start_time 为 2019年11月16日00:00:00,end_time 为 2019年11月17日00:00:00

**Tips:** 默认返回昨天的数据,时间戳单位为秒。
**Tips:** 如果两者时间间隔超过30天,以开始时间为准,结束时间为开始时间往后推30天。
**Tips:** 排序列:文档中枚举第一个字段是默认的排序字段
**Tips:** 如果两者时间间隔超过 31 天,以开始时间为准,结束时间为开始时间往后推 31 天。
**Tips:** 排序列:文档中枚举第一个字段是默认的排序字段

### 3.1 获取首页汇总展示数据
该接口用于统计首页汇总展示所有图表的概括图。
Expand All @@ -117,11 +119,11 @@ PATH:`GET /api/v1/traffic/views/`

参数:

| 名称 | 必须 | 类型 | 描述 |
| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| event | 是 | string | 请求事件名的统计数据 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| event | 是 | string | 请求事件名 (from,click,volume,notice) |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |

响应:
**Tips:** 每次请求返回一种 event 的数据,提高数据返回效率。
Expand Down Expand Up @@ -162,7 +164,7 @@ PATH:`GET /api/v1/traffic/views/`
]
},

#某一期月刊的数据(只显示最近一期和选择的时间无关,event=click
#某一期月刊的数据(只显示最近一期和选择的时间无关event=volume
"view_data": {
"all_count": 100,
"all_ip_count": 22,
Expand Down Expand Up @@ -206,8 +208,8 @@ PATH:`GET /api/v1/traffic/from/view/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |

响应:
```
Expand Down Expand Up @@ -239,21 +241,21 @@ PATH:`GET /api/v1/traffic/from/view/`
}
```

### 3.3 获取用户访问来源详细数据
### 3.3 获取用户访问来源详细数据 (废弃不用)

返回用户访问统计页面下的列表数据。

PATH:`GET /api/v1/traffic/from/detail/`

参数:

| 名称 | 必须 | 类型 | 描述 |
| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,count,ip_count) |
| asc | 否 | int | 默认为0降序,1为升序 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,count,ip_count) |
| asc | 否 | int | 默认为0降序,1为升序 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |

响应:
```
Expand Down Expand Up @@ -292,8 +294,8 @@ PATH:`GET /api/v1/traffic/click/view/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |

响应:
```
Expand Down Expand Up @@ -331,11 +333,11 @@ PATH:`GET /api/v1/traffic/click/detail/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,count,ip_count) |
| asc | 否 | int | 默认为0降序,1为升序 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,count,ip_count) |
| asc | 否 | int | 默认为0降序,1为升序 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |

响应:
```
Expand Down Expand Up @@ -381,8 +383,8 @@ PATH:`GET /api/v1/traffic/periodical/view/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| volume_id | 否 | int | 期刊的id,默认为最新一期 |
| category_id | 否 | int | 期刊分类的id,默认返回所有分类的数据|
| volume_id | 否 | int | 期刊的id,默认为最新一期 |
| category_id | 否 | int | 期刊分类的id,默认返回所有分类的数据|

响应:
```
Expand Down Expand Up @@ -418,10 +420,10 @@ PATH:`GET /api/v1/traffic/periodical/detail/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| volume_id | 否 | int | 期刊的id,默认为最新一期 |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,count,ip_count) |
| asc | 否 | int | 默认为0降序,1为升序 |
| volume_id | 否 | int | 期刊的id,默认为最新一期 |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,count,ip_count) |
| asc | 否 | int | 默认为0降序,1为升序 |


响应:
Expand Down Expand Up @@ -456,8 +458,6 @@ PATH:`GET /api/v1/traffic/periodical/detail/`
```




## 四、日报汇总展示接口

日报汇总展示接口时间范围字段:
Expand All @@ -480,8 +480,8 @@ PATH:`GET /api/v1/daily/langs/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |

响应:
```
Expand All @@ -503,12 +503,12 @@ PATH:`GET /api/v1/daily/report/`

| 名称 | 必须 | 类型 | 描述 |
| ------- | ----- | ----- | ----- |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| start_time | 否 | int | 开始时间戳 |
| end_time | 否 | int | 结束时间戳 |
| lang | 否 | string | 语言 |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(starsforksrepo_pushed_time)|
| asc | 否 | int | 默认为 0 降序,1 为升序 |
| page | 否 | int | 页数默认为第一页 |
| order | 否 | string | 排序列(stars,forks,repo_pushed_time)|
| asc | 否 | int | 默认为 0 降序,1 为升序 |

**Tips:** 排序列文档中枚举第一个字段是默认的排序字段

Expand Down