locky преди 7 месеца
родител
ревизия
91b5036b7d

+ 0 - 11
AnsjerPush/test_config/test_config.py

@@ -208,14 +208,3 @@ HONORPUSH_CONFIG = {
         'app_id': 104481203
         'app_id': 104481203
     }
     }
 }
 }
-
-HUAWEI_CONFIG = {
-    'com.ansjer.zccloud_ab': {
-        'app_id': '101064781',
-        'app_secret': '29d5c5367208e35079f14779597b8f6bcc28ee39091546ed577862231fdd0fdd'
-    },
-    'com.cloudlife.commissionf_a': {
-        'app_id': '108703647',
-        'app_secret': '6bc5b0b0ab4588fcd667b3e6c1ab4fd5d857de21ad69ee9d46e077b9f5f24e8f'
-    }
-}

+ 10 - 0
Object/enums/ConstantEnum.py

@@ -0,0 +1,10 @@
+# @Author    : Rocky
+# @File      : ConstantEnum.py
+# @Time      : 2025/1/15 17:36
+from enum import Enum, unique
+
+
+@unique
+class ConstantEnum(Enum):
+    ZOSI_APP_BUNDLE_ID = 'com.ansjer.zccloud_ab'
+    VSEES_APP_BUNDLE_ID = 'com.ansjer.commissionf_a'

+ 5 - 4
Service/DevicePushService.py

@@ -29,6 +29,7 @@ from Model.models import UidPushModel, SysMsgModel, DeviceSharePermission, Devic
 from Object.ETkObject import ETkObject
 from Object.ETkObject import ETkObject
 from Object.OCIObjectStorage import OCIObjectStorage
 from Object.OCIObjectStorage import OCIObjectStorage
 from Object.UidTokenObject import UidTokenObject
 from Object.UidTokenObject import UidTokenObject
+from Object.enums.ConstantEnum import ConstantEnum
 from Object.enums.EventTypeEnum import EventTypeEnumObj
 from Object.enums.EventTypeEnum import EventTypeEnumObj
 from Object.utils import LocalDateTimeUtil
 from Object.utils import LocalDateTimeUtil
 from Service.CommonService import CommonService
 from Service.CommonService import CommonService
@@ -454,10 +455,10 @@ class DevicePushService:
                         push_result = PushObject.android_jpush(**kwargs)
                         push_result = PushObject.android_jpush(**kwargs)
 
 
                 elif push_type == 3:
                 elif push_type == 3:
-                    if kwargs["appBundleId"] == "com.ansjer.zccloud_ab":
+                    if kwargs["appBundleId"] == ConstantEnum.ZOSI_APP_BUNDLE_ID.value:
                         huawei_push_object = HuaweiPushObject()
                         huawei_push_object = HuaweiPushObject()
                         huawei_push_object.send_push_notify_message(**push_kwargs)
                         huawei_push_object.send_push_notify_message(**push_kwargs)
-                    elif kwargs["appBundleId"] == "com.ansjer.commissionf_a":
+                    elif kwargs["appBundleId"] == ConstantEnum.VSEES_APP_BUNDLE_ID.value:
                         vsees_huawei_push_object = VseesHuaweiPushObject()
                         vsees_huawei_push_object = VseesHuaweiPushObject()
                         vsees_huawei_push_object.send_push_notify_message(**push_kwargs)
                         vsees_huawei_push_object.send_push_notify_message(**push_kwargs)
                 elif push_type == 4:  # android xmpush
                 elif push_type == 4:  # android xmpush
@@ -800,12 +801,12 @@ class DevicePushService:
                 push_result = PushObject.android_fcm_push_v1(
                 push_result = PushObject.android_fcm_push_v1(
                     uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, uid, channel, image_url)
                     uid, appBundleId, token_val, n_time, event_type, msg_title, msg_text, uid, channel, image_url)
             elif push_type == 3:
             elif push_type == 3:
-                if appBundleId == "com.ansjer.zccloud_ab":
+                if appBundleId == ConstantEnum.ZOSI_APP_BUNDLE_ID.value:
                     huawei_push_object = HuaweiPushObject()
                     huawei_push_object = HuaweiPushObject()
                     push_result = huawei_push_object.send_push_notify_message(
                     push_result = 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,
                         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)
                         n_time=n_time, image_url=image_url, channel=channel)
-                elif appBundleId == "com.ansjer.commissionf_a":
+                elif appBundleId == ConstantEnum.VSEES_APP_BUNDLE_ID.value:
                     vsees_huawei_push_object = VseesHuaweiPushObject()
                     vsees_huawei_push_object = VseesHuaweiPushObject()
                     push_result = vsees_huawei_push_object.send_push_notify_message(
                     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,
                         token_val=token_val, msg_title=msg_title, msg_text=msg_text, uid=uid, event_type=event_type,

+ 1 - 1
Service/HuaweiPushService/HuaweiPushService.py

@@ -4,7 +4,7 @@ from AnsjerPush.config import LOGGER
 from Object.enums.EventTypeEnum import EventTypeEnumObj
 from Object.enums.EventTypeEnum import EventTypeEnumObj
 from Service.HuaweiPushService import push_admin
 from Service.HuaweiPushService import push_admin
 from Service.HuaweiPushService.push_admin import messaging
 from Service.HuaweiPushService.push_admin import messaging
-from AnsjerPush.config import HUAWEI_CONFIG
+
 
 
 class HuaweiPushObject:
 class HuaweiPushObject:
     # 华为推送服务类
     # 华为推送服务类

+ 1 - 1
Service/VSeesHuaweiPushService/VseesHuaweiPushObject.py

@@ -4,7 +4,7 @@ from AnsjerPush.config import LOGGER
 from Object.enums.EventTypeEnum import EventTypeEnumObj
 from Object.enums.EventTypeEnum import EventTypeEnumObj
 from Service.VSeesHuaweiPushService import push_admin
 from Service.VSeesHuaweiPushService import push_admin
 from Service.VSeesHuaweiPushService.push_admin import messaging
 from Service.VSeesHuaweiPushService.push_admin import messaging
-from AnsjerPush.config import HUAWEI_CONFIG
+
 
 
 class VseesHuaweiPushObject:
 class VseesHuaweiPushObject:
     # 华为推送服务类
     # 华为推送服务类