Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
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
姚本章
dm_project
Commits
dde5c0eb
Commit
dde5c0eb
authored
Nov 26, 2020
by
DESKTOP-5KITOLR\Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swagger配置
parent
96dd9db7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
pom.xml
jz-dm-manage/pom.xml
+9
-0
SwaggerConfiguration.java
.../jz/manage/config/swaggerConfig/SwaggerConfiguration.java
+43
-0
pom.xml
pom.xml
+13
-0
No files found.
jz-dm-manage/pom.xml
View file @
dde5c0eb
...
...
@@ -116,6 +116,15 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- swagger2接口文档 -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
swagger-bootstrap-ui
</artifactId>
</dependency>
</dependencies>
...
...
jz-dm-manage/src/main/java/com/jz/manage/config/swaggerConfig/SwaggerConfiguration.java
0 → 100644
View file @
dde5c0eb
package
com
.
jz
.
manage
.
config
.
swaggerConfig
;
import
com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI
;
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
;
/**
* @ClassName: SwaggerConfiguration
* @Author Bellamy
* @Date 2020/11/26
*/
@Configuration
@EnableSwagger2
@EnableSwaggerBootstrapUI
public
class
SwaggerConfiguration
{
@Bean
public
Docket
createRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
select
()
.
apis
(
RequestHandlerSelectors
.
basePackage
(
"com.jz.manage.admin.controller"
))
.
paths
(
PathSelectors
.
any
())
.
build
();
}
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
.
title
(
"数据商城 RESTful APIs"
)
.
description
(
"swagger-bootstrap-ui"
)
.
termsOfServiceUrl
(
"http://localhost:5050/"
)
.
contact
(
"Bellamy"
)
.
version
(
"1.0"
)
.
build
();
}
}
pom.xml
View file @
dde5c0eb
...
...
@@ -43,6 +43,8 @@
<disconf.version>
2.6.35
</disconf.version>
<junit.version>
4.12
</junit.version>
<commons-lang3.version>
3.8.1
</commons-lang3.version>
<springfox-swagger2.version>
2.9.2
</springfox-swagger2.version>
<swagger-bootstrap-ui.version>
1.9.6
</swagger-bootstrap-ui.version>
</properties>
<dependencyManagement>
...
...
@@ -184,6 +186,17 @@
<artifactId>
commons-lang3
</artifactId>
<version>
${commons-lang3.version}
</version>
</dependency>
<!-- swagger2接口文档 -->
<dependency>
<groupId>
io.springfox
</groupId>
<artifactId>
springfox-swagger2
</artifactId>
<version>
${springfox-swagger2.version}
</version>
</dependency>
<dependency>
<groupId>
com.github.xiaoymin
</groupId>
<artifactId>
swagger-bootstrap-ui
</artifactId>
<version>
${swagger-bootstrap-ui.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
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