Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8c83609a5b | ||
![]() |
de272df906 | ||
![]() |
d4f41f13f6 | ||
![]() |
6f713ee8fa | ||
![]() |
b2bdfd786d | ||
![]() |
83f6baf6af | ||
![]() |
aa00cfdef6 | ||
![]() |
8bb40f1c0a | ||
![]() |
1d997f58a3 | ||
![]() |
ed7927f98f |
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,3 +13,4 @@ Thumbs.db
|
||||
.pem
|
||||
test_*
|
||||
*.pid
|
||||
.vscode/settings.json
|
||||
|
@ -53,9 +53,7 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
if not post_data:
|
||||
post_data = self.request.body.decode('utf-8')
|
||||
post_data = json.loads(post_data)
|
||||
post_data['time']=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
today = datetime.datetime.now().strftime("%Y%m%d")
|
||||
redis_key = f"ad::jumpRecording::{today}"
|
||||
redis_key = f"ad::jumpRecording"
|
||||
try:
|
||||
my_redis.lpush(redis_key, json.dumps(post_data))
|
||||
return self.write({'errcode': 0, "errmsg": ''})
|
||||
@ -142,7 +140,7 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
input = json.loads(self.get_query_argument('body'))
|
||||
gameid = input['gameid']
|
||||
channelid=input.get('channelid',None) or 6001
|
||||
area = input.get('area', None)
|
||||
area=input.get('area',None)
|
||||
locationid = input.get('locationid',0)
|
||||
except Exception as e:
|
||||
result = {'errcode': 2, "errmsg": f"get args failed,{str(e)}"}
|
||||
@ -192,10 +190,8 @@ class DispatchHandler(tornado.web.RequestHandler):
|
||||
temp = my_redis.hgetall(f"adinfo::{id}::info")
|
||||
if temp:
|
||||
info.append(temp)
|
||||
# info_new = sorted(info, key=lambda s: int(s.get('ad_sort', 9999)))
|
||||
# result = {'errcode': 0, "errmsg": '', "message": {"totoal": len(info_new),
|
||||
# "result": info_new}}
|
||||
result = {'errcode': 0, "errmsg": '', "message": {"totoal": len(info), "result": info}}
|
||||
info_new = sorted(info, key=lambda s: int(s.get('ad_sort', 9999)))
|
||||
result = {'errcode': 0, "errmsg": '', "message": {"totoal": len(info_new), "result": info_new}}
|
||||
except Exception as e:
|
||||
result = {'errcode': 1, "errmsg": e}
|
||||
return self.write(result)
|
||||
|
@ -155,7 +155,7 @@ class Ad(Resource):
|
||||
# 检查该广告是否已存在
|
||||
try:
|
||||
check_sql = f"select id from ad where name='{ad['name']}' and gameid={ad['gameid']} and \
|
||||
locationid=‘{ad['locationid']}’ and companyid={ad['companyid']}"
|
||||
locationid={ad['locationid']} and companyid=ad['companyid']"
|
||||
data = self.mydb.query(check_sql)
|
||||
if data:
|
||||
return jsonify({'code': 500, 'message': f"name={ad['name']} gameid={ad['gameid']} was in db!"})
|
||||
|
@ -1,2 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
myenv="prod"
|
||||
myenv="test"
|
||||
|
@ -6,7 +6,7 @@ from ops.env import myenv
|
||||
ad_mysql_pwd = os.getenv('adpwd') or 'vF4j56AfxU3P'
|
||||
log_path = "/data/logs"
|
||||
if myenv == 'prod':
|
||||
redis_company_config = {'host': '10.10.4.8', 'port': 6379, 'db': 13, 'passwd': 'crs-9ltb97ds:i33dkxshh'}
|
||||
redis_company_config = {'host': '10.10.4.8', 'port': 6379, 'db': 1, 'passwd': 'crs-9ltb97ds:i33dkxshh'}
|
||||
mysql_promotion_config = {'user': 'ad', 'pswd': ad_mysql_pwd, 'host': '10.10.3.5', 'db': 'ad'}
|
||||
ad_list_interface_port = 5014
|
||||
priv_i_port=5015
|
||||
|
Loading…
x
Reference in New Issue
Block a user