♻️ 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
* @date 2020-06-17
*/
@Configuration
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(ObjectMapper.class)
@AutoConfigureBefore(JacksonAutoConfiguration.class)
public class JacksonConfiguration {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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