|
@@ -220,23 +220,28 @@ class NotificationView(View):
|
|
push_server_status = 0
|
|
push_server_status = 0
|
|
#推送
|
|
#推送
|
|
if detect_med_type == 2 or detect_med_type == 0:
|
|
if detect_med_type == 2 or detect_med_type == 0:
|
|
- if push_type == 0: # ios apns
|
|
|
|
- print('do_apns')
|
|
|
|
- # self.do_apns(**kwag_args)
|
|
|
|
- do_apns_code = self.do_apns(**kwag_args)
|
|
|
|
- if isinstance(do_apns_code, int):
|
|
|
|
- push_server_status = do_apns_code
|
|
|
|
- else:
|
|
|
|
- push_server_status = 400
|
|
|
|
- elif push_type == 1: # android gcm
|
|
|
|
- print('do_fcm')
|
|
|
|
- do_fcm_code = self.do_fcm(**kwag_args)
|
|
|
|
- push_server_status = 200
|
|
|
|
- elif push_type == 2: # android jpush
|
|
|
|
- print('do_jpush')
|
|
|
|
- do_jpush_code = self.do_jpush(**kwag_args)
|
|
|
|
- push_server_status = do_jpush_code
|
|
|
|
- # return JsonResponse(status=200, data={'code': 0, '状态:': self.do_jpush(**kwag_args)})
|
|
|
|
|
|
+
|
|
|
|
+ try:
|
|
|
|
+ if push_type == 0: # ios apns
|
|
|
|
+ print('do_apns')
|
|
|
|
+ # self.do_apns(**kwag_args)
|
|
|
|
+ do_apns_code = self.do_apns(**kwag_args)
|
|
|
|
+ if isinstance(do_apns_code, int):
|
|
|
|
+ push_server_status = do_apns_code
|
|
|
|
+ else:
|
|
|
|
+ push_server_status = 400
|
|
|
|
+ elif push_type == 1: # android gcm
|
|
|
|
+ print('do_fcm')
|
|
|
|
+ do_fcm_code = self.do_fcm(**kwag_args)
|
|
|
|
+ push_server_status = 200
|
|
|
|
+ elif push_type == 2: # android jpush
|
|
|
|
+ print('do_jpush')
|
|
|
|
+ do_jpush_code = self.do_jpush(**kwag_args)
|
|
|
|
+ push_server_status = do_jpush_code
|
|
|
|
+ # return JsonResponse(status=200, data={'code': 0, '状态:': self.do_jpush(**kwag_args)})
|
|
|
|
+ except Exception as e:
|
|
|
|
+ logger.info("errLine={errLine}, errMsg={errMsg}".format(errLine=e.__traceback__.tb_lineno,errMsg=repr(e)))
|
|
|
|
+ continue
|
|
if detect_med_type == 1:
|
|
if detect_med_type == 1:
|
|
do_apns_code = '只存库不推送'
|
|
do_apns_code = '只存库不推送'
|
|
do_fcm_code = '只存库不推送'
|
|
do_fcm_code = '只存库不推送'
|