调整位置服务接口
This commit is contained in:
parent
769be2e417
commit
37e5a2fbe3
@ -173,7 +173,8 @@ class Ad(Resource):
|
||||
id = self.args['id'] or None
|
||||
if not id:
|
||||
return jsonify({'code': 404, 'message': f'{id} not found!'})
|
||||
del_sql = f"delete from ad where id={id};"
|
||||
#del_sql = f"delete from ad where id={id};"
|
||||
del_sql = f"update ad set in_used=0 where id={id};"
|
||||
try:
|
||||
self.mydb.change(del_sql)
|
||||
return jsonify({'code': 200, 'message': f'remove adid={id} success!'})
|
||||
|
@ -65,7 +65,7 @@ class Company(Resource):
|
||||
def delete(self):
|
||||
id = self.args['id']
|
||||
try:
|
||||
del_sql = f'delete from company where id={id};'
|
||||
del_sql = f'update ad set in_used=0 where id={id};'
|
||||
self.mydb.change(del_sql)
|
||||
except Exception:
|
||||
log.error(f"remove {id} failed!", exc_info=True)
|
||||
|
@ -115,7 +115,7 @@ class Location(Resource):
|
||||
if not id:
|
||||
return jsonify({'code': 500, 'message': 'id not found'})
|
||||
try:
|
||||
del_sql = f'delete from location where id={id};'
|
||||
del_sql = f'update location set in_used=0 where id={id};'
|
||||
self.mydb.change(del_sql)
|
||||
except Exception:
|
||||
log.error(f"location remove {id} failed!", exc_info=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user