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