refactor(idempotent): 重构幂等模块并支持 Redisson 缓存

This commit is contained in:
2025-03-17 21:25:21 +08:00
parent b199b651ec
commit 27a71cf076
16 changed files with 308 additions and 498 deletions

View File

@@ -20,27 +20,39 @@ import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;
/**
* 定义幂等注解
* 幂等注解
*
* @version 1.0
* @Author loach
* @Date 2025-03-07 19:26
* @Package top.continew.starter.idempotent.annotation.Idempotent
* @author loach
* @author Charles7c
* @since 2.10.0
*/
@Documented
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Idempotent {
// 幂等key前缀
String prefix() default "idempotent:";
/**
* 名称
*/
String name() default "";
// key的过期时间
long timeout() default 0;
/**
* 键(支持 Spring EL 表达式)
*/
String key() default "";
// 时间单位
TimeUnit timeUnit() default TimeUnit.SECONDS;
/**
* 超时时间
*/
int timeout() default 1;
// 失败时的提示信息
/**
* 时间单位(默认:毫秒)
*/
TimeUnit unit() default TimeUnit.MILLISECONDS;
/**
* 提示信息
*/
String message() default "请勿重复操作";
}