防抖返回 请求频繁,请重试
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.sqx.common.aspect;
|
package com.sqx.common.aspect;
|
||||||
|
|
||||||
import com.sqx.common.annotation.Debounce;
|
import com.sqx.common.annotation.Debounce;
|
||||||
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.common.utils.SpelUtil;
|
import com.sqx.common.utils.SpelUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.aspectj.lang.ProceedingJoinPoint;
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
@@ -76,7 +77,7 @@ public class DebounceAspect {
|
|||||||
return joinPoint.proceed();
|
return joinPoint.proceed();
|
||||||
}
|
}
|
||||||
// 在防抖间隔内,不执行目标方法,直接返回
|
// 在防抖间隔内,不执行目标方法,直接返回
|
||||||
return null;
|
return Result.error("请求频繁,请重试");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object debounceForSpecificValue(ProceedingJoinPoint joinPoint, String methodSignature, long interval, TimeUnit timeUnit, Object targetValue) throws Throwable {
|
private Object debounceForSpecificValue(ProceedingJoinPoint joinPoint, String methodSignature, long interval, TimeUnit timeUnit, Object targetValue) throws Throwable {
|
||||||
@@ -89,7 +90,7 @@ public class DebounceAspect {
|
|||||||
return joinPoint.proceed();
|
return joinPoint.proceed();
|
||||||
}
|
}
|
||||||
// 在防抖间隔内,不执行目标方法,直接返回
|
// 在防抖间隔内,不执行目标方法,直接返回
|
||||||
return null;
|
return Result.error("请求频繁,请重试");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanExpiredRecords() {
|
public void cleanExpiredRecords() {
|
||||||
|
|||||||
Reference in New Issue
Block a user