1.定义注解AttrCheck
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 参数内容校验
*
* @author shengguimin
*/
@Target(value = { ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface AttrCheck {
int code();
String msg();
boolean isFile() default false;
int fileNum() default 1;
}
2.在对应的pojo中配置注解
public class Engineering extends