Commit 477210a7 by 阳浪

SwaggerConfig

parent ea4f7342
package com.yizhi.live.application; package com.yizhi.live.application;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
...@@ -20,9 +21,11 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -20,9 +21,11 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwagger2 @EnableSwagger2
public class SwaggerConfig extends WebMvcConfigurerAdapter { public class SwaggerConfig extends WebMvcConfigurerAdapter {
@Value("${swagger.enabled}")
private boolean swaggerEnabled;
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2).enable(swaggerEnabled)
.groupName("后台直播管理端") .groupName("后台直播管理端")
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment