Skip to content

Commit

Permalink
update dependency and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chentianming11 committed Dec 4, 2022
1 parent 952351d commit 8a74afa
Show file tree
Hide file tree
Showing 26 changed files with 123 additions and 58 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
[English Document](https://github.com/LianjiaTech/retrofit-spring-boot-starter/blob/master/README_EN.md)

**适用于retrofit的spring-boot启动器,支持快速集成和功能增强**
1. *Spring Boot 3.x 项目,请使用retrofit-spring-boot-starter 3.x*
2. *Spring Boot 1.x/2.x 项目,请使用retrofit-spring-boot-starter 2.x*

> 🚀项目持续优化迭代,欢迎大家提ISSUE和PR!麻烦大家能给一颗star✨,您的star是我们持续更新的动力!
Expand Down Expand Up @@ -49,7 +51,7 @@ gitee项目地址:[https://gitee.com/lianjiatech/retrofit-spring-boot-starter]
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.10</version>
<version>2.3.11</version>
</dependency>
```

Expand Down
4 changes: 3 additions & 1 deletion README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
[中文文档](https://github.com/LianjiaTech/retrofit-spring-boot-starter/blob/master/README.md)

**A spring-boot starter for retrofit, supports rapid integration and feature enhancements.**
1. *Spring Boot 3.x project,please use retrofit-spring-boot-starter 3.x*
2. *Spring Boot 1.x/2.x project,please use retrofit-spring-boot-starter 2.x*

> Open source is not easy, please give me a star⭐️
Expand Down Expand Up @@ -39,7 +41,7 @@
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.10</version>
<version>2.3.11</version>
</dependency>
```

Expand Down
54 changes: 21 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.10</version>
<version>2.3.11</version>

<name>retrofit-spring-boot-starter</name>
<description>retrofit-spring-boot-starter</description>
Expand Down Expand Up @@ -38,13 +38,10 @@

<properties>
<retrofit.version>2.9.0</retrofit.version>
<junit.version>4.13.1</junit.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<slf4j-api.version>1.7.25</slf4j-api.version>
<spring-boot.version>2.0.9.RELEASE</spring-boot.version>
<spring-boot.version>2.7.6</spring-boot.version>
<okhttp.version>3.14.9</okhttp.version>
<sentinel.version>1.6.3</sentinel.version>
<jackson.version>2.13.4.2</jackson.version>
<lombok.version>1.18.24</lombok.version>
</properties>

Expand Down Expand Up @@ -74,6 +71,18 @@
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring-boot.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
<version>${spring-boot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
Expand All @@ -84,36 +93,12 @@
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>${retrofit.version}</version>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation-api.version}</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
Expand Down Expand Up @@ -153,6 +138,12 @@
<artifactId>resilience4j-circuitbreaker</artifactId>
<version>1.7.1</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
Expand All @@ -166,7 +157,6 @@
<version>3.1.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
Expand Down Expand Up @@ -221,16 +211,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.2.0</version>
<configuration>
<show>private</show>
<nohelp>true</nohelp>
<charset>UTF-8</charset>
<encoding>UTF-8</encoding>
<docencoding>UTF-8</docencoding>
<additionalparam>-Xdoclint:none</additionalparam>
<javadocExecutable>/Library/Java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home/bin/javadoc
</javadocExecutable>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@ public class RetrofitProperties {

/**
* 全局重试配置
* <p>
* retry config
*/
@NestedConfigurationProperty
private GlobalRetryProperty globalRetry = new GlobalRetryProperty();

/**
* 熔断降级配置
* <p>
* degrade config
*/
@NestedConfigurationProperty
private DegradeProperty degrade = new DegradeProperty();

/**
* 全局日志配置
* <p>
* log config
*/
@NestedConfigurationProperty
Expand All @@ -50,6 +53,7 @@ public class RetrofitProperties {

/**
* 全局转换器工厂,转换器实例优先从Spring容器获取,如果没有获取到,则反射创建。
* <p>
* global converter factories, The converter instance is first obtained from the Spring container. If it is not obtained, it is created by reflection.
*/
@SuppressWarnings("unchecked")
Expand All @@ -59,6 +63,7 @@ public class RetrofitProperties {

/**
* 全局调用适配器工厂,转换器实例优先从Spring容器获取,如果没有获取到,则反射创建。
* <p>
* global call adapter factories, The callAdapter instance is first obtained from the Spring container. If it is not obtained, it is created by reflection.
*/
@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import retrofit2.Retrofit;

/**
* 同步调用,如果返回的http状态码是是成功,返回responseBody 反序列化之后的对象。否则,抛出异常!异常信息中包含请求和响应相关信息。<br></>
* 同步调用,如果返回的http状态码是是成功,返回responseBody 反序列化之后的对象。否则,抛出异常!异常信息中包含请求和响应相关信息。
* <p>
* Synchronous call, if the returned http status code is successful, return the responseBody object after deserialization.
* Otherwise, throw an exception! The exception information includes request and response related information.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

/**
* 错误解码器。ErrorDecoder.
* <p>
* 当请求发生异常或者收到无效响应结果的时候,将HTTP相关信息解码到异常中,无效响应由业务自己判断
*
* <p>
* When an exception occurs in the request or an invalid response result is received, the HTTP related information is decoded into the exception,
* and the invalid response is determined by the business itself.
*
Expand All @@ -20,6 +21,7 @@ public interface ErrorDecoder {

/**
* 当无效响应的时候,将HTTP信息解码到异常中,无效响应由业务自行判断。
* <p>
* When the response is invalid, decode the HTTP information into the exception, invalid response is determined by business.
*
* @param request request
Expand All @@ -35,23 +37,25 @@ default RuntimeException invalidRespDecode(Request request, Response response) {

/**
* 当请求发生IO异常时,将HTTP信息解码到异常中。
* <p>
* When an IO exception occurs in the request, the HTTP information is decoded into the exception.
*
* @param request request
* @param cause IOException
* @return RuntimeException
* @return 解码后的异常
*/
default RuntimeException ioExceptionDecode(Request request, IOException cause) {
return RetrofitException.errorExecuting(request, cause);
}

/**
* 当请求发生除IO异常之外的其它异常时,将HTTP信息解码到异常中。
* <p>
* When the request has an exception other than the IO exception, the HTTP information is decoded into the exception.
*
* @param request request
* @param cause Exception
* @return RuntimeException
* @return 解码后的异常
*/
default RuntimeException exceptionDecode(Request request, Exception cause) {
return RetrofitException.errorUnknown(request, cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/**
* 组件内置CallAdapterFactory,标记接口。
*
* @author 陈添明
* @since 2022/9/12 8:08 下午
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
import retrofit2.Retrofit;

/**
* 同步调用执行,直接返回 #{@link Response} 对象。<br/>
* 同步调用执行,直接返回 #{@link Response} 对象。
* <p>
* Synchronous call execution, directly return #{@link Response} object
*
* @author 陈添明
Expand Down
Loading

0 comments on commit 8a74afa

Please sign in to comment.