diff --git a/handler/ad.py b/handler/ad.py index a504956..8ddc2bf 100644 --- a/handler/ad.py +++ b/handler/ad.py @@ -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):