ソースを参照

注释gcm推送

lang 3 年 前
コミット
1748fe6df9
1 ファイル変更13 行追加5 行削除
  1. 13 5
      Controller/AiController.py

+ 13 - 5
Controller/AiController.py

@@ -395,6 +395,7 @@ class AiView(View):
     def do_ai_identification(self, request_dict,response):
         etk = request_dict.get('etk', None)
         now_time = int(time.time())
+        logger = logging.getLogger('info')
         if not etk:
             return response.json(444)
 
@@ -476,7 +477,8 @@ class AiView(View):
                 return JsonResponse(status=500, data='label_list_none')
             event_type = ','.join(labels['label_type'])
             label_list = ','.join(labels['label_list'])
-
+            logger.info(event_type)
+            logger.info(label_list)
             #存储消息以及推送
             channel = request_dict.get('channel', '1')
             n_time = now_time
@@ -526,11 +528,16 @@ class AiView(View):
                 }
                 # 推送消息
                 if push_type == 0:  # ios apns
-                    self.do_apns(**kwargs)
-                elif push_type == 1:  # android gcm
-                    self.do_fcm(**kwargs)
+                    logger.info('into-------apns')
+                    res = self.do_apns(**kwargs)
+                    logger.info(res)
+                # elif push_type == 1:  # android gcm
+                #     self.do_fcm(**kwargs)
                 elif push_type == 2:  # android jpush
-                    self.do_jpush(**kwargs)
+                    logger.info('into-------jpush')
+                    res = self.do_jpush(**kwargs)
+                    logger.info(res)
+
                 # 以下是存库
                 userID_id = up["userID_id"]
                 if userID_id not in userID_ids:
@@ -557,6 +564,7 @@ class AiView(View):
             c_res = self.upload_s3(cover, upload_cover_path)
             d_res = self.upload_s3(desc, upload_desc_path)
             if c_res and d_res:
+                logger.info('upload-----S3----success')
                 return JsonResponse(status=200, data='success', safe=False)
             return JsonResponse(status=500, data='fail', safe=False)