使用
- 引入依赖
<dependency><groupId>com.litong.boot</groupId><artifactId>idempotent-spring-boot-starter</artifactId><version>1.0-SNAPSHOT</version></dependency>
- 配置 redis 链接相关信息
spring:redis:host: 127.0.0.1port: 6379
- 配置 redis 链接相关信息
- 接口设置注解
@Idempotent(key = "#demo.username", expireTime = 3, info = "请勿重复查询")@GetMapping("/test")public String test(Demo demo) {return "success";}
