From 365fac8a2ac52c8a3f9601fdf30e537ef373e8df Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 25 四月 2024 16:18:25 +0800
Subject: [PATCH] starter-http代码整理
---
smart-starter-http/src/main/java/com/qianwen/core/http/HttpRequest.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/LogLevel.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/Slf4jLogger.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/util/HttpUtil.java | 1 -
smart-man-boot/src/main/resources/application-dev.yml | 2 +-
smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCallback.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/FormBuilder.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/MultipartFormBuilder.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/DomMapper.java | 7 +++----
smart-starter-http/src/main/java/com/qianwen/core/http/CssQuery.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/HttpResponse.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/RetryPolicy.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/ResponseSpec.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCall.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/Method.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/RetryInterceptor.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/CssQueryMethodInterceptor.java | 9 ++++-----
smart-starter-http/src/main/java/com/qianwen/core/http/BaseAuthenticator.java | 1 -
smart-starter-http/src/main/java/com/qianwen/core/http/Exchange.java | 1 -
19 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/smart-man-boot/src/main/resources/application-dev.yml b/smart-man-boot/src/main/resources/application-dev.yml
index 648b049..dbc0fc4 100644
--- a/smart-man-boot/src/main/resources/application-dev.yml
+++ b/smart-man-boot/src/main/resources/application-dev.yml
@@ -45,7 +45,7 @@
# tdengine
tdengine:
driver: com.taosdata.jdbc.TSDBDriver
- url: jdbc:TAOS://localhost:6030/iot_data?charset=UTF-8&locale=en_US.UTF-8&cfgdir=taos.cfg
+ url: jdbc:TAOS://172.22.147.236:6030/iot_data?charset=UTF-8&locale=en_US.UTF-8&cfgdir=taos.cfg
username: root
password: taosdata
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCall.java b/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCall.java
index 9c95532..71f879c 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCall.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCall.java
@@ -6,7 +6,6 @@
import okhttp3.Call;
import okhttp3.Request;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/AsyncCall.class */
public class AsyncCall {
private static final Consumer<ResponseSpec> DEFAULT_CONSUMER = r -> {
};
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCallback.java b/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCallback.java
index c7abd47..7aecf0d 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCallback.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCallback.java
@@ -7,7 +7,6 @@
import okhttp3.Response;
@ParametersAreNonnullByDefault
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/AsyncCallback.class */
public class AsyncCallback implements Callback {
private final AsyncCall asyncCall;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/BaseAuthenticator.java b/smart-starter-http/src/main/java/com/qianwen/core/http/BaseAuthenticator.java
index 3c98fe9..04c2f76 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/BaseAuthenticator.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/BaseAuthenticator.java
@@ -8,7 +8,6 @@
import okhttp3.Response;
import okhttp3.Route;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/BaseAuthenticator.class */
public class BaseAuthenticator implements Authenticator {
private final String userName;
private final String password;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/CssQuery.java b/smart-starter-http/src/main/java/com/qianwen/core/http/CssQuery.java
index 5582584..6e59868 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/CssQuery.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/CssQuery.java
@@ -11,7 +11,6 @@
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Documented
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/CssQuery.class */
public @interface CssQuery {
public static final int DEFAULT_REGEX_GROUP = 0;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/CssQueryMethodInterceptor.java b/smart-starter-http/src/main/java/com/qianwen/core/http/CssQueryMethodInterceptor.java
index 759c6cc..3f6c7c7 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/CssQueryMethodInterceptor.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/CssQueryMethodInterceptor.java
@@ -21,7 +21,6 @@
import org.springframework.core.ResolvableType;
import org.springframework.core.convert.TypeDescriptor;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/CssQueryMethodInterceptor.class */
public class CssQueryMethodInterceptor implements MethodInterceptor {
private final Class<?> clazz;
private final Element element;
@@ -65,9 +64,9 @@
if (elements.isEmpty()) {
return valueList;
}
- Iterator it = elements.iterator();
+ Iterator<Element> it = elements.iterator();
while (it.hasNext()) {
- Element select = (Element) it.next();
+ Element select = it.next();
String value = getValue(select, cssQuery);
if (value != null) {
valueList.add(value);
@@ -88,9 +87,9 @@
if (innerType == null) {
throw new IllegalArgumentException("Class " + returnType + " 璇诲彇娉涘瀷澶辫触銆�");
}
- Iterator it = elements.iterator();
+ Iterator<Element> it = elements.iterator();
while (it.hasNext()) {
- Element select = (Element) it.next();
+ Element select = it.next();
valueList.add(DomMapper.readValue(select, innerType));
}
return valueList;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/DomMapper.java b/smart-starter-http/src/main/java/com/qianwen/core/http/DomMapper.java
index 0f5646b..f5c6957 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/DomMapper.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/DomMapper.java
@@ -14,7 +14,6 @@
import com.qianwen.core.tool.utils.Exceptions;
import org.springframework.cglib.proxy.Enhancer;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/DomMapper.class */
public class DomMapper {
public static Document asDocument(ResponseSpec response) {
return readDocument(response.asString());
@@ -63,10 +62,10 @@
}
String cssQueryValue = annotation.value();
Elements elements = doc.select(cssQueryValue);
- ArrayList arrayList = new ArrayList();
- Iterator it = elements.iterator();
+ ArrayList<T> arrayList = new ArrayList<>();
+ Iterator<Element> it = elements.iterator();
while (it.hasNext()) {
- Element element = (Element) it.next();
+ Element element = it.next();
arrayList.add(readValue(element, clazz));
}
return arrayList;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/Exchange.java b/smart-starter-http/src/main/java/com/qianwen/core/http/Exchange.java
index 11bcbd0..43a422c 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/Exchange.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/Exchange.java
@@ -15,7 +15,6 @@
import okhttp3.Request;
import com.qianwen.core.tool.utils.Exceptions;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/Exchange.class */
public class Exchange {
private BiConsumer<Request, IOException> failedBiConsumer;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/FormBuilder.java b/smart-starter-http/src/main/java/com/qianwen/core/http/FormBuilder.java
index 6b3d6ef..2fe1595 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/FormBuilder.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/FormBuilder.java
@@ -4,7 +4,6 @@
import javax.annotation.Nullable;
import okhttp3.FormBody;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/FormBuilder.class */
public class FormBuilder {
private final HttpRequest request;
private final FormBody.Builder formBuilder = new FormBody.Builder();
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/HttpRequest.java b/smart-starter-http/src/main/java/com/qianwen/core/http/HttpRequest.java
index cfdecd0..3416800 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/HttpRequest.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/HttpRequest.java
@@ -43,7 +43,6 @@
import com.qianwen.core.tool.utils.Exceptions;
import com.qianwen.core.tool.utils.Holder;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/HttpRequest.class */
public class HttpRequest {
private static final String DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36";
private static final MediaType APPLICATION_JSON = MediaType.parse("application/json;charset=UTF-8");
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/HttpResponse.java b/smart-starter-http/src/main/java/com/qianwen/core/http/HttpResponse.java
index b9e4cf9..97be7de 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/HttpResponse.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/HttpResponse.java
@@ -22,7 +22,6 @@
import com.qianwen.core.tool.jackson.JsonUtil;
import com.qianwen.core.tool.utils.Exceptions;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/HttpResponse.class */
public class HttpResponse implements ResponseSpec, Closeable {
private final Request request;
private final Response response;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/LogLevel.java b/smart-starter-http/src/main/java/com/qianwen/core/http/LogLevel.java
index dcf0423..a315a9d 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/LogLevel.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/LogLevel.java
@@ -2,7 +2,6 @@
import okhttp3.logging.HttpLoggingInterceptor;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/LogLevel.class */
public enum LogLevel {
NONE(HttpLoggingInterceptor.Level.NONE),
BASIC(HttpLoggingInterceptor.Level.BASIC),
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/Method.java b/smart-starter-http/src/main/java/com/qianwen/core/http/Method.java
index 11465fc..62071e5 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/Method.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/Method.java
@@ -1,6 +1,5 @@
package com.qianwen.core.http;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/Method.class */
public interface Method {
public static final String GET = "GET";
public static final String POST = "POST";
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/MultipartFormBuilder.java b/smart-starter-http/src/main/java/com/qianwen/core/http/MultipartFormBuilder.java
index a2d19ab..1a4ca9c 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/MultipartFormBuilder.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/MultipartFormBuilder.java
@@ -8,7 +8,6 @@
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/MultipartFormBuilder.class */
public class MultipartFormBuilder {
private final HttpRequest request;
private final MultipartBody.Builder formBuilder = new MultipartBody.Builder();
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/ResponseSpec.java b/smart-starter-http/src/main/java/com/qianwen/core/http/ResponseSpec.java
index 2314011..22ec947 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/ResponseSpec.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/ResponseSpec.java
@@ -16,7 +16,6 @@
import okhttp3.Response;
import okhttp3.ResponseBody;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/ResponseSpec.class */
public interface ResponseSpec {
int code();
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/RetryInterceptor.java b/smart-starter-http/src/main/java/com/qianwen/core/http/RetryInterceptor.java
index 06376b8..870dfaf 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/RetryInterceptor.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/RetryInterceptor.java
@@ -10,7 +10,6 @@
import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.retry.support.RetryTemplate;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/RetryInterceptor.class */
public class RetryInterceptor implements Interceptor {
private final RetryPolicy retryPolicy;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/RetryPolicy.java b/smart-starter-http/src/main/java/com/qianwen/core/http/RetryPolicy.java
index b8f715b..c661ff4 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/RetryPolicy.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/RetryPolicy.java
@@ -3,7 +3,6 @@
import java.util.function.Predicate;
import javax.annotation.Nullable;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/RetryPolicy.class */
public class RetryPolicy {
public static final RetryPolicy INSTANCE = new RetryPolicy();
private final int maxAttempts;
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/Slf4jLogger.java b/smart-starter-http/src/main/java/com/qianwen/core/http/Slf4jLogger.java
index 0a39ac7..95fcd31 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/Slf4jLogger.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/Slf4jLogger.java
@@ -4,7 +4,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/Slf4jLogger.class */
public class Slf4jLogger implements HttpLoggingInterceptor.Logger {
private static final Logger log = LoggerFactory.getLogger(Slf4jLogger.class);
public static final HttpLoggingInterceptor.Logger INSTANCE = new Slf4jLogger();
diff --git a/smart-starter-http/src/main/java/com/qianwen/core/http/util/HttpUtil.java b/smart-starter-http/src/main/java/com/qianwen/core/http/util/HttpUtil.java
index ab9d524..2f1e1fd 100644
--- a/smart-starter-http/src/main/java/com/qianwen/core/http/util/HttpUtil.java
+++ b/smart-starter-http/src/main/java/com/qianwen/core/http/util/HttpUtil.java
@@ -7,7 +7,6 @@
import com.qianwen.core.http.FormBuilder;
import com.qianwen.core.http.HttpRequest;
-/* loaded from: blade-starter-http-9.3.0.0-SNAPSHOT.jar:org/springblade/core/http/util/HttpUtil.class */
public class HttpUtil {
private static final Logger log = LoggerFactory.getLogger(HttpUtil.class);
--
Gitblit v1.9.3