mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-08 16:57:09 +08:00
feat(core): 新增 JSON 格式字符串校验器
This commit is contained in:
@@ -63,7 +63,8 @@ public class IdempotentAspect {
|
||||
public Object around(ProceedingJoinPoint joinPoint, Idempotent idempotent) throws Throwable {
|
||||
String cacheKey = this.getCacheKey(joinPoint, idempotent);
|
||||
// 如果键已存在,则抛出异常
|
||||
if (!RedisUtils.setIfAbsent(cacheKey,cacheKey, Duration.ofMillis(idempotent.unit().toMillis(idempotent.timeout())))) {
|
||||
if (!RedisUtils.setIfAbsent(cacheKey, cacheKey, Duration.ofMillis(idempotent.unit()
|
||||
.toMillis(idempotent.timeout())))) {
|
||||
throw new IdempotentException(idempotent.message());
|
||||
}
|
||||
// 执行目标方法
|
||||
|
Reference in New Issue
Block a user