locky 2 роки тому
батько
коміт
ae46d6103e
1 змінених файлів з 15 додано та 10 видалено
  1. 15 10
      Controller/DetectControllerV2.py

+ 15 - 10
Controller/DetectControllerV2.py

@@ -229,17 +229,22 @@ class NotificationView(View):
                     # 推送消息
                     if not have_dkey:
                         logger.info('准备推送:{}, {}'.format(uid, request_dict))
-                        if (is_st == 1 or is_st == 3) and (push_type == 0 or push_type == 1):
-                            push_thread = threading.Thread(target=self.push_thread_test, args=(push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text, channel))
+                        if (is_st == 1 or is_st == 3) and (push_type == 0 or push_type == 1):   # 推送显示图片
+                            if is_st == 1:
+                                key = '{}/{}/{}.jpeg'.format(uid, channel, n_time)
+                            else:
+                                key = '{}/{}/{}_0.jpeg'.format(uid, channel, n_time)
+                            push_thread = threading.Thread(target=self.push_thread_test, args=(
+                                push_type, aws_s3_client, bucket, key, uid, appBundleId, token_val, event_type, n_time,
+                                msg_title, msg_text, channel))
                             push_thread.start()
-                        if push_type == 0:  # ios apns
-                            do_apns_code = self.do_apns(**kwag_args)
-                            logger.info('进入do_apns,uid={}'.format(uid))
-                            logger.info('do_apns_code===={}'.format(do_apns_code))
-                        elif push_type == 1:  # android gcm
-                            do_fcm_code = self.do_fcm(**kwag_args)
-                        elif push_type == 2:  # android jpush
-                            do_jpush_code = self.do_jpush(**kwag_args)
+                        else:
+                            if push_type == 0:  # ios apns
+                                do_apns_code = self.do_apns(**kwag_args)
+                            elif push_type == 1:  # android gcm
+                                do_fcm_code = self.do_fcm(**kwag_args)
+                            elif push_type == 2:  # android jpush
+                                do_jpush_code = self.do_jpush(**kwag_args)
                 except Exception as e:
                     logger.info(
                         "errLine={errLine}, errMsg={errMsg}".format(errLine=e.__traceback__.tb_lineno, errMsg=repr(e)))