package com.fzm.mall.server.admin.annotation;

import com.fzm.mall.server.admin.config.MyConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author wangp
 * @date 2021/3/8 10:40
 * @description 判断类型参数是否是定义的
 * @since JDK 1.8
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {MyConstraintValidator.class})//引入自定义验证规则文件
public @interface CustomType {

    //自定义属性 传入类型参数值
    int pType();

    String message();

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
