|
@@ -110,7 +110,7 @@ class NotificationView(View):
|
|
|
utko = UidTokenObject(uidToken)
|
|
|
uid = utko.UID
|
|
|
uaqs = UID_App.objects.filter(uid=uid). \
|
|
|
- values('token_val', 'app_type', 'appBundleId', 'push_type', 'uid')
|
|
|
+ values('token_val', 'app_type', 'appBundleId', 'push_type', 'uid','userID_id')
|
|
|
if uaqs.exists():
|
|
|
for ua in uaqs:
|
|
|
push_type = ua['push_type']
|
|
@@ -237,20 +237,21 @@ class NotificationView(View):
|
|
|
# assert res.status_code == 200, res.reason
|
|
|
# assert res.apns_id
|
|
|
if res.status_code == 200:
|
|
|
+ self.do_save_equipment_info(uaql,n_time)
|
|
|
return response.json(0)
|
|
|
else:
|
|
|
return response.json(404, res.reason)
|
|
|
except Exception as e:
|
|
|
return response.json(10, repr(e))
|
|
|
|
|
|
- def do_save_equipment_info(self,userID_id):
|
|
|
+ def do_save_equipment_info(self,uaql,n_time):
|
|
|
Equipment_Info.objects.create(
|
|
|
- userID_id=userID_id,
|
|
|
- eventTime='',
|
|
|
- eventType='',
|
|
|
- devUid='',
|
|
|
- devNickName='',
|
|
|
- Channel='',
|
|
|
- alarm='',
|
|
|
- receiveTime='',)
|
|
|
+ userID_id=uaql['userID_id'],
|
|
|
+ eventTime=n_time,
|
|
|
+ eventType=1,
|
|
|
+ devUid=uaql['uid'],
|
|
|
+ devNickName=uaql['devNickName'],
|
|
|
+ Channel='0',
|
|
|
+ alarm='xxx',
|
|
|
+ receiveTime=n_time)
|
|
|
return
|