|
@@ -199,18 +199,25 @@ class NotificationView(View):
|
|
|
kwag_args['token_val'] = token_val
|
|
|
kwag_args['msg_title'] = msg_title
|
|
|
kwag_args['msg_text'] = msg_text
|
|
|
+ push_server_status = 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)})
|
|
|
if detect_med_type == 1:
|
|
|
do_apns_code = '只存库不推送'
|
|
@@ -230,7 +237,11 @@ class NotificationView(View):
|
|
|
alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
is_st=int_is_st,
|
|
|
receiveTime=n_time,
|
|
|
- addTime=now_time
|
|
|
+ addTime=now_time,
|
|
|
+ message_id='',
|
|
|
+ push_type=push_type,
|
|
|
+ push_server_status=push_server_status,
|
|
|
+
|
|
|
))
|
|
|
if is_sys_msg:
|
|
|
sys_msg_text = self.get_msg_text(channel=channel, n_time=n_time, lang=lang, tz=tz,
|