Compare commits

..

10 Commits
master ... test

Author SHA1 Message Date
root
8c83609a5b a 2021-06-02 10:19:29 +08:00
pengtao
de272df906 Merge branch 'test' of http://git.kingsome.cn/ops/promotion into test 2020-03-25 13:42:18 +08:00
pengtao
d4f41f13f6 add ignore 2019-11-28 10:23:11 +08:00
pengtao
6f713ee8fa fix datetime format 2019-10-30 14:25:38 +08:00
pengtao
b2bdfd786d fix datetime format 2019-10-30 14:25:15 +08:00
root
83f6baf6af fix sort 2019-10-30 14:22:24 +08:00
pengtao
aa00cfdef6 fix datetime format 2019-10-30 14:05:02 +08:00
pengtao
8bb40f1c0a fix datetime format 2019-10-30 14:00:27 +08:00
pengtao
1d997f58a3 fix datetime format 2019-10-29 19:33:23 +08:00
pengtao
ed7927f98f fix area not input 2019-10-28 12:04:54 +08:00
6 changed files with 9 additions and 12 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ Thumbs.db
.pem
test_*
*.pid
.vscode/settings.json

View File

@ -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)

View File

@ -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!"})

View File

@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
myenv="prod"
myenv="test"

View File

@ -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

View File

@ -30,4 +30,4 @@ api.add_resource(RelushADinfo, '/interface/reflush_adinfo')
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, port=5015)
app.run(host='0.0.0.0', debug=True, port=6015)