|
@@ -55,6 +55,7 @@ class NotificationView(View):
|
|
|
def validation(self, request_dict):
|
|
|
logger = logging.getLogger('info')
|
|
|
logger.info(request_dict)
|
|
|
+ logger.info("进来了")
|
|
|
uidToken = request_dict.get('uidToken', None)
|
|
|
etk = request_dict.get('etk', None)
|
|
|
channel = request_dict.get('channel', '1')
|
|
@@ -303,7 +304,9 @@ class NotificationView(View):
|
|
|
if is_sys_msg:
|
|
|
SysMsgModel.objects.bulk_create(sys_msg_list)
|
|
|
Equipment_Info.objects.bulk_create(eq_list)
|
|
|
+ logger.info("图片信息上传到数据库了")
|
|
|
if is_st == '0' or is_st == '2':
|
|
|
+ logger.info("进到is_st为0或2")
|
|
|
print("is_st=0or2")
|
|
|
for up in redis_list:
|
|
|
if up['push_type'] == 0: # ios apns
|
|
@@ -321,9 +324,11 @@ class NotificationView(View):
|
|
|
del up['uid_set__nickname']
|
|
|
del up['uid_set__detect_interval']
|
|
|
del up['uid_set__detect_group']
|
|
|
+ logger.info("出来了")
|
|
|
return JsonResponse(status=200, data={'code': 0, 'msg': 'success 0 or 2' ,'re_list':redis_list})
|
|
|
|
|
|
elif is_st == '1':
|
|
|
+ logger.info("进到is_st为1")
|
|
|
print("is_st=1")
|
|
|
# Endpoint以杭州为例,其它Region请按实际情况填写。
|
|
|
# obj = '{uid}/{channel}/{filename}.jpeg'.format(uid=uid, channel=channel, filename=n_time)
|
|
@@ -348,6 +353,7 @@ class NotificationView(View):
|
|
|
},
|
|
|
ExpiresIn=3600
|
|
|
)
|
|
|
+ logger.info("成功生成上传签名url了")
|
|
|
for up in redis_list:
|
|
|
up['do_apns_code'] = do_apns_code
|
|
|
up['do_fcm_code'] = do_fcm_code
|
|
@@ -370,9 +376,11 @@ class NotificationView(View):
|
|
|
# 是正式服务器的时候
|
|
|
# res_data = {'code': 0, 'img_push': url, 'msg': 'success'}
|
|
|
res_data = {'code': 0, 'img_push': response_url, 'msg': 'success'}
|
|
|
+ logger.info("出来了")
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
elif is_st == '3':
|
|
|
+ logger.info("进到is_st为3")
|
|
|
print("is_st=3")
|
|
|
# 人形检测带动图
|
|
|
# Endpoint以杭州为例,其它Region请按实际情况填写。
|
|
@@ -405,6 +413,7 @@ class NotificationView(View):
|
|
|
)
|
|
|
# response_url = response_url[:4] + response_url[5:]
|
|
|
img_url_list.append(response_url)
|
|
|
+ logger.info("成功生成上传签名url了")
|
|
|
|
|
|
# img_url_list.append(url)
|
|
|
|
|
@@ -428,6 +437,7 @@ class NotificationView(View):
|
|
|
else:
|
|
|
# 是正式服务器的时候
|
|
|
res_data = {'code': 0, 'img_url_list': img_url_list, 'msg': 'success 3'}
|
|
|
+ logger.info("出来了")
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
|