From e8cd57fc46fa84b0c095f7e93cb348c014d06eb4 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期六, 07 三月 2026 21:00:03 +0800
Subject: [PATCH] 新增管理后台接口,修改小程序流程bug及其他相关功能

---
 xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java b/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java
index e851116..5d52673 100644
--- a/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java
+++ b/xp-robotaxi-push-message-boot/src/main/java/com/xiaopeng/pushMessage/utils/AliPushUtil.java
@@ -34,10 +34,6 @@
     @Value("${ali.push.iosChannelId}")
     private String iosChannelId;
     /**
-     * 消息类型  MESSAGE 消息  NOTICE  通知
-     */
-    private final String PUSH_TYPE = "MESSAGE";
-    /**
      * 设备类型 ALL 全部 HARMONY 鸿蒙  IOS ios设备 ANDROID 安卓设备
      */
     private final String DEVICE_TYPE_ALL = "ALL";
@@ -60,9 +56,10 @@
      * @param account 运维手机号
      * @param title 标题
      * @param body 消息内容
+     * @param pushType NOTICE:表示通知。 MESSAGE:表示消息。
      * @throws Exception
      */
-    public String pushMessage(Integer deviceType,String account, String title, String body){
+    public String pushMessage(Integer deviceType,String account, String title, String body,String pushType){
 
         try {
             StaticCredentialProvider credentialProvider = StaticCredentialProvider.create(
@@ -95,14 +92,28 @@
 
                 PushRequest pushRequest = PushRequest.builder()
                         .appKey(appKeys)
-                        .pushType(PUSH_TYPE)
+                        .pushType(pushType)
                         .deviceType(DEVICE_TYPE_ALL)
                         .target(TARGET)
                         .targetValue(account)
                         .title(title)
                         .body(body)
+                        .androidExtParameters(body)
                         .androidNotificationChannel(channelIds)
                         .build();
+                if(deviceType == 2){
+                    pushRequest = PushRequest.builder()
+                            .appKey(appKeys)
+                            .pushType(pushType)
+                            .deviceType(DEVICE_TYPE_ALL)
+                            .target(TARGET)
+                            .targetValue(account)
+                            .title(title)
+                            .body(body)
+                            .iOSExtParameters(body)
+                            .androidNotificationChannel(channelIds)
+                            .build();
+                }
                 CompletableFuture<PushResponse> response = client.push(pushRequest);
                 PushResponse resp = response.get();
                 String json = new Gson().toJson(resp);

--
Gitblit v1.7.1