|
@@ -38,8 +38,6 @@ class NotificationV2View(View):
|
|
|
@param request_dict:dealings_type 往来检测 1:来,2:离开
|
|
|
@param request_dict:detection 检测类型 0:普通,1:算法
|
|
|
"""
|
|
|
- logger = logging.getLogger('info')
|
|
|
- logger.info('消息推送V2接口参数:{}'.format(request_dict))
|
|
|
uidToken = request_dict.get('uidToken', None)
|
|
|
etk = request_dict.get('etk', None)
|
|
|
channel = request_dict.get('channel', '1')
|
|
@@ -65,7 +63,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'})
|
|
|
- TIME_LOGGER.info('开始推送,uid:{},事件类型:{},n_time:{}'.format(uid, event_type, n_time))
|
|
|
+ TIME_LOGGER.info('开始推送,uid:{},参数:{}'.format(uid, request_dict))
|
|
|
# 判断是否为系统消息
|
|
|
is_sys_msg = DevicePushService.judge_sys_msg(event_type)
|
|
|
if is_sys_msg:
|
|
@@ -84,7 +82,7 @@ class NotificationV2View(View):
|
|
|
# 查询uid_push和uid_set数据
|
|
|
uid_push_qs = DevicePushService.query_uid_push(uid, event_type)
|
|
|
if not uid_push_qs.exists():
|
|
|
- logger.info('消息推送-{}uid_push数据不存在'.format(uid))
|
|
|
+ TIME_LOGGER.info('推送响应,uid:{},uid_push数据不存在!'.format(uid))
|
|
|
return JsonResponse(status=200, data={'code': 176, 'msg': 'no uid_push data'})
|
|
|
|
|
|
ai_type = uid_push_qs.first()['uid_set__ai_type']
|
|
@@ -153,7 +151,7 @@ class NotificationV2View(View):
|
|
|
uid, n_time, event_type, json.dumps(res_data)))
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
except Exception as e:
|
|
|
- logger.info('V2推送接口异常,error_line:{},error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
+ TIME_LOGGER.info('V2推送接口异常,error_line:{},error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
data = {
|
|
|
'error_line': e.__traceback__.tb_lineno,
|
|
|
'error_msg': repr(e)
|