!306 注释 @EnableCustomSwagger2 注解后,项目启动失败

Merge pull request !306 from Gelis/master
pull/310/MERGE
若依 2 years ago committed by Gitee
commit 55447c72e9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -26,8 +26,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration @Configuration
@EnableSwagger2 @EnableSwagger2
@EnableAutoConfiguration @EnableConfigurationProperties(SwaggerProperties.class)
@ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true) @ConditionalOnProperty(name = "swagger.enabled", matchIfMissing = true)
@Import({SwaggerBeanPostProcessor.class, SwaggerWebConfiguration.class})
public class SwaggerAutoConfiguration public class SwaggerAutoConfiguration
{ {
/** /**
@ -37,13 +38,6 @@ public class SwaggerAutoConfiguration
private static final String BASE_PATH = "/**"; private static final String BASE_PATH = "/**";
@Bean
@ConditionalOnMissingBean
public SwaggerProperties swaggerProperties()
{
return new SwaggerProperties();
}
@Bean @Bean
public Docket api(SwaggerProperties swaggerProperties) public Docket api(SwaggerProperties swaggerProperties)
{ {

@ -16,7 +16,6 @@ import java.util.stream.Collectors;
* *
* @author ruoyi * @author ruoyi
*/ */
@Component
public class SwaggerBeanPostProcessor implements BeanPostProcessor public class SwaggerBeanPostProcessor implements BeanPostProcessor
{ {
@Override @Override

@ -5,7 +5,6 @@ import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties("swagger") @ConfigurationProperties("swagger")
public class SwaggerProperties public class SwaggerProperties
{ {

@ -9,7 +9,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
* *
* @author ruoyi * @author ruoyi
*/ */
@Configuration
public class SwaggerWebConfiguration implements WebMvcConfigurer public class SwaggerWebConfiguration implements WebMvcConfigurer
{ {
@Override @Override

@ -1,3 +1,3 @@
com.ruoyi.common.swagger.config.SwaggerAutoConfiguration # com.ruoyi.common.swagger.config.SwaggerAutoConfiguration
com.ruoyi.common.swagger.config.SwaggerWebConfiguration # com.ruoyi.common.swagger.config.SwaggerWebConfiguration
com.ruoyi.common.swagger.config.SwaggerBeanPostProcessor # com.ruoyi.common.swagger.config.SwaggerBeanPostProcessor

Loading…
Cancel
Save