yangys
2024-04-25 365fac8a2ac52c8a3f9601fdf30e537ef373e8df
starter-http代码整理
已修改19个文件
34 ■■■■ 文件已修改
smart-man-boot/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCall.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/AsyncCallback.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/BaseAuthenticator.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/CssQuery.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/CssQueryMethodInterceptor.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/DomMapper.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/Exchange.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/FormBuilder.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/HttpRequest.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/HttpResponse.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/LogLevel.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/Method.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/MultipartFormBuilder.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/ResponseSpec.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/RetryInterceptor.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/RetryPolicy.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/Slf4jLogger.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smart-starter-http/src/main/java/com/qianwen/core/http/util/HttpUtil.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
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 -> {
    };
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;
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;
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;
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;
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;
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;
      
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();
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");
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;
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),
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";
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();
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();
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;
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;
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();
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);