From 1979dfdb63e63e4c57ca4b4e0ccdc7e81a3db3d4 Mon Sep 17 00:00:00 2001 From: water_xu Date: Thu, 27 Jun 2024 17:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8E=A8=E9=80=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84-userList=E5=8F=98=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/flow/util/GJSendMessageUtil.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/zcloud/flow/util/GJSendMessageUtil.java b/src/main/java/com/zcloud/flow/util/GJSendMessageUtil.java index 17f0a739..648da3b3 100644 --- a/src/main/java/com/zcloud/flow/util/GJSendMessageUtil.java +++ b/src/main/java/com/zcloud/flow/util/GJSendMessageUtil.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.zcloud.flow.util.dto.UserDTO; import lombok.extern.apachecommons.CommonsLog; import lombok.extern.slf4j.Slf4j; @@ -55,12 +56,17 @@ public class GJSendMessageUtil { public static final String TIMESTAMP_HEADER = "gjxy-timestamp"; public void sendMessage(List users) throws Exception { - for (UserDTO user : users) { - Map paramDataMap = new HashMap<>(); - paramDataMap.put("userList", user); - // 发起请求 - String body = this.createPostFormHttpRequest("/API-BACKEND/openapi/user/v1/syncNotify", paramDataMap); - } + + Map paramDataMap = new HashMap<>(); + paramDataMap.put("userList", users); + // 发起请求 + String body = this.createPostFormHttpRequest("/API-BACKEND/openapi/user/v1/syncNotify", paramDataMap); + System.out.println("=========================="); + System.out.println(body); + System.out.println("=========================="); + System.out.println(JSONObject.toJSONString(paramDataMap)); + System.out.println("=========================="); + } /**