使用

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