package com.yifu.cloud.plus.v1.yifu.common.security.util.dict;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @Author fxj
 * @Date 2022/6/22
 * @Description 数据字典注解
 * @Version 1.0
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {DictValuesConstraintValidator.class})
public @interface DictValidator {
	/**
	 * return message
	 *
	 * @return
	 */
	String message() default "字典不匹配";

	/**
	 * a groups element that specifies the processing groups with which the constraint declaration is associated
	 */
	Class<?>[] groups() default {};

	/**
	 * specifies the payload with which the the constraint declaration is associated
	 */
	Class<? extends Payload>[] payload() default {};
	/**
	 * 注解传参
	 */
	String dictType() default "";

	/**
	 * 读取内容转表达式 (如: 0=男,1=女,2=未知)
	 */
	String readConverterExp() default "父子";
}
