update 重写 防重提交拦截器 支持全局与注解自定义 拦截时间配置配置 优化逻辑

This commit is contained in:
疯狂的狮子li
2021-07-30 19:10:54 +08:00
parent 39783f2b19
commit c65acd6a28
4 changed files with 136 additions and 149 deletions

View File

@ -1,23 +1,29 @@
package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 自定义注解防止表单重复提交
*
* @author ruoyi
*
*/
@Inherited
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit
{
}
package com.ruoyi.common.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
/**
* 自定义注解防止表单重复提交
*
* @author Lion Li
*/
@Inherited
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit {
/**
* 默认使用全局配置
*/
int intervalTime() default 0;
TimeUnit timeUnit() default TimeUnit.MILLISECONDS;
}