package com.cf.imes.module.system.validation.products;

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 2025/8/11 14:18
 */
@Target({
        ElementType.FIELD,
})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = {DurationUnitValidator.class}
)
public @interface DurationUnitValid {
    String message() default "{product.duration.unit.invalid}";

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

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