Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JeeSpringCloud
Commits
b3d52ed1
Commit
b3d52ed1
authored
Oct 24, 2018
by
HuangBingGui
Browse files
no commit message
parent
8a56c1ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
JeeSpringCloud/src/main/java/com/jeespring/common/swagger/Swagger.java
View file @
b3d52ed1
...
@@ -21,17 +21,21 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
...
@@ -21,17 +21,21 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@Configuration
@EnableSwagger2
@EnableSwagger2
public
class
Swagger
{
public
class
Swagger
{
@Bean
public
Docket
createRestApi
()
{
@Bean
(
"JeeSpring云接口"
)
public
Docket
createJeeSpringRestApi
()
{
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
return
new
Docket
(
DocumentationType
.
SWAGGER_2
)
.
apiInfo
(
apiInfo
())
.
groupName
(
"JeeSpring云接口"
)
.
select
()
.
apiInfo
(
apiInfo
())
//.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //这里采用包含注解的方式来确定要显示的接口
.
select
()
//.apis(RequestHandlerSelectors.basePackage("com.jeespring.modules")) //这里采用包扫描的方式来确定要显示的接口
.
apis
(
RequestHandlerSelectors
.
withMethodAnnotation
(
ApiOperation
.
class
))
//这里采用包含注解的方式来确定要显示的接口
.
apis
(
RequestHandlerSelectors
.
withClassAnnotation
(
Api
.
class
))
//.apis(RequestHandlerSelectors.basePackage("com.jeespring.modules")) //这里采用包扫描的方式来确定要显示的接口
.
paths
(
PathSelectors
.
any
())
//.apis(RequestHandlerSelectors.withClassAnnotation(Api.class))
.
build
();
//.paths(PathSelectors.regex("/rest/.*"))
//.paths(PathSelectors.any())
.
build
();
}
}
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"Swagger2构建RESTful APIs"
)
.
title
(
"Swagger2构建RESTful APIs"
)
...
...
Write
Preview
Supports
Markdown
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