chenjunkai 6 năm trước cách đây
mục cha
commit
c47f6351d7
2 tập tin đã thay đổi với 18 bổ sung13 xóa
  1. 15 13
      Controller/DetectController.py
  2. 3 0
      Service/TemplateService.py

+ 15 - 13
Controller/DetectController.py

@@ -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

+ 3 - 0
Service/TemplateService.py

@@ -56,6 +56,9 @@ class TemplateService:
 
             'equipment/add',
             'deviceShare/queryUser',
+            'deviceShare/showShareInfo',
+            'deviceShare/confirm',
+            'deviceShare/deleteUser',
         ]
         return apiList