Browse Source

优化推送数据添加日志

peng 2 years ago
parent
commit
8e0323cd2b

+ 2 - 3
Controller/AiController.py

@@ -565,9 +565,8 @@ class AiView(View):
                     uid_push_data['m_code'] = m_code
                     uid_push_data['addTime'] = nowTime
                     UidPushModel.objects.create(**uid_push_data)
-                LOGGER.info(
-                    'AiService/changeaistatus接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                        appBundleId, app_type, push_type, token_val, m_code))
+                if appBundleId == 0 or appBundleId == '0':
+                    LOGGER.info('AiService/changeaistatus接口推送数据:{}'.format(request_dict))
                 etkObj = ETkObject(etk='')
                 etk = etkObj.encrypt(uid)
 

+ 2 - 3
Controller/DetectController.py

@@ -293,9 +293,8 @@ class DetectControllerView(View):
                     }
                     # 绑定设备推送
                     UidPushModel.objects.create(**uid_push_create_dict)
-                LOGGER.info(
-                    'detect/changeStatus接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                        appBundleId, app_type, push_type, token_val, m_code))
+                if appBundleId == 0 or appBundleId == '0':
+                    LOGGER.info('detect/changeStatus接口推送数据:{}'.format(request_dict))
                 if interval:
                     self.do_delete_redis(uid, int(interval))
                 else:

+ 4 - 6
Controller/DetectControllerV2.py

@@ -187,9 +187,8 @@ class DetectControllerViewV2(View):
                     }
                     # 绑定设备推送
                     UidPushModel.objects.create(**uid_push_create_dict)
-                LOGGER.info(
-                    'detectV2/changeStatus接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                        appBundleId, app_type, push_type, token_val, m_code))
+                if appBundleId == 0 or appBundleId == '0':
+                    LOGGER.info('detectV2/changeStatus接口推送数据:{}'.format(request_dict))
                 return response.json(0)
 
             if status == 0:
@@ -226,9 +225,8 @@ class DetectControllerViewV2(View):
                     }
                     # 绑定设备推送
                     UidPushModel.objects.create(**uid_push_create_dict)
-                LOGGER.info(
-                    'detectV2/changeStatus接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                        appBundleId, app_type, push_type, token_val, m_code))
+                if appBundleId == 0 or appBundleId == '0':
+                    LOGGER.info('detectV2/changeStatus接口推送数据:{}'.format(request_dict))
                 if interval:
                     self.do_delete_redis(uid, interval)
                 else:

+ 2 - 3
Controller/EquipmentManagerV3.py

@@ -273,9 +273,8 @@ class EquipmentManagerV3(View):
                     }
                     # 绑定设备推送
                     UidPushModel.objects.create(**uid_push_create_dict)
-                LOGGER.info(
-                    'v3/equipment/add接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                        appBundleId, app_type, push_type, token_val, m_code))
+                if appBundleId == 0 or appBundleId == '0':
+                    LOGGER.info('v3/equipment/add接口推送数据:{}'.format(request_dict))
             # 查询uid_channel表有无该uid的数据
             uid_channel_set = UidChannelSetModel.objects.filter(uid_id=UidSet_id)
             if not uid_channel_set.exists():

+ 6 - 6
Controller/UserController.py

@@ -2149,9 +2149,8 @@ class v3LoginView(TemplateView):
                 GatewayPush.objects.create(user_id=userID, app_bundle_id=app_bundle_id, app_type=app_type,
                                            push_type=push_type, token_val=token_val, m_code=m_code, lang=lang, tz=tz)
             UidPushModel.objects.filter(userID=userID, m_code=m_code).update(token_val=token_val, push_type=push_type)
-            LOGGER.info(
-                'v3/account/login接口推送数据:app_bundle_id:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                    app_bundle_id, app_type, push_type, token_val, m_code))
+            if app_bundle_id == 0 or app_bundle_id == '0':
+                LOGGER.info('v3/account/login接口推送数据:{}'.format(request_dict))
         now_time = datetime.datetime.utcnow().replace(tzinfo=utc).astimezone(utc)
         region_country = users['region_country']
         # 语言不存在返回英文
@@ -2422,9 +2421,10 @@ class InitInfoView(View):
                         UidPushModel.objects.create(userID_id=user_id, appBundleId=app_bundle_id, app_type=app_type,
                                                     push_type=push_type, token_val=token_val, m_code=m_code, lang=lang,
                                                     tz=tz, addTime=now_time, updTime=now_time, uid_set_id=item['id'])
-                    LOGGER.info(
-                        'user/initInfo接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
-                            app_bundle_id, app_type, push_type, token_val, m_code))
+                    if app_bundle_id == 0 or app_bundle_id == '0':
+                        LOGGER.info(
+                            'user/initInfo接口推送数据:appBundleId:{},app_type:{},push_type:{},token_val:{},m_code:{}'.format(
+                                app_bundle_id, app_type, push_type, token_val, m_code))
         except Exception as e:
             LOGGER.info('出错了~保存推送配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))