datacollect/Readme.md
2019-08-21 19:41:24 +08:00

225 lines
7.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

数据展示接口
#### 0、检查接口
##### 接口地址
##### 请求方式get
##### 请求示范
http://154.8.214.202:5022/webapp/index.php?c=Ops&a=selfChecking
##### 返回示例
{"errcode":0,"errmsg":"","healthy":1,"max_rundelay":10}
#### 1、返回可用的数据方法按gameid排查及返回方法的字段定义
##### 接口地址
http://154.8.214.202:5022/webapp/index.php
##### 返回格式json
##### 请求方式get
##### 请求示范
http://154.8.214.202:5022/webapp/index.php?c=Ops&a=getmethods&gameid=2001
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ------------------ |
| gameid | string | 是 | 查询的游戏ID |
| channelid | string | 否 | 默认为6001微信 |
| | | | |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------------ | ------ | ---- | ---------- |
| gamename | string | 是 | 游戏中文名 |
| methods | String | 是 | 方法名 |
| methods_name | String | 是 | 方法显示名 |
| result | json | 是 | 方法明细字段名称及显示名 |
|need_sort|int|是|作为排序的字段|
{
"errcode": 0,
"errmsg": "",
"result": [
{
"methods": "stage",
"method_display": "关卡通关记录",
"need_sort": 0,
"fields": "num",
"comment": "通关次数"
},
{
"methods": "stage",
"method_display": "关卡通关记录",
"need_sort": 0,
"fields": "level",
"comment": "关卡数"
}
]
}
#### 2、按方法和日期返回某天的数据
##### 接口地址
http://154.8.214.202:5022/webapp/index.php
##### 返回格式json
##### 请求方式get
##### 请求示范
http://154.8.214.202:5022/webapp/index.php?c=Ops&a=getreport&gameid=2001&channelid=6001&methods=tap_2001&times=2019-08-13
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | -------- | ---- | ------------------------------------ |
| gameid | string | 是 | 查询的游戏ID |
| channelid | string | 否 | 查询的平台ID默认为6001 |
| methods | string | 是 | 默认为6001微信 |
| times | string | 是 | 查询的报表数据格式为“2019-08-12” |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------------ | ------ | ---- | ---------- |
| gamename | string | 是 | 游戏中文名 |
| methods | String | 是 | 方法名 |
| methods_name | String | 是 | 方法显示名 |
##### 返回示例
{
"errcode": 0,
"errmsg": "",
"result": [
"{\"name\": \"金币获取\", \"num\": 1671, \"dis_num\": 865}",
"{\"name\": \"组队模式\", \"num\": 1240, \"dis_num\": 500}",
"{\"name\": \"宝箱\", \"num\": 86, \"dis_num\": 55}",
"{\"name\": \"角色\", \"num\": 1649, \"dis_num\": 649}",
"{\"name\": \"签到领取\", \"num\": 944, \"dis_num\": 944}",
"{\"name\": \"单人模式\", \"num\": 4595, \"dis_num\": 1095}",
"{\"name\": \"观看视频试用皮肤按钮\", \"num\": 40, \"dis_num\": 22}",
"{\"name\": \"跳伞\", \"num\": 4630, \"dis_num\": 1070}",
"{\"name\": \"任务\", \"num\": 1120, \"dis_num\": 508}",
"{\"name\": \"战斗结束看视频翻倍按钮\", \"num\": 156, \"dis_num\": 69}",
"{\"name\": \"角色满级体验\", \"num\": 37, \"dis_num\": 33}",
"{\"name\": \"组队开始游戏\", \"num\": 1117, \"dis_num\": 421}",
"{\"name\": \"福利\", \"num\": 29, \"dis_num\": 27}",
"{\"name\": \"战斗结束\", \"num\": 4417, \"dis_num\": 1047}",
"{\"name\": \"等待区域\", \"num\": 5520, \"dis_num\": 1202}",
"{\"name\": \"邀请\", \"num\": 44, \"dis_num\": 39}",
"{\"name\": \"Join成功\", \"num\": 5524, \"dis_num\": 1203}",
"{\"name\": \"排行榜\", \"num\": 73, \"dis_num\": 64}",
"{\"name\": \"武器\", \"num\": 819, \"dis_num\": 396}",
"{\"name\": \"登录按钮\", \"num\": 5026, \"dis_num\": 1459}",
"{\"name\": \"商城\", \"num\": 569, \"dis_num\": 265}",
"{\"name\": \"进入游戏主界面\", \"num\": 6366, \"dis_num\": 1323}",
"{\"name\": \"链接成功\", \"num\": 5643, \"dis_num\": 1209}",
"{\"name\": \"签到双倍领取\", \"num\": 254, \"dis_num\": 254}",
"{\"name\": \"武器满级体验\", \"num\": 47, \"dis_num\": 31}",
"{\"name\": \"战斗链接\", \"num\": 5733, \"dis_num\": 1234}"
]
}
#### 3、按方法和日期返回某段时间的数据
##### 接口地址
http://154.8.214.202:5022/webapp/index.php?c=Ops&a=getreport&gameid=2001&channelid=6001&methods=share&b_times="2019-08-13 12:00:00"
##### 返回格式json
##### 请求方式get
##### 请求示范
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------------ | -------- | ---- | ----------------------------------------- |
| gameid | int | 是 | 游戏ID |
| channelid | int | 是 | 渠道ID |
| ad_channelid | string | 是 | 广告上报的关键词 |
| method | string | 是 | 查询数据类型 |
| time_partice | int | 是 | 查询时间颗粒0=1分钟1=5分钟2=1小时 |
| b_time | datetime | 是 | 开始时间 |
| e_time | datetime | 是 | 结束时间 |
select time,num from user_online where env='prod' and gameid='1013' and time >'2019-08-01 01:00:00' and time <'2019-08-03 01:00:00' limit 10
在influxdb中按关键词筛选需要的数据数据按以下结构返回
{
"errcode": 0,
"errmsg": "",
"message": {
"totoal": 2,
"result": [
{
“2019-08-01 01:00:00”:100,
“2019-08-01 02:00:00”:120, }
]
}
}
如查询提供的是错误的方法名则返回错误代码501
如查询结果为空则返回状态码200内容为空
#### 4、返回可用的实时数据方法按gameid排查及返回方法的字段定义
##### 接口地址
http://154.8.214.202:5022/webapp/index.php
##### 返回格式json
##### 请求方式get
##### 请求示范
http://154.8.214.202:5022/webapp/index.php?c=Ops&a=GetRealMethods&gameid=2001
##### 请求参数说明
| 名称 | 类型 | 必填 | 说明 |
| --------- | ------ | ---- | ------------------ |
| gameid | string | 是 | 查询的游戏ID |
| channelid | string | 否 | 默认为6001微信 |
| | | | |
##### 返回参数说明
| 名称 | 类型 | 必填 | 说明 |
| ------------ | ------ | ---- | ---------- |
| gamename | string | 是 | 游戏中文名 |
| methods | String | 是 | 方法名 |
| methods_name | String | 是 | 方法显示名 |
{
"errcode": 0,
"errmsg": "",
"result": [
{
"methods": "stage",
"method_display": "关卡通关记录",
},
{
"methods": "stage",
"method_display": "关卡通关记录",
}
]
}