
com.jxrisesun.framework.cloud.gateway.config.CloudGatewayAutoConfiguration Maven / Gradle / Ivy
package com.jxrisesun.framework.cloud.gateway.config;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import com.jxrisesun.framework.cloud.gateway.config.properties.CaptchaProperties;
import com.jxrisesun.framework.cloud.gateway.config.properties.IgnoreWhiteProperties;
import com.jxrisesun.framework.cloud.gateway.config.properties.XssProperties;
import com.jxrisesun.framework.cloud.gateway.filter.AuthFilter;
import com.jxrisesun.framework.cloud.gateway.filter.CacheRequestFilter;
import com.jxrisesun.framework.cloud.gateway.filter.ValidateCodeFilter;
import com.jxrisesun.framework.cloud.gateway.filter.XssFilter;
import com.jxrisesun.framework.cloud.gateway.handler.GatewayExceptionHandler;
import com.jxrisesun.framework.cloud.gateway.handler.SentinelFallbackHandler;
import com.jxrisesun.framework.cloud.gateway.handler.SwaggerHandler;
import com.jxrisesun.framework.cloud.gateway.handler.ValidateCodeHandler;
import com.jxrisesun.framework.cloud.gateway.route.CaptchaRouter;
import com.jxrisesun.framework.cloud.gateway.service.impl.ValidateCodeServiceImpl;
@Configuration
@Import({ CaptchaProperties.class, ValidateCodeServiceImpl.class, ValidateCodeHandler.class, ValidateCodeFilter.class,
CaptchaRouter.class, IgnoreWhiteProperties.class, AuthFilter.class, XssProperties.class, XssFilter.class,
SwaggerProvider.class, SwaggerHandler.class, CacheRequestFilter.class, GatewayExceptionHandler.class })
public class CloudGatewayAutoConfiguration {
@Bean
@ConditionalOnProperty(value = "spring.cloud.sentinel.enabled", havingValue = "true", matchIfMissing = true)
public SentinelConfig sentinelConfig() {
return new SentinelConfig();
}
@Bean
@ConditionalOnProperty(value = "spring.cloud.sentinel.enabled", havingValue = "true", matchIfMissing = true)
public SentinelFallbackHandler sentinelFallbackHandler() {
return new SentinelFallbackHandler();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy