传递日期参数
This commit is contained in:
parent
e071eda29b
commit
a843ed463a
@ -10,7 +10,7 @@ from collections import defaultdict
|
|||||||
from ops.plog import define_logger
|
from ops.plog import define_logger
|
||||||
import logging
|
import logging
|
||||||
import datetime
|
import datetime
|
||||||
|
import requests
|
||||||
define_logger("/data/logs/ops/daily_report.log")
|
define_logger("/data/logs/ops/daily_report.log")
|
||||||
import pdb
|
import pdb
|
||||||
|
|
||||||
@ -277,12 +277,37 @@ class Report:
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def get_args_cn(self):
|
||||||
|
gameids_cn = dict()
|
||||||
|
channel_cn = dict()
|
||||||
|
url = "http://10.10.5.4:2333/api/open/games/list"
|
||||||
|
r = requests.get(url)
|
||||||
|
if r.status_code == requests.codes.ok:
|
||||||
|
data = r.json().get('gameList')
|
||||||
|
for line in data:
|
||||||
|
try:
|
||||||
|
gameids_cn[line.get('game_id')] = line.get('game')
|
||||||
|
channel_cn[line.get('platform_id')] = line.get('platform')
|
||||||
|
except Exception:
|
||||||
|
log.error(f"split {line} failed!", exc_info=True)
|
||||||
|
return (gameids_cn, channel_cn)
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if self.project == 'mini_games':
|
if self.project == 'mini_games':
|
||||||
parms = [(1004, 6001), (1011, 6001), (1001, 6001)]
|
parms = [(1004, 6001), (1011, 6001), (1001, 6001)]
|
||||||
else:
|
else:
|
||||||
parms = [(2001, 6001), (2002, 6001)]
|
parms = [(2001, 6001), (2002, 6001)]
|
||||||
|
|
||||||
|
cn = self.get_args_cn()
|
||||||
|
if not cn:
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
game_cn, chanel_cn = cn
|
||||||
|
|
||||||
|
|
||||||
data = list()
|
data = list()
|
||||||
for item in parms:
|
for item in parms:
|
||||||
args = {}
|
args = {}
|
||||||
@ -290,8 +315,8 @@ class Report:
|
|||||||
# key = f"{args['gameid']}#{args['channelid']}"
|
# key = f"{args['gameid']}#{args['channelid']}"
|
||||||
|
|
||||||
temp = {}
|
temp = {}
|
||||||
temp['gameid'] = args['gameid']
|
temp['gameid'] = game_cn.get(args['gameid'], None)
|
||||||
temp['channelid'] = args['channelid']
|
temp['channelid'] = chanel_cn.get(args['channelid'], None)
|
||||||
temp['input'] = defaultdict(list)
|
temp['input'] = defaultdict(list)
|
||||||
temp['output'] = defaultdict(list)
|
temp['output'] = defaultdict(list)
|
||||||
temp['input'] = []
|
temp['input'] = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user