package com.greenorange.promotion.annotation;

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

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

// 自定义校验注解
@Constraint(validatedBy = ProjectStatusEnumValidator.class)
@Target({ ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface ProjectStatusEnumValue {

    String message() default "项目状态错误"; // 错误信息
    Class<?>[] groups() default {}; // 组别
    Class<? extends Payload>[] payload() default {}; // 负载
    Class<? extends Enum<?>> enumClass(); // 枚举类类型

}
