fix: 修改swagger只在开发环境中启用,在生产幻境中关闭

This commit is contained in:
weihongyang 2022-06-21 14:47:27 +08:00
parent 0218a7548a
commit 111473f057

View File

@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
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.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.builders.RequestHandlerSelectors;
@ -26,6 +27,7 @@ import static com.google.common.collect.Lists.newArrayList;
*/ */
@Configuration @Configuration
@EnableOpenApi @EnableOpenApi
@Profile("dev")
public class SwaggerConfig { public class SwaggerConfig {
/** /**