Commit b3d52ed1 authored by HuangBingGui's avatar HuangBingGui
Browse files

no commit message

parent 8a56c1ad
...@@ -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")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment