|
@@ -22,7 +22,7 @@ from AnsjerPush.config import CONFIG_INFO, CONFIG_CN, MULTI_CHANNEL_TYPE_LIST, S
|
|
AWS_SECRET_ACCESS_KEY, EVENT_DICT, EVENT_DICT_CN, CONFIG_TEST
|
|
AWS_SECRET_ACCESS_KEY, EVENT_DICT, EVENT_DICT_CN, CONFIG_TEST
|
|
from AnsjerPush.config import XMPUSH_CONFIG, OPPOPUSH_CONFIG, XM_PUSH_CHANNEL_ID
|
|
from AnsjerPush.config import XMPUSH_CONFIG, OPPOPUSH_CONFIG, XM_PUSH_CHANNEL_ID
|
|
from Model.models import UidPushModel, SysMsgModel, DeviceSharePermission, DeviceChannelUserSet, \
|
|
from Model.models import UidPushModel, SysMsgModel, DeviceSharePermission, DeviceChannelUserSet, \
|
|
- DeviceChannelUserPermission, UidSetModel, Device_Info, UserAudioVideoPush
|
|
|
|
|
|
+ DeviceChannelUserPermission, UidSetModel, Device_Info, UserAudioVideoPush, PushLog
|
|
from Object.ETkObject import ETkObject
|
|
from Object.ETkObject import ETkObject
|
|
from Object.OCIObjectStorage import OCIObjectStorage
|
|
from Object.OCIObjectStorage import OCIObjectStorage
|
|
from Object.RedisObject import RedisObject
|
|
from Object.RedisObject import RedisObject
|
|
@@ -373,7 +373,7 @@ class DevicePushService:
|
|
push_type = kwargs['push_type']
|
|
push_type = kwargs['push_type']
|
|
push_kwargs = kwargs['push_kwargs']
|
|
push_kwargs = kwargs['push_kwargs']
|
|
push_result = False
|
|
push_result = False
|
|
-
|
|
|
|
|
|
+ uid = kwargs['uid']
|
|
# is_st为1或3,且推送类型为apns,gcm,华为,异步推送图片
|
|
# is_st为1或3,且推送类型为apns,gcm,华为,异步推送图片
|
|
if (kwargs['is_st'] == 1 or kwargs['is_st'] == 3) and \
|
|
if (kwargs['is_st'] == 1 or kwargs['is_st'] == 3) and \
|
|
(push_type == 0 or push_type == 1 or push_type == 3):
|
|
(push_type == 0 or push_type == 1 or push_type == 3):
|
|
@@ -433,6 +433,11 @@ class DevicePushService:
|
|
push_result = PushObject.android_meizupush(**push_kwargs)
|
|
push_result = PushObject.android_meizupush(**push_kwargs)
|
|
elif push_type == 8: # android honorpush
|
|
elif push_type == 8: # android honorpush
|
|
push_result = PushObject.android_honorpush(**push_kwargs)
|
|
push_result = PushObject.android_honorpush(**push_kwargs)
|
|
|
|
+
|
|
|
|
+ if kwargs['event_type'] in [606, 607]:
|
|
|
|
+ # 写入日志表
|
|
|
|
+ PushLog.objects.create(uid=uid, event_type=kwargs['event_type'], created_time=int(time.time()),
|
|
|
|
+ content=push_kwargs, push_result=push_result, push_type=push_type)
|
|
return push_result
|
|
return push_result
|
|
except Exception as e:
|
|
except Exception as e:
|
|
LOGGING.error('发送推送异常,error_line:{},error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
LOGGING.error('发送推送异常,error_line:{},error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|