mirror of https://gitee.com/maxjhandsome/pig
♻️ Refactoring code.优化配置类
This commit is contained in:
parent
6ad2447333
commit
a364c057f9
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue