This commit is contained in:
2024-12-09 14:51:10 +08:00
parent 9696e6e9de
commit 318d252a32
7 changed files with 219 additions and 28 deletions

View File

@@ -0,0 +1,24 @@
package com.sqx.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
/**
* @author ww
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Debounce {
// 防抖时间间隔默认2秒
long interval() default 2000;
// 时间单位,默认毫秒
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
// 用于指定基于的入参表达式,为空时对整个方法防抖
// 格式为 #入参键.值 例如: #receive.id
// 多个参数 使用逗号进行拼接 例如: #receive.id,#receive.name
String value() default "";
}