|
@@ -87,11 +87,9 @@ class NotificationView(View):
|
|
uid = utko.UID
|
|
uid = utko.UID
|
|
logger.info("当前调用推送接口的uid:{}".format(uid))
|
|
logger.info("当前调用推送接口的uid:{}".format(uid))
|
|
pkey = '{uid}_{channel}_{event_type}_ptl'.format(uid=uid, event_type=event_type, channel=channel)
|
|
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)
|
|
ykey = '{uid}_redis_qs'.format(uid=uid)
|
|
- # 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))
|
|
is_sys_msg = self.is_sys_msg(int(event_type))
|
|
- if is_sys_msg is True:
|
|
|
|
|
|
+ if is_sys_msg:
|
|
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)
|
|
else:
|
|
else:
|
|
dkey = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
dkey = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
@@ -101,6 +99,7 @@ class NotificationView(View):
|
|
have_ykey = redisObj.get_data(key=ykey) # uid_set 数据库缓存
|
|
have_ykey = redisObj.get_data(key=ykey) # uid_set 数据库缓存
|
|
have_pkey = redisObj.get_data(key=pkey) # 一分钟限制key
|
|
have_pkey = redisObj.get_data(key=pkey) # 一分钟限制key
|
|
have_dkey = redisObj.get_data(key=dkey) # 推送类型限制
|
|
have_dkey = redisObj.get_data(key=dkey) # 推送类型限制
|
|
|
|
+ logger.info('ykey:{}, pkey: {}, dkey: {},'.format(ykey, pkey, dkey))
|
|
|
|
|
|
# 一分钟外,推送开启状态
|
|
# 一分钟外,推送开启状态
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
@@ -154,11 +153,6 @@ class NotificationView(View):
|
|
res_data = {'code': 404, 'msg': 'error !'}
|
|
res_data = {'code': 404, 'msg': 'error !'}
|
|
return JsonResponse(status=200, data=res_data)
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
- # 此时应该更新一下redis里面的dkey的有效时间
|
|
|
|
- # detect_interval = redis_list[0]['uid_set__detect_interval']
|
|
|
|
- # tmp_channel = redis_list[0]['uid_set__channel']
|
|
|
|
- # self.do_update_detect_interval(uid, tmp_channel, redisObj, detect_interval)
|
|
|
|
-
|
|
|
|
if not redis_list:
|
|
if not redis_list:
|
|
print("没有redi_list")
|
|
print("没有redi_list")
|
|
res_data = {'code': 0, 'msg': 'no redi_list success!'}
|
|
res_data = {'code': 0, 'msg': 'no redi_list success!'}
|
|
@@ -221,10 +215,6 @@ class NotificationView(View):
|
|
'channel': channel,
|
|
'channel': channel,
|
|
'event_type': event_type,
|
|
'event_type': event_type,
|
|
'n_time': n_time,
|
|
'n_time': n_time,
|
|
- # 'appBundleId': appBundleId,
|
|
|
|
- # 'token_val': token_val,
|
|
|
|
- # 'msg_title': msg_title,
|
|
|
|
- # 'msg_text': msg_text
|
|
|
|
}
|
|
}
|
|
eq_list = []
|
|
eq_list = []
|
|
sys_msg_list = []
|
|
sys_msg_list = []
|
|
@@ -400,8 +390,6 @@ class NotificationView(View):
|
|
for i in range(int(is_st)):
|
|
for i in range(int(is_st)):
|
|
obj = '{uid}/{channel}/{filename}_{st}.jpeg'. \
|
|
obj = '{uid}/{channel}/{filename}_{st}.jpeg'. \
|
|
format(uid=uid, channel=channel, filename=n_time, st=i)
|
|
format(uid=uid, channel=channel, filename=n_time, st=i)
|
|
- # 设置此签名URL在60秒内有效。
|
|
|
|
- # url = bucket.sign_url('PUT', obj, 7200)
|
|
|
|
|
|
|
|
thumbspng = '{uid}/{channel}/{filename}_{st}.jpeg'. \
|
|
thumbspng = '{uid}/{channel}/{filename}_{st}.jpeg'. \
|
|
format(uid=uid, channel=channel, filename=n_time, st=i)
|
|
format(uid=uid, channel=channel, filename=n_time, st=i)
|
|
@@ -423,12 +411,9 @@ class NotificationView(View):
|
|
},
|
|
},
|
|
ExpiresIn=3600
|
|
ExpiresIn=3600
|
|
)
|
|
)
|
|
- # response_url = response_url[:4] + response_url[5:]
|
|
|
|
img_url_list.append(response_url)
|
|
img_url_list.append(response_url)
|
|
logger.info("成功生成上传签名url了")
|
|
logger.info("成功生成上传签名url了")
|
|
|
|
|
|
- # img_url_list.append(url)
|
|
|
|
-
|
|
|
|
for up in redis_list:
|
|
for up in redis_list:
|
|
up['do_apns_code'] = do_apns_code
|
|
up['do_apns_code'] = do_apns_code
|
|
up['do_fcm_code'] = do_fcm_code
|
|
up['do_fcm_code'] = do_fcm_code
|