|
@@ -1,33 +0,0 @@
|
|
|
-package com.platform.common.validation.config;
|
|
|
-
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
-import org.hibernate.validator.HibernateValidator;
|
|
|
-import org.springframework.cache.annotation.EnableCaching;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
-import org.springframework.context.annotation.Configuration;
|
|
|
-
|
|
|
-import javax.validation.Validation;
|
|
|
-import javax.validation.Validator;
|
|
|
-import javax.validation.ValidatorFactory;
|
|
|
-
|
|
|
-/**
|
|
|
- * @Description Redis 配置类
|
|
|
- * @Author chenyuehu
|
|
|
- * @Date 2019/5/7
|
|
|
- * @Version Copyright (c) 2019,北京乾元坤和科技有限公司 All rights reserved.
|
|
|
- */
|
|
|
-@EnableCaching
|
|
|
-@Configuration
|
|
|
-@AllArgsConstructor
|
|
|
-public class ValidatorConfig {
|
|
|
-
|
|
|
- @Bean
|
|
|
- public Validator validator() {
|
|
|
- ValidatorFactory validatorFactory = Validation.byProvider(HibernateValidator.class)
|
|
|
- .configure()
|
|
|
- .addProperty("hibernate.validator.fail_fast", "true")
|
|
|
- .buildValidatorFactory();
|
|
|
- return validatorFactory.getValidator();
|
|
|
- }
|
|
|
-
|
|
|
-}
|