Pārlūkot izejas kodu

修改推送类型的限制

tanghongbin 4 gadi atpakaļ
vecāks
revīzija
61ea9ab32e
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. 8 2
      Controller/DetectController.py

+ 8 - 2
Controller/DetectController.py

@@ -73,7 +73,13 @@ class NotificationView(View):
         pkey = '{uid}_{channel}_{event_type}_ptl'.format(uid=uid, event_type=event_type, channel=channel)
         # ykey = 'MUJ887NLR8K8GBM9111A_redis_qs'.format(uid=uid)
         ykey = '{uid}_redis_qs'.format(uid=uid)
-        dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
+        # dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
+        is_sys_msg = self.is_sys_msg(int(event_type))
+        if is_sys_msg is True:
+            dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
+        else:
+            dkey = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
+
         # 判断redisObj.get_data(key=pkey):不为空
         redisObj = RedisObject(db=6)
         have_ykey = redisObj.get_data(key=ykey)  # uid_set 数据库缓存
@@ -124,7 +130,7 @@ class NotificationView(View):
             res_data = {'code': 0, 'msg': 'no redi_list success!'}
             return JsonResponse(status=200, data=res_data)
 
-        is_sys_msg = self.is_sys_msg(int(event_type))
+        # is_sys_msg = self.is_sys_msg(int(event_type))
         nickname = redis_list[0]['uid_set__nickname']
         detect_interval = redis_list[0]['uid_set__detect_interval']
         detect_group = redis_list[0]['uid_set__detect_group']