|
5 | 5 | import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; |
6 | 6 | import io.grpc.services.HealthStatusManager; |
7 | 7 | import lombok.extern.slf4j.Slf4j; |
8 | | -import org.lognet.springboot.grpc.GRpcGlobalInterceptor; |
9 | 8 | import org.lognet.springboot.grpc.GRpcServerBuilderConfigurer; |
10 | 9 | import org.lognet.springboot.grpc.GRpcServerRunner; |
11 | 10 | import org.lognet.springboot.grpc.GRpcService; |
12 | | -import org.lognet.springboot.grpc.validation.ValidatingInterceptor; |
13 | 11 | import org.springframework.beans.factory.BeanCreationException; |
14 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 13 | import org.springframework.beans.factory.annotation.Qualifier; |
16 | 14 | import org.springframework.boot.autoconfigure.AutoConfigureAfter; |
17 | 15 | import org.springframework.boot.autoconfigure.AutoConfigureOrder; |
18 | 16 | import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; |
19 | | -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
20 | 17 | import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
21 | 18 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
22 | 19 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
23 | 20 | import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration; |
24 | 21 | import org.springframework.boot.context.properties.ConfigurationPropertiesBinding; |
25 | 22 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
26 | 23 | import org.springframework.context.annotation.Bean; |
27 | | -import org.springframework.context.annotation.Lazy; |
| 24 | +import org.springframework.context.annotation.Import; |
28 | 25 | import org.springframework.core.convert.converter.Converter; |
29 | 26 | import org.springframework.util.SocketUtils; |
30 | 27 |
|
31 | | -import javax.validation.Validator; |
32 | 28 | import java.io.IOException; |
33 | 29 | import java.net.InetSocketAddress; |
34 | 30 | import java.util.Optional; |
|
43 | 39 | @AutoConfigureAfter(ValidationAutoConfiguration.class) |
44 | 40 | @ConditionalOnBean(annotation = GRpcService.class) |
45 | 41 | @EnableConfigurationProperties(GRpcServerProperties.class) |
| 42 | +@Import(GRpcValidationConfiguration.class) |
46 | 43 | @Slf4j |
47 | 44 | public class GRpcAutoConfiguration { |
48 | 45 |
|
@@ -177,13 +174,7 @@ public InetSocketAddress convert(String source) { |
177 | 174 | }; |
178 | 175 | } |
179 | 176 |
|
180 | | - @Bean |
181 | | - @ConditionalOnClass(Validator.class) |
182 | | - @ConditionalOnBean(Validator.class) |
183 | | - @GRpcGlobalInterceptor |
184 | | - public ValidatingInterceptor validatingInterceptor(@Lazy Validator validator){ |
185 | | - return new ValidatingInterceptor(validator); |
186 | | - } |
| 177 | + |
187 | 178 |
|
188 | 179 |
|
189 | 180 | } |
0 commit comments