♻️ Refactoring code.优化配置类

This commit is contained in:
lishangbu 2021-01-01 10:59:13 +08:00
parent 6ad2447333
commit a364c057f9
9 changed files with 10 additions and 10 deletions

View File

@ -40,7 +40,7 @@ import java.util.TimeZone;
* @author lishangbu * @author lishangbu
* @date 2020-06-17 * @date 2020-06-17
*/ */
@Configuration @Configuration(proxyBeanMethods = false)
@ConditionalOnClass(ObjectMapper.class) @ConditionalOnClass(ObjectMapper.class)
@AutoConfigureBefore(JacksonAutoConfiguration.class) @AutoConfigureBefore(JacksonAutoConfiguration.class)
public class JacksonConfiguration { public class JacksonConfiguration {

View File

@ -32,7 +32,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
* @date 2019/2/1 Redis 配置类 * @date 2019/2/1 Redis 配置类
*/ */
@EnableCaching @EnableCaching
@Configuration @Configuration(proxyBeanMethods = false)
@RequiredArgsConstructor @RequiredArgsConstructor
@AutoConfigureBefore(RedisAutoConfiguration.class) @AutoConfigureBefore(RedisAutoConfiguration.class)
public class RedisTemplateConfiguration { public class RedisTemplateConfiguration {

View File

@ -24,7 +24,7 @@ import org.springframework.web.client.RestTemplate;
* @author lengleng * @author lengleng
* @date 2019/2/1 RestTemplate * @date 2019/2/1 RestTemplate
*/ */
@Configuration @Configuration(proxyBeanMethods = false)
public class RestTemplateConfiguration { public class RestTemplateConfiguration {
@Bean @Bean

View File

@ -33,7 +33,7 @@ import static org.springframework.boot.autoconfigure.condition.ConditionalOnWebA
* <p> * <p>
* 注入自自定义SQL 过滤 * 注入自自定义SQL 过滤
*/ */
@Configuration @Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = SERVLET) @ConditionalOnWebApplication(type = SERVLET)
public class WebMvcConfiguration implements WebMvcConfigurer { public class WebMvcConfiguration implements WebMvcConfigurer {

View File

@ -17,7 +17,7 @@ import java.util.stream.Collectors;
* @author lishangbu * @author lishangbu
* @date 2020/9/14 * @date 2020/9/14
*/ */
@Configuration @Configuration(proxyBeanMethods = false)
@EnableAutoConfiguration @EnableAutoConfiguration
@ComponentScan("com.pig4cloud.pig.common.job.properties") @ComponentScan("com.pig4cloud.pig.common.job.properties")
public class XxlJobAutoConfiguration { public class XxlJobAutoConfiguration {

View File

@ -46,7 +46,7 @@ import java.util.regex.Pattern;
* 资源服务器对外直接暴露URL,如果设置contex-path 要特殊处理 * 资源服务器对外直接暴露URL,如果设置contex-path 要特殊处理
*/ */
@Slf4j @Slf4j
@Configuration @Configuration(proxyBeanMethods = false)
@ConfigurationProperties(prefix = "security.oauth2.ignore") @ConfigurationProperties(prefix = "security.oauth2.ignore")
public class PermitAllUrlProperties implements InitializingBean, ApplicationContextAware { public class PermitAllUrlProperties implements InitializingBean, ApplicationContextAware {

View File

@ -28,7 +28,7 @@ import org.springframework.security.oauth2.client.resource.OAuth2ProtectedResour
* @author lengleng * @author lengleng
* @date 2019/2/1 feign 拦截器传递 header 中oauth token 使用hystrix 的信号量模式 * @date 2019/2/1 feign 拦截器传递 header 中oauth token 使用hystrix 的信号量模式
*/ */
@Configuration @Configuration(proxyBeanMethods = false)
@ConditionalOnProperty("security.oauth2.client.client-id") @ConditionalOnProperty("security.oauth2.client.client-id")
public class PigFeignClientConfiguration { public class PigFeignClientConfiguration {

View File

@ -33,7 +33,7 @@ import org.springframework.web.reactive.function.server.RouterFunctions;
* @date 2020-06-11 * @date 2020-06-11
*/ */
@Slf4j @Slf4j
@Configuration @Configuration(proxyBeanMethods = false)
@RequiredArgsConstructor @RequiredArgsConstructor
public class RouterFunctionConfiguration { public class RouterFunctionConfiguration {

View File

@ -22,11 +22,11 @@ import com.pig4cloud.pig.common.core.util.R;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler; import org.springframework.boot.web.reactive.error.ErrorWebExceptionHandler;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.core.io.buffer.DataBufferFactory; import org.springframework.core.io.buffer.DataBufferFactory;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.http.server.reactive.ServerHttpResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ResponseStatusException; import org.springframework.web.server.ResponseStatusException;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.handler.ResponseStatusExceptionHandler; import org.springframework.web.server.handler.ResponseStatusExceptionHandler;
@ -40,7 +40,7 @@ import reactor.core.publisher.Mono;
*/ */
@Slf4j @Slf4j
@Order(-1) @Order(-1)
@Configuration @Component
@RequiredArgsConstructor @RequiredArgsConstructor
public class GlobalExceptionHandler implements ErrorWebExceptionHandler { public class GlobalExceptionHandler implements ErrorWebExceptionHandler {