添加位置服务接口
This commit is contained in:
parent
ccc3f38c3b
commit
7ea08e8757
@ -44,12 +44,10 @@ class Ad(Resource):
|
||||
def get(self):
|
||||
gameid = self.args['gameid']
|
||||
localid = self.args['locationid']
|
||||
# begin = self.args['begin_time']
|
||||
# end = self.args['end_time']
|
||||
status = self.args['status'] or 1
|
||||
if not gameid or not localid:
|
||||
# log.error(f"请输入必须的游戏ID和位置ID字段,当前获得是{gameid},{localid}")
|
||||
return jsonify({'code': 500, "message": f"请输入必须的游戏ID和位置ID字段,当前获得是{gameid},{localid}"})
|
||||
return jsonify({'code': 500, "message": f"请输入必须的游戏ID和位置ID字段,当前获得是{gameid},{localid},{status}"})
|
||||
|
||||
now = datetime.datetime.today().strftime("%Y-%m-%d %H:%M:%S")
|
||||
sel_sql = f"select id,name,begin_time,end_time,ad_num,ad_title,ad_body,ad_image,ad_url,ad_sort from ad where gameid='{gameid}' and locationid='{localid}' and status={status};"
|
||||
@ -64,7 +62,10 @@ class Ad(Resource):
|
||||
except Exception:
|
||||
log.error("split data from mysql failed!", exc_info=True)
|
||||
else:
|
||||
return jsonify({'code': 404, 'message': f'ad not found with gameid={gameid},localid={localid},now={now}!'})
|
||||
return jsonify({
|
||||
'code': 404,
|
||||
'message': f'ad not found with gameid={gameid},localid={localid},now={now},status={status}!'
|
||||
})
|
||||
|
||||
|
||||
def post(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user