|
@@ -69,13 +69,8 @@ class NotificationView(View):
|
|
|
else:
|
|
|
utko = UidTokenObject(uidToken)
|
|
|
uid = utko.UID
|
|
|
- # log = 'push----------{time}'.format(time=time.strftime('%Y-%m-%d-%H-%M-%S', time.localtime()))
|
|
|
- # log += '\n'
|
|
|
- # log += '\tuid=' + uid
|
|
|
- # log += '\tchannel=' + channel
|
|
|
- # log += '\tevent_type=' + event_type
|
|
|
|
|
|
- pkey = '{uid}_{channel}_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)
|
|
|
dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
|
|
@@ -94,8 +89,6 @@ class NotificationView(View):
|
|
|
else:
|
|
|
res_data = {'code': 0, 'msg': 'Push it once a minute'}
|
|
|
|
|
|
- # log += '\tcode=200'
|
|
|
- # LogUtil.write_log(log=log)
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
# 数据库读取数据
|
|
@@ -119,8 +112,6 @@ class NotificationView(View):
|
|
|
redisObj.set_data(key=ykey, val=str(redis_list), expire=600)
|
|
|
if not redis_list:
|
|
|
res_data = {'code': 404, 'msg': 'error !'}
|
|
|
- # log += '\tcode=200'
|
|
|
- # LogUtil.write_log(log=log)
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
# 此时应该更新一下redis里面的dkey的有效时间
|
|
@@ -131,8 +122,6 @@ class NotificationView(View):
|
|
|
if not redis_list:
|
|
|
print("没有redi_list")
|
|
|
res_data = {'code': 0, 'msg': 'no redi_list success!'}
|
|
|
- # log += '\tcode=200'
|
|
|
- # LogUtil.write_log(log=log)
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
is_sys_msg = self.is_sys_msg(int(event_type))
|
|
@@ -275,8 +264,6 @@ class NotificationView(View):
|
|
|
del up['uid_set__nickname']
|
|
|
del up['uid_set__detect_interval']
|
|
|
del up['uid_set__detect_group']
|
|
|
- # log += '\tcode=200'
|
|
|
- # LogUtil.write_log(log=log)
|
|
|
return JsonResponse(status=200, data={'code': 0, 'msg': 'success 0 or 2' ,'re_list':redis_list})
|
|
|
|
|
|
elif is_st == '1':
|
|
@@ -304,8 +291,6 @@ class NotificationView(View):
|
|
|
else:
|
|
|
# 是正式服务器的时候
|
|
|
res_data = {'code': 0, 'img_push': url, 'msg': 'success'}
|
|
|
- # log += '\tcode=200'
|
|
|
- # LogUtil.write_log(log=log)
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
elif is_st == '3':
|
|
@@ -340,8 +325,6 @@ class NotificationView(View):
|
|
|
else:
|
|
|
# 是正式服务器的时候
|
|
|
res_data = {'code': 0, 'img_url_list': img_url_list, 'msg': 'success 3'}
|
|
|
- # log += '\tcode=200'
|
|
|
- # LogUtil.write_log(log=log)
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
|