浏览代码

Merge remote-tracking branch 'remotes/origin/locky' into test

Ansjer 1 年之前
父节点
当前提交
2a74a24123
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 7 2
      Controller/DetectControllerV2.py
  2. 0 2
      Controller/ShadowController.py

+ 7 - 2
Controller/DetectControllerV2.py

@@ -61,6 +61,7 @@ class NotificationV2View(View):
         dealings_type = int(request_dict.get('dealingsType', 0))
         detection = int(request_dict.get('detection', 0))
         button = request_dict.get('button', '1')
+        storage_location = request_dict.get('storage_location', None)
         uid = ""
         # 参数校验
         if not all([channel, n_time]):
@@ -130,12 +131,16 @@ class NotificationV2View(View):
                 'event_type': event_type,
                 'n_time': n_time,
             }
-            # 对象存储区域, 测试/国内: 华为云, 美洲: oci凤凰城, 欧洲: oci伦敦
-            storage_location = 5
+            # 对象存储区域, 测试/国内: 旧:aws(2),新:华为云(5),设备传参, 美洲: oci凤凰城(3), 欧洲: oci伦敦(4)
             if CONFIG_INFO == CONFIG_US:
                 storage_location = 3
             elif CONFIG_INFO == CONFIG_EUR:
                 storage_location = 4
+            else:
+                if storage_location is not None:
+                    storage_location = int(storage_location)
+                else:
+                    storage_location = 2
 
             params = {'nickname': nickname, 'uid': uid, 'push_kwargs': push_kwargs, 'is_st': is_st, 'region': region,
                       'is_sys_msg': is_sys_msg, 'channel': channel, 'event_type': event_type, 'n_time': n_time,

+ 0 - 2
Controller/ShadowController.py

@@ -83,8 +83,6 @@ def honor_push_receipt(request):
         request_dict = request.POST
     else:
         return response.json(444, 'wrong method')
-    logger = logging.getLogger('info')
-    logger.info('荣耀推送回执:{}'.format(request_dict))
     return response.json(0)