添加接口说明文档
This commit is contained in:
parent
f946d10a27
commit
7c51acce00
197
Readme.md
Normal file
197
Readme.md
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
|
||||||
|
数据展示接口
|
||||||
|
|
||||||
|
#### 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 | 是 | 方法显示名 |
|
||||||
|
|
||||||
|
##### 返回示例
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": [
|
||||||
|
{
|
||||||
|
"appid": "BKadJbmZ",
|
||||||
|
"appkey": "undefined",
|
||||||
|
"contact": "pt",
|
||||||
|
"id": "1001",
|
||||||
|
"name": "kings",
|
||||||
|
"status": 0,
|
||||||
|
"tel": "1234",
|
||||||
|
"user": "None"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
#### 2、返回方法的字段定义
|
||||||
|
|
||||||
|
##### 接口地址
|
||||||
|
|
||||||
|
http://154.8.214.202:5015/interface/company
|
||||||
|
|
||||||
|
##### 返回格式:json
|
||||||
|
|
||||||
|
##### 请求方式:get
|
||||||
|
|
||||||
|
##### 请求示范
|
||||||
|
|
||||||
|
http://154.8.214.202:5015/interface/company?status=0
|
||||||
|
|
||||||
|
##### 请求参数说明
|
||||||
|
|
||||||
|
| 名称 | 类型 | 必填 | 说明 |
|
||||||
|
| ------- | ------ | ---- | ------------------ |
|
||||||
|
| gameid | string | 是 | 查询的游戏ID |
|
||||||
|
| methods | string | 是 | 默认为6001(微信) |
|
||||||
|
|
||||||
|
##### 返回参数说明
|
||||||
|
|
||||||
|
| 名称 | 类型 | 必填 | 说明 |
|
||||||
|
| ------------ | ------ | ---- | ---------- |
|
||||||
|
| 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
|
||||||
|
|
||||||
|
##### 请求示范
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
#### 4、按方法和日期返回某段时间的数据
|
||||||
|
|
||||||
|
##### 接口地址
|
||||||
|
|
||||||
|
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,内容为空
|
||||||
|
|
@ -183,7 +183,7 @@ class AD_data(GetFromTga):
|
|||||||
try:
|
try:
|
||||||
temp = {}
|
temp = {}
|
||||||
temp['views'], temp['u_views'], temp['ad_type_id'], temp['adv_id_str'], temp['activity_id_str'], \
|
temp['views'], temp['u_views'], temp['ad_type_id'], temp['adv_id_str'], temp['activity_id_str'], \
|
||||||
temp['adv_id_state'] = line
|
temp['adv_id_state'] = line
|
||||||
temp['ad_type_id'] = int(temp['ad_type_id'])
|
temp['ad_type_id'] = int(temp['ad_type_id'])
|
||||||
temp['adv_id_state'] = int(temp['adv_id_state'])
|
temp['adv_id_state'] = int(temp['adv_id_state'])
|
||||||
temp['ad_type'] = ad_types[temp.get('ad_type_id')]
|
temp['ad_type'] = ad_types[temp.get('ad_type_id')]
|
||||||
@ -359,3 +359,11 @@ class Item_data(GetFromTga):
|
|||||||
self.write_tga_files(temp)
|
self.write_tga_files(temp)
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error(f"write {line} 2 tga failed!", exc_info=True)
|
log.error(f"write {line} 2 tga failed!", exc_info=True)
|
||||||
|
|
||||||
|
|
||||||
|
class Retain_data(GetFromTga):
|
||||||
|
def event_retain_1(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def event_retain_7(self):
|
||||||
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user