浏览代码

515类型变更为1023

zhangdongming 10 月之前
父节点
当前提交
a72b32c3d5
共有 2 个文件被更改,包括 7 次插入7 次删除
  1. 3 3
      Controller/DetectControllerV2.py
  2. 4 4
      Service/DevicePushService.py

+ 3 - 3
Controller/DetectControllerV2.py

@@ -79,13 +79,13 @@ class NotificationV2View(View):
             req_limiting = '{}_{}_{}_ptl'.format(uid, channel, event_type)
             cache_req_limiting = redis_obj.get_data(key=req_limiting)  # 获取请求限流缓存数据
             cache_app_push = redis_obj.get_data(key=push_interval)  # 获取APP推送消息时间间隔缓存数据
-            if event_type not in [606, 607, 515]:
+            if event_type not in [606, 607, 1023]:
                 if cache_req_limiting:  # 限流存在则直接返回
                     return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
             redis_obj.set_data(key=req_limiting, val=1, expire=60)  # 当缓存不存在限流数据 重新设置一分钟请求一次
 
             # OZI定制客户儿童保护模式
-            child_protection = event_type == 515 and detection == 0
+            child_protection = event_type == 1023 and detection == 0
             # 查询uid_push和uid_set数据
             if child_protection:
                 uid_push_qs = DevicePushService.get_uid_push_by_uid(uid)  # 查主用户
@@ -106,7 +106,7 @@ class NotificationV2View(View):
 
             # APP消息提醒推送间隔
             detect_interval = uid_set_push_list[0]['uid_set__detect_interval']
-            if event_type not in [606, 607, 515]:
+            if event_type not in [606, 607, 1023]:
                 if not cache_app_push:
                     # 缓存APP提醒推送间隔 默认1分钟提醒一次
                     DevicePushService.cache_push_detect_interval(redis_obj, push_interval, detect_interval,

+ 4 - 4
Service/DevicePushService.py

@@ -184,8 +184,8 @@ class DevicePushService:
                 cls.is_send_app_push(
                     params['event_type'], params['event_tag'], params['app_push_config'], params['app_push'], uid)
 
-            # 低功耗产品推送,休眠702,低电量704提醒,515 ozi, 并且detection=0,0标识单事件类型,1标识多事件类型
-            is_app_push = True if params['event_type'] in [702, 704, 515] and params['detection'] == 0 else is_app_push
+            # 低功耗产品推送,休眠702,低电量704提醒,1023 ozi, 并且detection=0,0标识单事件类型,1标识多事件类型
+            is_app_push = True if params['event_type'] in [702, 704, 1023] and params['detection'] == 0 else is_app_push
             redis_obj = params['redis_obj']
             # 推送
             if is_app_push:
@@ -577,7 +577,7 @@ class DevicePushService:
                 msg_type = '有人徘徊'
             elif event_type == 65:
                 msg_type = '长时间无人出现'
-            elif event_type == 515:
+            elif event_type == 1023:
                 msg_type = '儿童保护模式开启'
 
             elif event_type == 704:
@@ -632,7 +632,7 @@ class DevicePushService:
                 msg_type = 'Loitering detected'
             elif event_type == 65:
                 msg_type = 'No appearance for a long time'
-            elif event_type == 515:
+            elif event_type == 1023:
                 msg_type = 'Child protection mode is enabled'
 
             elif event_type == 704: