|
@@ -53,13 +53,13 @@ class NotificationView(View):
|
|
|
V1_PUSH_LOGGER.info('旧移动侦测接口uid:{},时间戳:{},事件类型:{}'.format(uid, n_time, event_type))
|
|
|
|
|
|
event_type = int(event_type)
|
|
|
- pkey = '{uid}_{channel}_{event_type}_ptl'.format(uid=uid, event_type=event_type, channel=channel)
|
|
|
- ykey = '{uid}_redis_qs'.format(uid=uid)
|
|
|
+ pkey = '{}_{}_{}_ptl'.format(uid, event_type, channel)
|
|
|
+ ykey = '{}_redis_qs'.format(uid)
|
|
|
is_sys_msg = DevicePushService.judge_sys_msg(event_type)
|
|
|
if is_sys_msg:
|
|
|
- dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
|
|
|
+ dkey = '{}_{}_{}_flag'.format(uid, event_type, channel)
|
|
|
else:
|
|
|
- dkey = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
|
+ dkey = '{}_{}_flag'.format(uid, channel)
|
|
|
|
|
|
have_ykey = redisObj.get_data(key=ykey) # uid_set 数据库缓存
|
|
|
have_pkey = redisObj.get_data(key=pkey) # 一分钟限制key
|
|
@@ -140,15 +140,14 @@ class NotificationView(View):
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
elif is_st == '1':
|
|
|
- obj = '{uid}/{channel}/{filename}.jpeg'.format(uid=uid, channel=channel, filename=n_time)
|
|
|
+ obj = '{}/{}/{}.jpeg'.format(uid, channel, n_time)
|
|
|
url = bucket.sign_url('PUT', obj, 3600)
|
|
|
res_data = {'code': 0, 'img_push': url, 'msg': 'success 1'}
|
|
|
|
|
|
elif is_st == '3':
|
|
|
img_url_list = []
|
|
|
for i in range(int(is_st)):
|
|
|
- obj = '{uid}/{channel}/{filename}_{st}.jpeg'. \
|
|
|
- format(uid=uid, channel=channel, filename=n_time, st=i)
|
|
|
+ obj = '{}/{}/{}_{}.jpeg'.format(uid, channel, n_time, i)
|
|
|
url = bucket.sign_url('PUT', obj, 3600)
|
|
|
img_url_list.append(url)
|
|
|
|