适配新版本

This commit is contained in:
sg 2024-03-08 15:44:50 +08:00
parent b5cc83be77
commit 7a5a8a90df
3 changed files with 6 additions and 2 deletions

View File

@ -24,7 +24,7 @@ public class HttpAsyncUtil {
protected static final Log log = Log.get();
public static Future<HttpResponse<Buffer>> 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 ->
{

View File

@ -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);
}

View File

@ -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());
}
}