Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nnjcy-data-model
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljb
nnjcy-data-model
Commits
58882d32
Commit
58882d32
authored
Jul 06, 2023
by
ljb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决swagger不生效
parent
b089d7e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
dataoperation-server/src/main/java/com/zq/dataoperation/Swagger.java
+3
-6
No files found.
dataoperation-server/src/main/java/com/zq/dataoperation/
config/
Swagger.java
→
dataoperation-server/src/main/java/com/zq/dataoperation/Swagger.java
View file @
58882d32
package
com
.
zq
.
dataoperation
.
config
;
package
com
.
zq
.
dataoperation
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -13,7 +13,6 @@ import springfox.documentation.spring.web.plugins.Docket;
...
@@ -13,7 +13,6 @@ import springfox.documentation.spring.web.plugins.Docket;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
@Profile
(
"dev"
)
@Configuration
@Configuration
@EnableSwagger2
@EnableSwagger2
public
class
Swagger
{
public
class
Swagger
{
...
@@ -25,7 +24,7 @@ public class Swagger {
...
@@ -25,7 +24,7 @@ public class Swagger {
public
Docket
api
()
{
public
Docket
api
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"admin"
)
.
groupName
(
"admin"
)
// .enable(!"product
".equals(profile)) //生产环境关闭
.
enable
(!
"prod
"
.
equals
(
profile
))
//生产环境关闭
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.zq.dataoperation.controller"
))
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.zq.dataoperation.controller"
))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
...
@@ -44,7 +43,7 @@ public class Swagger {
...
@@ -44,7 +43,7 @@ public class Swagger {
public
Docket
app
()
{
public
Docket
app
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"app"
)
.
groupName
(
"app"
)
.
enable
(!
"prod
uct
"
.
equals
(
profile
))
//生产环境关闭
.
enable
(!
"prod"
.
equals
(
profile
))
//生产环境关闭
.
select
()
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.zq.dataoperation.controller.api"
))
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.zq.dataoperation.controller.api"
))
.
paths
(
PathSelectors
.
any
())
.
paths
(
PathSelectors
.
any
())
...
@@ -58,5 +57,4 @@ public class Swagger {
...
@@ -58,5 +57,4 @@ public class Swagger {
.
description
(
"查看接口文档"
)
.
description
(
"查看接口文档"
)
.
build
();
.
build
();
}
}
}
}
\ No newline at end of file
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