From 7a5a8a90dfc65e276f61d1c2ec1e742bc69c5ca8 Mon Sep 17 00:00:00 2001 From: sg <2450572350@qq.com> Date: Fri, 8 Mar 2024 15:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/example/wxhk/util/HttpAsyncUtil.java | 2 +- .../src/main/java/com/example/wxhk/util/HttpSyncUtil.java | 2 +- .../src/test/java/com/example/wxhk/util/HttpSendUtilTest.java | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/java_client/src/main/java/com/example/wxhk/util/HttpAsyncUtil.java b/java_client/src/main/java/com/example/wxhk/util/HttpAsyncUtil.java index 193f6dd..0264a6a 100644 --- a/java_client/src/main/java/com/example/wxhk/util/HttpAsyncUtil.java +++ b/java_client/src/main/java/com/example/wxhk/util/HttpAsyncUtil.java @@ -24,7 +24,7 @@ public class HttpAsyncUtil { protected static final Log log = Log.get(); public static Future> exec(Type type, JsonObject object) { - return client.post(InitWeChat.wxPort, "localhost", "/api/?type=" + type.getType()) + return client.post(InitWeChat.wxPort, "localhost", "/api/" + type.getType()) .sendJsonObject(object) .onSuccess(event -> { diff --git a/java_client/src/main/java/com/example/wxhk/util/HttpSyncUtil.java b/java_client/src/main/java/com/example/wxhk/util/HttpSyncUtil.java index 21686ac..c8e248e 100644 --- a/java_client/src/main/java/com/example/wxhk/util/HttpSyncUtil.java +++ b/java_client/src/main/java/com/example/wxhk/util/HttpSyncUtil.java @@ -27,7 +27,7 @@ public class HttpSyncUtil { } public static JsonObject exec(HttpAsyncUtil.Type type, JsonObject obj) { - String post = engine.send(Request.of("http://localhost:" + InitWeChat.wxPort + "/api/?type=" + type.getType()).method(Method.POST).body(obj.encode())).bodyStr(); + String post = engine.send(Request.of("http://localhost:" + InitWeChat.wxPort + "/api/" + type.getType()).method(Method.POST).body(obj.encode())).bodyStr(); if (log.isDebugEnabled()) { log.debug("type:{},{}", type.getType(), post); } diff --git a/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java b/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java index 442acae..a9c7875 100644 --- a/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java +++ b/java_client/src/test/java/com/example/wxhk/util/HttpSendUtilTest.java @@ -7,6 +7,8 @@ import org.dromara.hutool.core.lang.Console; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import java.time.Duration; +import java.time.LocalDateTime; import java.util.List; @SpringBootTest @@ -41,5 +43,7 @@ class HttpSendUtilTest { void 获取群成员() { GroupMembers 获取群成员 = HttpSendUtil.获取群成员(new GetGroupMembers().setChatRoomId("24964676359@chatroom")); Console.log(获取群成员); + + Duration between = Duration.between(LocalDateTime.now(), LocalDateTime.now()); } } \ No newline at end of file