peng 2 роки тому
батько
коміт
82ffc3ca28

+ 2 - 0
Controller/AiController.py

@@ -183,6 +183,8 @@ class AiView(View):
                         kwargs.pop('uid')
                         kwargs.pop('channel')
                         PushObject.android_jpush(**kwargs)
+                    elif push_type == 4:  # android 小米推送
+                        PushObject.android_xmpush(**kwargs)
                 except Exception as e:
                     LOGGING.info('ai推送消息异常,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
                     continue

+ 3 - 0
Controller/ComboCron/ComboCronPushController.py

@@ -229,6 +229,9 @@ class ComboCronPushView(View):
             # android 极光推送
             elif push_type == 2:
                 PushObject.android_jpush(**kwargs)
+            # android 小米推送
+            elif push_type == 4:
+                PushObject.android_xmpush(**kwargs)
             return True
         except Exception as e:
             logger.info('流量预警推送异常,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))

+ 2 - 0
Controller/PowerWarningController.py

@@ -91,6 +91,8 @@ class PowerWarningView(View):
                         PushObject.android_fcm_push(**kwargs)
                     elif push_type == 2:  # android jpush
                         PushObject.android_jpush(**kwargs)
+                    elif push_type == 4:  # android 小米推送
+                        PushObject.android_xmpush(**kwargs)
                 except Exception as e:
                     logger.info('低电量推送消息异常,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
                     continue

+ 4 - 0
Controller/gatewayController.py

@@ -173,6 +173,8 @@ class GatewayView(View):
                             PushObject.android_fcm_push(**kwargs)
                         elif push_type == 2:  # android 极光推送
                             PushObject.android_jpush(**kwargs)
+                        elif push_type == 4:  # android 小米推送
+                            PushObject.android_xmpush(**kwargs)
                     except Exception as e:
                         logger.info('网关推送消息异常,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
                         continue
@@ -258,6 +260,8 @@ class GatewayView(View):
                                 PushObject.android_fcm_push(**kwargs)
                             elif push_type == 2:  # android 极光推送
                                 PushObject.android_jpush(**kwargs)
+                            elif push_type == 4:  # android 小米推送
+                                PushObject.android_xmpush(**kwargs)
                         except Exception as e:
                             logger.info('场景日志推送消息异常,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
                             continue

+ 5 - 1
Service/DevicePushService.py

@@ -162,7 +162,8 @@ class DevicePushService:
             # 判断是否进行APP消息推送,如app_push不为空,则不进行推送
             if not param['app_push']:
                 LOGGING.info('APP准备推送:{}, {}'.format(param['uid'], param))
-                if (param['is_st'] == 1 or param['is_st'] == 3) and (push_type == 0 or push_type == 1):  # 推送显示图片
+                # 推送显示图片
+                if (param['is_st'] == 1 or param['is_st'] == 3) and (push_type == 0 or push_type == 1 or push_type == 4):
                     if param['is_st'] == 1:
                         key = '{}/{}/{}.jpeg'.format(param['uid'], param['channel'], param['n_time'])
                     else:
@@ -371,6 +372,9 @@ class DevicePushService:
             elif push_type == 1:
                 PushObject.android_fcm_push(uid, appBundleId, token_val, n_time, event_type, msg_title,
                                             msg_text, uid, channel, image_url)
+            elif push_type == 4:
+                PushObject.android_xmpush(uid, appBundleId, token_val, n_time, event_type, msg_title,
+                                          msg_text, uid, channel, image_url)
         except Exception as e:
             LOGGING.info('异常详情,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
 

+ 3 - 0
Service/PushService.py

@@ -214,6 +214,9 @@ class PushObject:
         @param event_type: 事件类型
         @param msg_title: 推送标题
         @param msg_text: 推送内容
+        @param uid: uid
+        @param channel: 通道
+        @param image: 推送图片链接
         @return: None
         """
         try: