package com.seer.teach.common.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 验证指定字段不能全部为空的注解
 */
@Target({ TYPE })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = NotAllNullValidator.class)
public @interface NotAllNull {

    /**
     * 需要验证的字段名列表
     */
    String[] value();

    String message() default "指定的字段不能全部为空";

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

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