添加推送等级
This commit is contained in:
@ -65,6 +65,7 @@ async def read_event():
|
||||
if detection_field_name in event_detail['data']:
|
||||
event_detail['data']["_detectionResult"] = event_detail['data'].pop(
|
||||
detection_field_name)
|
||||
replace_image_host(event_detail['data']["_detectionResult"])
|
||||
logging.info(event_detail)
|
||||
try:
|
||||
push_resp = requests.post(push_url, json=event_detail).content.decode('utf-8')
|
||||
@ -93,6 +94,7 @@ async def read_event():
|
||||
detection_field_name = event['data']['eventType']
|
||||
if detection_field_name in event['data']:
|
||||
event['data']["_detectionResult"] = event['data'].pop(detection_field_name)
|
||||
replace_image_host(event['data']["_detectionResult"])
|
||||
# 请求推送 api
|
||||
logging.info(event)
|
||||
try:
|
||||
@ -108,6 +110,13 @@ async def read_event():
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
|
||||
def replace_image_host(detection_data):
|
||||
if "imageUrl" in detection_data:
|
||||
detection_data["imageUrl"] = detection_data["imageUrl"].replace("192.168.1.250", "192.168.11.180")
|
||||
if "visiblePicUrl" in detection_data:
|
||||
detection_data["visiblePicUrl"] = detection_data["visiblePicUrl"].replace("192.168.1.250", "192.168.11.180")
|
||||
|
||||
|
||||
def run_app():
|
||||
asyncio.run(read_event())
|
||||
|
||||
|
Reference in New Issue
Block a user