package com.greenorange.promotion.annotation;

import com.greenorange.promotion.model.enums.FileUploadBizEnum;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

// 枚举校验器
public class FileEnumValidator implements ConstraintValidator<FileEnumValue, String> {


    @Override
    public void initialize(FileEnumValue constraintAnnotation) {

    }

    @Override
    public boolean isValid(String value, ConstraintValidatorContext context) {
        return FileUploadBizEnum.getEnumByValue(value) != null;
    }
}
