From 2c79f975e2aea4d1cc814724fe0732acd849b0eb Mon Sep 17 00:00:00 2001 From: pengtao Date: Tue, 17 Sep 2019 17:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0put=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=88=B7=E6=96=B0locationid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 7 ++++++- handler/location.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 29c186d..ee77aec 100644 --- a/README.MD +++ b/README.MD @@ -524,4 +524,9 @@ http://154.8.214.202:6015/interface/promotion?status=0 } #### ad_channel 获得接口 -http://mp.kingsome.cn/api/open/promotion/get-uid?game_id=8002&platform_id=6001 \ No newline at end of file +http://mp.kingsome.cn/api/open/promotion/get-uid?game_id=8002&platform_id=6001 + + + +location刷新接口 +http://154.8.214.202:6015/interface/reflush_adinfo?locationid=1007 diff --git a/handler/location.py b/handler/location.py index f2974d1..b72c2dc 100644 --- a/handler/location.py +++ b/handler/location.py @@ -138,6 +138,8 @@ class Location(Resource): if data: condition = f"id='{self.args['id']}'" self.mydb.update("location", location, condition) + for locationid in location['id']: + self.reflush_location(locationid) return jsonify({'code': 200}) else: return jsonify({'code': 404, 'message': f"{self.args['id']} not found in mysql!"}) @@ -159,3 +161,13 @@ class Location(Resource): log.error(f"location remove {id} failed!", exc_info=True) return jsonify({'code': 500}) return jsonify({'code': 200}) + + + def reflush_location(self, locationid): + import requests + url = f"http://127.0.0.1:6015/interface/reflush_adinfo?locationid={locationid}" + r = requests.get(url) + if r.status_code == 200: + return True + else: + return False