A stater of SpringBoot Start,Resolve POST,PUT method resubmit,you can set ttl time and choose need to announce controller method.
the function need redis cache the request features,support RedisTemplate/Jedis/Redisson/CacheTemplate.
<dependency>
<groupId>com.github.acshmily</groupId>
<artifactId>resubmit-spring-boot-starter</artifactId>
<version>1.2</version>
</dependency>
implementation 'com.github.acshmily:resubmit-spring-boot-starter:1.2'
import resubmit-spring-boot-starter to your project
choose your project redis client match announce,and add your springboot application main class.
RedisClientType | EnableAnnounce |
---|---|
RedisTemplate | @EnableRedisTemplateReSubmit |
Jedis | @EnableJedisReSubmit |
Redisson | @EnableRedissonResubmit |
CacheTemplate | @EnableCacheTemplateResubmit |
Example project you can visit https://github.com/acshmily/resubmit-springboot-tester .
announce your controller
@RequestMapping("")
@RestController
public class IndexController {
@RequestMapping("")
@ReSubmit(tts = 60L)
public String hello(@RequestBody String s) {
return s;
}
}