Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
2d93e7ae
Commit
2d93e7ae
authored
Apr 29, 2020
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swagger添加enable参数控制是否启用
parent
1a079532
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
ruoyi/sql/ry_20200415.sql
ruoyi/sql/ry_20200415.sql
+1
-1
ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
...c/main/java/com/ruoyi/framework/config/SwaggerConfig.java
+7
-0
ruoyi/src/main/resources/application.yml
ruoyi/src/main/resources/application.yml
+4
-0
No files found.
ruoyi/sql/ry_20200415.sql
View file @
2d93e7ae
...
...
@@ -138,7 +138,7 @@ create table sys_menu (
is_frame
int
(
1
)
default
1
comment
'是否为外链(0是 1否)'
,
menu_type
char
(
1
)
default
''
comment
'菜单类型(M目录 C菜单 F按钮)'
,
visible
char
(
1
)
default
0
comment
'菜单状态(0显示 1隐藏)'
,
status
char
(
1
)
not
null
comment
'菜单状态(0正常 1停用)'
,
status
char
(
1
)
default
0
comment
'菜单状态(0正常 1停用)'
,
perms
varchar
(
100
)
default
null
comment
'权限标识'
,
icon
varchar
(
100
)
default
'#'
comment
'菜单图标'
,
create_by
varchar
(
64
)
default
''
comment
'创建者'
,
...
...
ruoyi/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
View file @
2d93e7ae
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.framework.config;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -32,6 +33,10 @@ public class SwaggerConfig
@Autowired
private
RuoYiConfig
ruoyiConfig
;
/** Swagger开关配置 */
@Value
(
"${swagger.enable}"
)
private
boolean
swaggerEnable
;
/**
* 创建API
*/
...
...
@@ -39,6 +44,8 @@ public class SwaggerConfig
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
// 是否启用Swagger
.
enable
(
swaggerEnable
)
.
pathMapping
(
"/dev-api"
)
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
.
apiInfo
(
apiInfo
())
...
...
ruoyi/src/main/resources/application.yml
View file @
2d93e7ae
...
...
@@ -100,6 +100,10 @@ pagehelper:
supportMethodsArguments
:
true
params
:
count=countSql
# Swagger配置
swagger
:
enable
:
true
# 防止XSS攻击
xss
:
# 过滤开关
...
...
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