mirror of https://gitee.com/y_project/RuoYi.git
添加是否开启swagger配置
parent
83981138e0
commit
e91adcc28d
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.web.core.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import com.ruoyi.common.config.Global;
|
||||
|
@ -22,6 +23,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|||
@EnableSwagger2
|
||||
public class SwaggerConfig
|
||||
{
|
||||
/** 是否开启swagger */
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
*/
|
||||
|
@ -29,6 +34,8 @@ public class SwaggerConfig
|
|||
public Docket createRestApi()
|
||||
{
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
.apiInfo(apiInfo())
|
||||
// 设置哪些接口暴露给Swagger展示
|
||||
|
|
|
@ -128,3 +128,8 @@ xss:
|
|||
excludes: /system/notice/*
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
|
|
Loading…
Reference in New Issue