|
@@ -112,16 +112,19 @@ class NotificationView(View):
|
|
|
uaqs = UID_App.objects.filter(uid=uid). \
|
|
|
values('token_val', 'app_type', 'appBundleId', 'push_type', 'uid')
|
|
|
if uaqs.exists():
|
|
|
- push_type = uaqs[0]['push_type']
|
|
|
- # ios apns
|
|
|
- if push_type == 0:
|
|
|
- return self.do_apns(request_dict, uaqs[0], response)
|
|
|
- # android gcm
|
|
|
- elif push_type == 1:
|
|
|
- return self.do_gmc(request_dict, uaqs[0], response)
|
|
|
- # android jpush
|
|
|
- elif push_type == 2:
|
|
|
- return self.do_jpush(request_dict, uaqs[0], response)
|
|
|
+ for ua in uaqs:
|
|
|
+ push_type = uaqs[0]['push_type']
|
|
|
+ # ios apns
|
|
|
+ if push_type == 0:
|
|
|
+ return self.do_apns(request_dict, uaqs[0], response)
|
|
|
+ # android gcm
|
|
|
+ elif push_type == 1:
|
|
|
+ return self.do_gmc(request_dict, uaqs[0], response)
|
|
|
+ # android jpush
|
|
|
+ elif push_type == 2:
|
|
|
+ return self.do_jpush(request_dict, uaqs[0], response)
|
|
|
+ return response.json(0)
|
|
|
+
|
|
|
else:
|
|
|
return response.json(173)
|
|
|
|
|
@@ -240,7 +243,7 @@ class NotificationView(View):
|
|
|
except Exception as e:
|
|
|
return response.json(10, repr(e))
|
|
|
|
|
|
- def do_save_equipment_info(self):
|
|
|
+ def do_save_equipment_info(self,userID_id):
|
|
|
Equipment_Info.objects.create(
|
|
|
userID_id='',
|
|
|
eventTime='',
|
|
@@ -249,6 +252,5 @@ class NotificationView(View):
|
|
|
devNickName='',
|
|
|
Channel='',
|
|
|
alarm='',
|
|
|
- receiveTime='',
|
|
|
- )
|
|
|
+ receiveTime='',)
|
|
|
return
|