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
6e0e87bf
Commit
6e0e87bf
authored
Jul 03, 2023
by
ljb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加Swagger配置
parent
7af1f5eb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
model-server/pom.xml
+1
-0
model-server/src/main/java/com.zq.model/Swagger.java
+63
-0
No files found.
model-server/pom.xml
View file @
6e0e87bf
...
...
@@ -108,6 +108,7 @@
<scope>
compile
</scope>
</dependency>
<!--若此依赖下载失败则手动安装到本地仓库mvn install:install-file -Dfile=D:\nnjcy-data-model\model-server\src\main\resources\lib\aspose-words-19.5.jar -DgroupId=com.aspose -DartifactId=aspose-words -Dversion=19.5 -Dpackaging=jar-->
<dependency>
<groupId>
com.aspose
</groupId>
<artifactId>
aspose-words
</artifactId>
...
...
model-server/src/main/java/com.zq.model/Swagger.java
0 → 100644
View file @
6e0e87bf
package
com
.
zq
.
model
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
import
springfox.documentation.service.ApiInfo
;
import
springfox.documentation.spi.DocumentationType
;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
/**
* @author bici
*/
@Configuration
@EnableSwagger2
public
class
Swagger
{
@Value
(
"${spring.cloud.config.profile:product}"
)
private
String
profile
;
@Bean
public
Docket
api
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"可视化平台1"
)
.
enable
(!
"product"
.
equals
(
profile
))
//生产环境关闭
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.zq.instrument.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
()
.
apiInfo
(
apiInfo
());
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"可视化平台2"
)
.
description
(
"可视化平台3"
)
.
build
();
}
@Bean
public
Docket
app
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
groupName
(
"可视化平台4"
)
.
enable
(!
"prod"
.
equals
(
profile
))
//生产环境关闭
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.zq.instrument.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
()
.
apiInfo
(
appInfo
());
}
private
ApiInfo
appInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"可视化平台5"
)
.
description
(
"可视化平台6"
)
.
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