| package com.xzx.gc.common.annotations.valid;  | 
|   | 
| import javax.validation.Constraint;  | 
| import javax.validation.Payload;  | 
| import java.lang.annotation.ElementType;  | 
| import java.lang.annotation.Retention;  | 
| import java.lang.annotation.RetentionPolicy;  | 
| import java.lang.annotation.Target;  | 
|   | 
| /**  | 
|  * @description: 字符串不能为空的扩展  | 
|  * @author: zan.zhong  | 
|  **/  | 
|   | 
| @Target({ElementType.METHOD, ElementType.FIELD,ElementType.PARAMETER})  | 
| @Retention(RetentionPolicy.RUNTIME)  | 
| @Constraint(validatedBy = DateFormatConstraintValidator.class)  | 
| public @interface DateFormatConstraint {  | 
|     String message() default "时间格式不正确";  | 
|   | 
|     String datePattern() default "yyyy-MM-dd HH:mm";  | 
|   | 
|     Class<?>[] groups() default {};  | 
|   | 
|     Class<? extends Payload>[] payload() default {};  | 
| }  |