|
@@ -6,6 +6,7 @@ from django.views.generic.base import View
|
|
|
|
|
|
from Object.RedisObject import RedisObject
|
|
|
from Service.DevicePushService import DevicePushService
|
|
|
+TIME_LOGGER = logging.getLogger('time')
|
|
|
|
|
|
|
|
|
# 移动侦测V2接口
|
|
@@ -63,7 +64,7 @@ class NotificationV2View(View):
|
|
|
uid = DevicePushService.decode_uid(etk, uidToken)
|
|
|
if len(uid) != 20 and len(uid) != 14:
|
|
|
return JsonResponse(status=200, data={'code': 404, 'msg': 'wrong uid'})
|
|
|
- logger.info('消息推送V2****uid{}'.format(uid))
|
|
|
+ TIME_LOGGER.info('开始推送,uid:{},n_time:{},事件类型:{}'.format(uid, n_time, event_type))
|
|
|
# 判断是否为系统消息
|
|
|
is_sys_msg = DevicePushService.judge_sys_msg(int(event_type))
|
|
|
if is_sys_msg:
|
|
@@ -133,7 +134,8 @@ class NotificationV2View(View):
|
|
|
params['uid_set_push_list'] = uid_set_push_list
|
|
|
params['code_dict'] = result
|
|
|
result_dict = DevicePushService.get_push_url(**params) # 获取S3对象上传链接
|
|
|
- logger.info('{}触发时间{},推送URL{}'.format(uid, n_time, json.dumps(result_dict)))
|
|
|
+ TIME_LOGGER.info('推送响应,uid:{},n_time:{},事件类型:{},响应:{}'.format(
|
|
|
+ uid, n_time, event_type, json.dumps(result_dict)))
|
|
|
return JsonResponse(status=200, data=result_dict)
|
|
|
except Exception as e:
|
|
|
logger.info('V2推送接口异常, errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|