package com.doumee.api.Repeat; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; // @Target 表示该注解用于什么地方 // ElementType.CONSTRUCTOR 用在构造器 // ElementType.FIELD 用于描述域-属性上 // ElementType.METHOD 用在方法上 // ElementType.TYPE 用在类或接口上 // ElementType.PACKAGE 用于描述包 @Target({ElementType.ANNOTATION_TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE}) //@Retention 表示在什么级别保存该注解信息 // RetentionPolicy.SOURCE 保留到源码上 // RetentionPolicy.CLASS 保留到字节码上 // RetentionPolicy.RUNTIME 保留到虚拟机运行时(最多,可通过反射获取) @Retention(RetentionPolicy.RUNTIME) public @interface RepeatSubmit { /** * 默认的间隔时间(ms),小于此时间视为重复提交 */ int timeout() default 2000; }