ソースを参照

607音视频推送

peng 1 年間 前
コミット
53111c5179
2 ファイル変更5 行追加5 行削除
  1. 3 3
      Service/DevicePushService.py
  2. 2 2
      Service/PushService.py

+ 3 - 3
Service/DevicePushService.py

@@ -452,7 +452,7 @@ class DevicePushService:
                 msg_type = '摄像头休眠'
             elif event_type == 703:
                 msg_type = '摄像头唤醒'
-            elif event_type == 606:
+            elif event_type in [606, 607]:
                 msg_type = '有人呼叫,请点击查看'
             elif ai_type > 0 and event_list:
                 msg_type = ''.join([DevicePushService.get_event_type_text(lang, item, dealings_type)
@@ -495,7 +495,7 @@ class DevicePushService:
                 msg_type = 'Camera sleep'
             elif event_type == 703:
                 msg_type = 'Camera wake'
-            elif event_type == 606:
+            elif event_type in [606, 607]:
                 msg_type = 'Someone is calling, please click to view'
             elif ai_type > 0 and event_list:
                 msg_type = ''.join([DevicePushService.get_event_type_text(lang, item, dealings_type)
@@ -601,7 +601,7 @@ class DevicePushService:
         response = requests.post(push_url, data=push_data, headers=headers)
         if response.status_code == 200:
             LOGGING.info("oppo推送返回值:{},uid:{},time:{},event:{}".format(response.json(), uid, now_time, event_type))
-            if event_type == 606 or event_type == '606':
+            if event_type in [606, 607]:
                 PushObject.jpush_transparent_transmission(msg_title, msg_text, appBundleId, jg_token_val, extra_data)
             return response.json()
 

+ 2 - 2
Service/PushService.py

@@ -320,7 +320,7 @@ class PushObject:
                 .message_dict()
             rec = sender_send.send(message)
             logger.info('vivo推送结果:{}, 设备uid:{}'.format(rec, uid))
-            if rec['result'] == 0 and (event_type == 606 or event_type == '606'):
+            if rec['result'] == 0 and event_type in [606, 607]:
                 PushObject.jpush_transparent_transmission(msg_title, msg_text, app_bundle_id, jg_token_val, push_data)
             return rec
         except Exception as e:
@@ -395,7 +395,7 @@ class PushObject:
 
             response = requests.post(push_url, data=push_data, headers=headers)
             logger.info("oppo推送返回值:{}".format(response.json()))
-            if response.status_code == 200 and (event_type == 606 or event_type == '606'):
+            if response.status_code == 200 and event_type in [606, 607]:
                 PushObject.jpush_transparent_transmission(msg_title, msg_text, app_bundle_id, jg_token_val, extra_data)
         except Exception as e:
             return repr(e)