package com.ema.common.validate;



import com.ema.common.validate.valid.SensitiveValidate;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 敏感词校验注解
 *
 * @author LJ
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.FIELD})
@Constraint(validatedBy = SensitiveValidate.class)
public @interface Sensitive {

    String message() default "包含敏感词";

    /**
     * 是否必填
     *
     * @return
     */
    boolean required() default true;

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

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