feat(core): 新增 JSON 格式字符串校验器

This commit is contained in:
2025-04-29 22:51:42 +08:00
parent 5e9a3f3e93
commit cf5ef36af5
5 changed files with 109 additions and 5 deletions

View File

@@ -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());
}
// 执行目标方法