数据展示接口
1、返回可用的数据方法(按gameid排查)及返回方法的字段定义
接口地址
http://154.8.214.202:5015/interface/company
返回格式:json
请求方式:get
请求示范
http://154.8.214.202:5015/interface/company?status=0
请求参数说明
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
gameid | string | 是 | 查询的游戏ID |
channelid | string | 否 | 默认为6001(微信) |
返回参数说明
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
gamename | string | 是 | 游戏中文名 |
methods | String | 是 | 方法名 |
methods_name | String | 是 | 方法显示名 |
result | json | 是 | 方法明细字段名称及显示名 |
2、按方法和日期返回某天的数据
接口地址
http://154.8.214.202:5015/interface/company
返回格式:json
请求方式:get
请求示范
http://154.8.214.202:5015/interface/company?status=0
请求参数说明
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
gameid | string | 是 | 查询的游戏ID |
channelid | string | 否 | 查询的平台ID,默认为6001 |
methods | string | 是 | 默认为6001(微信) |
date | datetime | 是 | 查询的报表数据(格式为“2019-08-12”) |
返回参数说明
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
gamename | string | 是 | 游戏中文名 |
methods | String | 是 | 方法名 |
methods_name | String | 是 | 方法显示名 |
返回示例
{ "code": 200, "message": [ { "appid": "BKadJbmZ", "appkey": "undefined", "contact": "pt", "id": "1001", "name": "kings", "status": 0, "tel": "1234", "user": "None" } ] }
3、按方法和日期返回某段时间的数据
接口地址
http://154.8.214.202:5015/interface/company
返回格式:json
请求方式:get
请求示范
请求参数说明
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
gameid | int | 是 | 游戏ID |
channelid | int | 是 | 渠道ID |
ad_channelid | string | 否 | 广告上报的关键词 |
method | string | 是 | 查询数据类型 |
time_partice | int | 是 | 查询时间颗粒(0=1分钟,1=5分钟,2=1小时) |
time_begin | datetime | 是 | 开始时间 |
time_end | 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,内容为空