Skip to content

Commit

Permalink
增加发布中央仓库的地址
Browse files Browse the repository at this point in the history
  • Loading branch information
simonking-ws committed Mar 29, 2024
1 parent 4027a07 commit 5214a78
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 5 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ JDK1.8+,redis,springboot2.x,dubbo3.x
为了规范项目,很多项目已经要求全局配置一些公用的组件,例如异常捕获、参数校验、统一返回参数等。所以`webconfig`就是为了解决此类问题,封装好通用的参数并提供可插拔的配置,方便我们规范项目。

### webconfig-spring-boot-starter 特性
依赖:
```xml
<!-- https://central.sonatype.com/artifact/io.github.simonkingws/webconfig-spring-boot-starte -->
<dependency>
<groupId>io.github.simonkingws</groupId>
<artifactId>webconfig-spring-boot-starter</artifactId>
<version>${latest.version}</version>
</dependency>
```
* 统一接口返回。可配置自定义所需要的统一返回实体。
* 统一异常捕获。所有的异常统一处理,也可以自定义异常。并针对需要异常发送通知。
* 统一日期参数的处理。form表单类的日期统一处理,包括Date、LocalDateTime。
Expand All @@ -23,9 +32,27 @@ JDK1.8+,redis,springboot2.x,dubbo3.x
* 在线运维arthas。

### webconfig-dubbo3 特性
依赖:
```xml
<!-- https://central.sonatype.com/artifact/io.github.simonkingws/webconfig-dubbo3 -->
<dependency>
<groupId>io.github.simonkingws</groupId>
<artifactId>webconfig-dubbo3</artifactId>
<version>${latest.version}</version>
</dependency>
```
* duubo3下全局参数

### webconfig-feign 特性
依赖:
```xml
<!-- https://central.sonatype.com/artifact/io.github.simonkingws/webconfig-feign -->
<dependency>
<groupId>io.github.simonkingws</groupId>
<artifactId>webconfig-feign</artifactId>
<version>${latest.version}</version>
</dependency>
```
* feign调用下的全局参数
* Date参数传递时差问题统一处理

Expand Down
34 changes: 29 additions & 5 deletions doc/QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

### 1、webconfig-spring-boot-starter
#### 1.1 依赖引入
> 由于项目目前未发布到中央仓库,需要将项目打包到本地仓库,方能使用。未来考虑发布到中央仓库
```xml
<dependency>
<groupId>io.github.simonkingws</groupId>
<artifactId>webconfig-spring-boot-starter</artifactId>
<version>${latest.version}</version>
</dependency>
```
#### 1.2 接口统一返回
引入项目之后默认提供统一返回结果集:```com.simonkingws.webconfig.common.core.JsonResult```
```json
Expand Down Expand Up @@ -347,20 +353,35 @@ public class WebconfigProperies {

### 2、webconfig-dubbo3
主要通过dubbo3传递全局参数。
#### 2.1 dubbo扩展Filter
#### 2.1 引入依赖
```xml
<dependency>
<groupId>io.github.simonkingws</groupId>
<artifactId>webconfig-dubbo3</artifactId>
<version>${latest.version}</version>
</dependency>
```
#### 2.2 dubbo扩展Filter
Filter类:`com.simonkingws.webconfig.dubbo3.filter.DubboRpcFilter`
* 通过消费端将全局参数设置到Dubbo中
* 通过服务端记录链路信息
* 链路信息保存在Redis中,方面消费端获取全局链路

### 3、webconfig-feign

#### 3.1 全局参数拦截器
#### 3.1 引入依赖
```xml
<dependency>
<groupId>io.github.simonkingws</groupId>
<artifactId>webconfig-feign</artifactId>
<version>${latest.version}</version>
</dependency>
```
#### 3.2 全局参数拦截器
拦截器:`com.simonkingws.webconfig.feign.interceptor.FeignRequestInterceptor`
* 通过`feign.RequestTemplate``RequestHeader`参数和上下文参数`RequestContextLocal`交互
* 所有的数据都是放在请求头里面的

#### 3.2 日期参数传递的时差问题处理
#### 3.3 日期参数传递的时差问题处理
自定义Formatter,将日期转化成字符串`yyyy-MM-dd HH:mm:ss`,这和`1.4 统一日期的处理`对应,否则会出问题。

支持的日期类型:
Expand All @@ -374,6 +395,9 @@ Filter类:`com.simonkingws.webconfig.dubbo3.filter.DubboRpcFilter`


### 5、更新日志
### v1.1.0 @2024-03-29
* 发布分别startter、dubbo3、feign中央仓库版本的1.1.0版本

### v1.0.1 @2024-03-18
* [优化]`webconfig-trace-admin` 完整链路增加用户的信息以及索引
* [新增]`webconfig-spring-boot-starter` 增加`@PrintParams` 打印请求参数的注解
Expand Down

0 comments on commit 5214a78

Please sign in to comment.