Prechádzať zdrojové kódy

袋鼠妈咪华为推送2

locky 3 mesiacov pred
rodič
commit
558c791b05

+ 1 - 0
Object/enums/ConstantEnum.py

@@ -8,3 +8,4 @@ from enum import Enum, unique
 class ConstantEnum(Enum):
     ZOSI_APP_BUNDLE_ID = 'com.ansjer.zccloud_ab'
     VSEES_APP_BUNDLE_ID = 'com.cloudlife.commissionf_a'
+    ROOMUMY_APP_BUNDLE_ID = 'com.smartlife.live_a'

+ 9 - 0
Service/DevicePushService.py

@@ -44,6 +44,7 @@ from Service.HuaweiPushService.HuaweiPushService import HuaweiPushObject
 from Service.PushService import PushObject
 from django.db import close_old_connections
 
+from Service.RoomumyHuaweiPushService.RoomumyHuaweiPushService import RoomumyHuaweiPushObject
 from Service.VSeesHuaweiPushService.VseesHuaweiPushObject import VseesHuaweiPushObject
 
 LOGGING = logging.getLogger('info')
@@ -516,6 +517,9 @@ class DevicePushService:
                     elif kwargs["appBundleId"] == ConstantEnum.VSEES_APP_BUNDLE_ID.value:
                         vsees_huawei_push_object = VseesHuaweiPushObject()
                         vsees_huawei_push_object.send_push_notify_message(**push_kwargs)
+                    elif kwargs["appBundleId"] == ConstantEnum.ROOMUMY_APP_BUNDLE_ID.value:
+                        roomumy_huawei_push_object = RoomumyHuaweiPushObject()
+                        roomumy_huawei_push_object.send_push_notify_message(**push_kwargs)
                 elif push_type == 4:  # android xmpush
                     if kwargs['event_type'] in DATA_PUSH_EVENT_TYPE_LIST:
                         push_channel = 'push_to_talk'
@@ -1004,6 +1008,11 @@ class DevicePushService:
                     push_result = vsees_huawei_push_object.send_push_notify_message(
                         token_val=token_val, msg_title=msg_title, msg_text=msg_text, uid=uid, event_type=event_type,
                         n_time=n_time, image_url=image_url, channel=channel)
+                elif appBundleId == ConstantEnum.ROOMUMY_APP_BUNDLE_ID.value:
+                    roomumy_huawei_push_object = RoomumyHuaweiPushObject()
+                    push_result = roomumy_huawei_push_object.send_push_notify_message(
+                        token_val=token_val, msg_title=msg_title, msg_text=msg_text, uid=uid, event_type=event_type,
+                        n_time=n_time, image_url=image_url, channel=channel)
             TIME_LOGGER.info('{}推送图片,push_type:{},推送结果:{}'.format(uid, push_type, push_result))
         except Exception as e:
             ERROR_INFO_LOGGER.error(

+ 1 - 1
Service/RoomumyHuaweiPushService/RoomumyHuaweiPushService.py

@@ -7,7 +7,7 @@ from Service.HuaweiPushService import push_admin
 from Service.HuaweiPushService.push_admin import messaging
 
 
-class HuaweiPushObject:
+class RoomumyHuaweiPushObject:
     # 华为推送服务类
 
     def __init__(self):