添加位置服务接口

This commit is contained in:
pengtao 2019-07-10 15:32:29 +08:00
parent 950886ecac
commit bc033bfefc

View File

@ -13,7 +13,7 @@ delete删除定义的广告paramsoutput1,0
from flask import Flask, jsonify
from flask_restful import reqparse, abort, Api, Resource
import logging
#from myredis.myredis import ad_redis, expire_time
# from myredis.myredis import ad_redis, expire_time
from mysql.mmysql import MysqlBase
from config import mysql_promotion_config
import datetime
@ -131,11 +131,11 @@ class Ad(Resource):
def delete(self):
id = self.args['id']
if not id:
jsonify({'code': 404, 'message': f' adid={id} not found !'})
if not id:
return jsonify({'code': 404, 'message': '{id} not found!'})
del_sql = f"delete from ad where id={id};"
try:
mydb.change(del_sql)
jsonify({'code': 200, 'message': f'remove adid={id} success!'})
return jsonify({'code': 200, 'message': f'remove adid={id} success!'})
except Exception:
log.error("remove id from ad failed!", exc_info=True)