README.md
为简化开发工作、提高生产率、解决常见问题而生
分支
- main
- 支持 JDK 8、11
- next
- 支持 JDK 17
Spring Boot Starter 项目
其他发布
更新日志
代码格式规范 spring-javaformat
-
项目添加 io.spring.javaformat:spring-javaformat-maven-plugin 依赖之后,可安装自动格式化插件(无需运行下列命令):spring-javaformat-intellij-idea-plugin
./mvnw spring-javaformat:apply
或
mvn spring-javaformat:apply
功能说明
- 支持一键代码开启全局幂等配置(
cn.com.xuxiaowei.boot.idempotent.annotation.EnableIdempotent
) - 支持一键开启多次获取请求流(
xxw.idempotent.input-stream-filter: true
) - 支持自定义全局接口幂等放入Redis中的key值前缀(
xxw.idempotent.prefix
) - 支持自定义全局接口幂等调用
记录
放入Redis中的key值前缀(xxw.idempotent.record
) - 支持自定义全局接口幂等调用
结果
放入Redis中的key值前缀(xxw.idempotent.result
) - 支持自定义接口幂等放入Redis中的key值(
cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#key()
) - 支持自定义接口幂等Token从header中获取(第一优先级
cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#header()
) - 支持自定义接口幂等Token从param中获取(第二优先级
cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#param()
) - 支持自定义接口幂等Token从stream中获取(第三优先级
cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#stream()
,需要开启多次获取请求流配置) - 支持自定义接口幂等Token名称
- 支持自定义幂等过期时间(
cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#expireTime()
) - 支持自定义幂等过期时间单位(
cn.com.xuxiaowei.boot.idempotent.annotation.Idempotent#expireUnit()
) - 支持自定义接口超时时直接响应空结果(响应header中响应调用记录)与自定义响应结果
- 支持严格模式(未找到Token时抛出异常,使用
@org.springframework.web.bind.annotation.ControllerAdvice
统一拦截异常进行处理) - 支持将调用记录放入响应header中
使用示例
<!-- https://search.maven.org/artifact/cn.com.xuxiaowei.boot/spring-boot-starter-idempotent -->
<!-- https://mvnrepository.com/artifact/cn.com.xuxiaowei.boot/spring-boot-starter-idempotent -->
<dependency>
<groupId>cn.com.xuxiaowei.boot</groupId>
<artifactId>spring-boot-starter-idempotent</artifactId>
<version>最新版</version>
</dependency>
- 由于各大 maven 仓库(如:阿里云)非实时同步,推荐在项目
pom.xml
中添加下列仓库
<repositories>
<repository>
<id>releases</id>
<url>https://s01.oss.sonatype.org/content/repositories/releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
依赖
-
spring-boot-starter-aop
-
spring-boot-starter-data-redis
-
spring-boot-starter-web
-
spring-boot-configuration-processor
-
lombok
批量添加远端仓库地址
点击展开
git remote add gitee https://gitee.com/xuxiaowei-com-cn/spring-boot-starter-idempotent.gitgit remote add gitlab https://gitlab.com/xuxiaowei-com-cn/spring-boot-starter-idempotent.git
git remote add framagit https://framagit.org/xuxiaowei-com-cn/spring-boot-starter-idempotent.git
git remote add github https://github.com/xuxiaowei-com-cn/spring-boot-starter-idempotent.git
git remote add gitcode https://gitcode.net/xuxiaowei-com-cn/spring-boot-starter-idempotent.git
git remote add gitlink https://gitlink.org.cn/xuxiaowei-com-cn/spring-boot-starter-idempotent.git