package com.cf.imes.framework.common.util.validation.statistics;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 统计维度单位入参校验注解
 *
 * @author Gqr
 * @since 2024/7/17 9:33
 */
@Target({
        ElementType.METHOD,
        ElementType.FIELD,
        ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR,
        ElementType.PARAMETER,
        ElementType.TYPE_USE
})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = {StatisticsUnitInEnumValidator.class}
)
public @interface StatisticsUnitInEnum {
    String message() default "{statistics.unit.invalid}";

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

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