@EnableSwagger2
@EnableKnife4j
@Configuration
@ConditionalOnProperty(name="apidoc.enabled",
havingValue="true",
matchIfMissing=false)
@EnableConfigurationProperties(value=SwaggerProperties.class)
public class Knife4jConfig
extends java.lang.Object
implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.web.servlet.config.annotation.WebMvcConfigurer
| 限定符和类型 | 字段和说明 |
|---|---|
(专用程序包) SwaggerProperties |
swaggerProperties |
| 构造器和说明 |
|---|
Knife4jConfig() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry) |
java.util.List<springfox.documentation.spring.web.plugins.Docket> |
createRestApi() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator@Autowired SwaggerProperties swaggerProperties
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
addResourceHandlers 在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurerpublic void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory 在接口中 org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansException@Bean @ConditionalOnMissingBean public java.util.List<springfox.documentation.spring.web.plugins.Docket> createRestApi()