新增AD接口
This commit is contained in:
parent
7b3a7e38c1
commit
950886ecac
Binary file not shown.
Binary file not shown.
@ -10,11 +10,10 @@ delete(删除定义的广告)params()output(1,0)
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
|
||||||
from flask import Flask, jsonify
|
from flask import Flask, jsonify
|
||||||
from flask_restful import reqparse, abort, Api, Resource
|
from flask_restful import reqparse, abort, Api, Resource
|
||||||
import logging
|
import logging
|
||||||
from myredis.myredis import ad_redis, expire_time
|
#from myredis.myredis import ad_redis, expire_time
|
||||||
from mysql.mmysql import MysqlBase
|
from mysql.mmysql import MysqlBase
|
||||||
from config import mysql_promotion_config
|
from config import mysql_promotion_config
|
||||||
import datetime
|
import datetime
|
||||||
@ -38,7 +37,7 @@ parser.add_argument('ad_sort')
|
|||||||
parser.add_argument('status')
|
parser.add_argument('status')
|
||||||
|
|
||||||
|
|
||||||
class Ad():
|
class Ad(Resource):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.args = parser.parse_args()
|
self.args = parser.parse_args()
|
||||||
|
|
||||||
@ -132,6 +131,8 @@ class Ad():
|
|||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
id = self.args['id']
|
id = self.args['id']
|
||||||
|
if not id:
|
||||||
|
jsonify({'code': 404, 'message': f' adid={id} not found !'})
|
||||||
del_sql = f"delete from ad where id={id};"
|
del_sql = f"delete from ad where id={id};"
|
||||||
try:
|
try:
|
||||||
mydb.change(del_sql)
|
mydb.change(del_sql)
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user