Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yaru
fgqyxxlr
Commits
e91adcc2
Commit
e91adcc2
authored
Jun 08, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加是否开启swagger配置
parent
83981138
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
+7
-0
ruoyi-admin/src/main/resources/application.yml
+5
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/core/config/SwaggerConfig.java
View file @
e91adcc2
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展示
...
...
ruoyi-admin/src/main/resources/application.yml
View file @
e91adcc2
...
...
@@ -128,3 +128,8 @@ xss:
excludes
:
/system/notice/*
# 匹配链接
urlPatterns
:
/system/*,/monitor/*,/tool/*
# Swagger配置
swagger
:
# 是否开启swagger
enabled
:
true
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment