@Configuration @EnableSwagger2 @EnableSwaggerBootstrapUI @EnableConfigurationProperties(value=SwaggerProperties.class) @ConditionalOnProperty(prefix="yishuifengxiao.swagger", name="base-package") public class Swagger2AutoConfiguration extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Constructor and Description |
---|
Swagger2AutoConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
配置静态资源路径,防止出现访问swagger-ui界面时出现404
|
void |
addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry) |
void |
checkConfig()
配置检查
|
springfox.documentation.spring.web.plugins.Docket |
createRestApi()
swagger-ui配置
|
javax.servlet.Filter |
swaggerAuthFilter(SwaggerProperties swaggerProperties)
配置swagger文档访问权限认证
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addReturnValueHandlers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
addResourceHandlers
in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
public void addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
addViewControllers
in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Bean @ConditionalOnMissingClass public springfox.documentation.spring.web.plugins.Docket createRestApi()
@Bean public javax.servlet.Filter swaggerAuthFilter(SwaggerProperties swaggerProperties)
swaggerProperties
- swagger扩展支持属性配置@PostConstruct public void checkConfig()
Copyright © 2021. All rights reserved.