commit
55447c72e9
|
@ -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…
Reference in New Issue