Browse Source

添加多人消息推送

yzc 1 year ago
parent
commit
cdc22ef51e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      hx-socket/src/main/java/com/fjhx/socket/core/WebSocketPush.java

+ 10 - 0
hx-socket/src/main/java/com/fjhx/socket/core/WebSocketPush.java

@@ -37,6 +37,16 @@ public class WebSocketPush {
         //将消息推送到极光
         JPushUtils.jPushSendMsg(title, Collections.singletonList(userId));
     }
+    /**
+     * 群发用户消息
+     */
+    public static void byUsers(PushTypeEnum pushTypeEnum, List<Long> userIds, String title, Integer businessType) {
+        for (Long userId : userIds) {
+            byUser(pushTypeEnum, userId, title, businessType, StringPool.EMPTY);
+        }
+        //将消息推送到极光
+        JPushUtils.jPushSendMsg(title, userIds);
+    }
 
     /**
      * 发送用户消息