2021-07-30 19:10:54 +08:00
|
|
|
|
package com.ruoyi.common.annotation;
|
|
|
|
|
|
2021-10-22 10:04:15 +08:00
|
|
|
|
import java.lang.annotation.*;
|
2021-07-30 19:10:54 +08:00
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 自定义注解防止表单重复提交
|
|
|
|
|
*
|
|
|
|
|
* @author Lion Li
|
|
|
|
|
*/
|
|
|
|
|
@Inherited
|
|
|
|
|
@Target(ElementType.METHOD)
|
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
|
@Documented
|
|
|
|
|
public @interface RepeatSubmit {
|
|
|
|
|
|
2021-10-22 10:04:15 +08:00
|
|
|
|
/**
|
|
|
|
|
* 间隔时间(ms),小于此时间视为重复提交
|
|
|
|
|
*/
|
|
|
|
|
int interval() default 5000;
|
2021-07-30 19:10:54 +08:00
|
|
|
|
|
2021-10-22 10:04:15 +08:00
|
|
|
|
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
|
2021-07-30 19:10:54 +08:00
|
|
|
|
|
2021-09-22 10:09:15 +08:00
|
|
|
|
/**
|
|
|
|
|
* 提示消息
|
|
|
|
|
*/
|
|
|
|
|
String message() default "不允许重复提交,请稍后再试";
|
|
|
|
|
|
2021-07-30 19:10:54 +08:00
|
|
|
|
}
|