添加位置服务接口
This commit is contained in:
parent
950886ecac
commit
bc033bfefc
@ -13,7 +13,7 @@ delete(删除定义的广告)params()output(1,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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user