|
@@ -1,25 +1,15 @@
|
|
|
import json
|
|
|
import logging
|
|
|
-import os
|
|
|
-import time
|
|
|
|
|
|
-import apns2
|
|
|
-import jpush as jpush
|
|
|
import oss2
|
|
|
-from django.db import transaction
|
|
|
from django.http import JsonResponse
|
|
|
from django.views.generic.base import View
|
|
|
-from pyfcm import FCMNotification
|
|
|
|
|
|
-from AnsjerPush.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET, JPUSH_CONFIG, FCM_CONFIG, \
|
|
|
- APNS_CONFIG, BASE_DIR, APNS_MODE
|
|
|
-from AnsjerPush.config import SERVER_TYPE
|
|
|
-from Model.models import UidPushModel, SysMsgModel
|
|
|
-from Object.ETkObject import ETkObject
|
|
|
+from AnsjerPush.config import CONFIG_INFO, CONFIG_CN
|
|
|
+from AnsjerPush.config import OSS_STS_ACCESS_KEY, OSS_STS_ACCESS_SECRET
|
|
|
+from Model.models import SysMsgModel
|
|
|
from Object.RedisObject import RedisObject
|
|
|
-from Object.UidTokenObject import UidTokenObject
|
|
|
from Object.utils import LocalDateTimeUtil
|
|
|
-from Service.CommonService import CommonService
|
|
|
from Service.DevicePushService import DevicePushService
|
|
|
from Service.EquipmentInfoService import EquipmentInfoService
|
|
|
|
|
@@ -111,13 +101,14 @@ class NotificationView(View):
|
|
|
detect_med_type = 1 # 1为存库不推送
|
|
|
else:
|
|
|
detect_med_type = 2 # 为2的话,既推送,又存库
|
|
|
- if SERVER_TYPE != 'Ansjer.cn_config.cn_formal_settings':
|
|
|
+ if CONFIG_INFO != CONFIG_CN:
|
|
|
new_detect_interval = uid_push_list[0]['uid_set__new_detect_interval']
|
|
|
detect_interval = new_detect_interval if new_detect_interval > 0 else detect_interval
|
|
|
detect_interval = 60 if detect_interval < 60 else detect_interval
|
|
|
redisObj.set_data(key=dkey, val=1, expire=detect_interval - 5)
|
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
|
- logger.info('APP消息推送V1接口,是否进行APP推送:{},1为不推送,间隔:{}'.format(detect_med_type, detect_interval))
|
|
|
+ logger.info(
|
|
|
+ 'APP消息推送V1接口,是否进行APP推送:{},1为不推送,间隔:{}'.format(detect_med_type, detect_interval))
|
|
|
# 旧模式并且没有pkey,重新创建一个
|
|
|
if not detect_group and not have_pkey:
|
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|