diff --git a/README.md b/README.md index 2dcc0b9..aa8fa32 100644 --- a/README.md +++ b/README.md @@ -63,14 +63,14 @@ Maven 依赖 top.focess focess-qq - 4.1.5.3000 + 4.1.5.4000 ``` Gradle 依赖 ```gradle -implementation 'top.focess:focess-qq:4.1.5.3000' +implementation 'top.focess:focess-qq:4.1.5.4000' ``` 开发文档移步本项目[Wiki](https://github.com/MIdCoard/MiraiQQ/wiki) diff --git a/pom.xml b/pom.xml index d9b6089..e482858 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ A simple QQ Bot framework top.focess focess-qq - 4.1.5.3000 + 4.1.5.4000 ossrh @@ -26,13 +26,13 @@ 8 2.16.0 5.2.2 - 1.2.11 + 1.4.14 3.21.3 9+181-r4173-1 1.6.0 native-mt 1.3.2 - 1.1.18 + 1.1.19 1.2.4 1.0.2 1.1.0 diff --git a/src/main/java/top/focess/qq/api/util/network/NetworkHandler.java b/src/main/java/top/focess/qq/api/util/network/NetworkHandler.java index e8a87e7..3b05703 100644 --- a/src/main/java/top/focess/qq/api/util/network/NetworkHandler.java +++ b/src/main/java/top/focess/qq/api/util/network/NetworkHandler.java @@ -44,13 +44,13 @@ public NetworkHandler(final Plugin plugin, final top.focess.util.network.Network this.networkHandler = new top.focess.util.network.NetworkHandler(options); this.networkHandler.addHandler(new HttpHandler() { @Override - public void handle(final String url, final Map data, final Map header, final String body) { - LOGGER.debug(ChatConstants.NETWORK_DEBUG_HEADER + "[" + plugin.getName() + "] " + url + " Get: " + data + " with Header: " + header + ", Response: " + body); + public void handle(final String url, final String data, final Map header, final String body) { + LOGGER.debug(ChatConstants.NETWORK_DEBUG_HEADER + "[" + plugin.getName() + "] " + url + " Request: " + data + " with Header: " + header + ", Response: " + body); } @Override - public void handleException(final String url, final Map data, final Map header, final Exception e) { - LOGGER.debug(ChatConstants.NETWORK_DEBUG_HEADER + "[" + plugin.getName() + "] " + url + " Post: " + data + " with Header: " + header + ", Error: " + e.getMessage()); + public void handleException(final String url, final String data, final Map header, final Exception e) { + LOGGER.debug(ChatConstants.NETWORK_DEBUG_HEADER + "[" + plugin.getName() + "] " + url + " Request: " + data + " with Header: " + header + ", Error: " + e.getMessage()); } }); } @@ -67,27 +67,35 @@ public Plugin getPlugin() { return this.plugin; } - public HttpResponse request(final String url, final Map data, final top.focess.util.network.NetworkHandler.RequestType requestType) { - return this.networkHandler.request(url, data, requestType); + public HttpResponse request(String url, Map data, top.focess.util.network.NetworkHandler.RequestType requestType) { + return networkHandler.request(url, data, requestType); } - public HttpResponse request(final String url, final top.focess.util.network.NetworkHandler.RequestType requestType) { - return this.networkHandler.request(url, requestType); + public HttpResponse request(String url, top.focess.util.network.NetworkHandler.RequestType requestType) { + return networkHandler.request(url, requestType); } - public HttpResponse request(final String url, final Map data, final Map header, final MediaType mediaType, final top.focess.util.network.NetworkHandler.RequestType requestType) { - return this.networkHandler.request(url, data, header, mediaType, requestType); + public HttpResponse request(String url, Map data, Map header, MediaType mediaType, top.focess.util.network.NetworkHandler.RequestType requestType) { + return networkHandler.request(url, data, header, mediaType, requestType); } - public HttpResponse put(final String url, final Map data, final Map header, @NotNull final MediaType mediaType) { - return this.networkHandler.put(url, data, header, mediaType); + public HttpResponse request(String url, String data, Map header, MediaType mediaType, top.focess.util.network.NetworkHandler.RequestType requestType) { + return networkHandler.request(url, data, header, mediaType, requestType); } - public HttpResponse post(final String url, final Map data, final Map header, @NotNull final MediaType mediaType) { - return this.networkHandler.post(url, data, header, mediaType); + public HttpResponse put(String url, String data, Map header, @NotNull MediaType mediaType) { + return networkHandler.put(url, data, header, mediaType); } - public HttpResponse get(final String url, @NotNull final Map data, final Map header) { - return this.networkHandler.get(url, data, header); + public HttpResponse post(String url, String data, Map header, @NotNull MediaType mediaType) { + return networkHandler.post(url, data, header, mediaType); + } + + public HttpResponse delete(String url, String data, Map header, @NotNull MediaType mediaType) { + return networkHandler.delete(url, data, header, mediaType); + } + + public HttpResponse get(String url, @NotNull Map data, Map header) { + return networkHandler.get(url, data, header); } }