1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| @Configuration @EnableSwagger2 public class SwaggerConfig {
@Bean public Docket gatewayDocket(){ return new Docket(DocumentationType.SWAGGER_2) .groupName("gateway") .apiInfo(createApiInfo("gateway","网关api")) .select() .paths(Predicates.and(PathSelectors.regex("/api/.**"))) .build(); }
@Bean public Docket memberDocket(){ return new Docket(DocumentationType.SWAGGER_2) .groupName("member") .apiInfo(createApiInfo("member","用户模块api")) .select() .paths(Predicates.and(PathSelectors.regex("/member/.**"))) .build(); }
@Bean public Docket videoDocket(){ return new Docket(DocumentationType.SWAGGER_2) .groupName("video") .apiInfo(createApiInfo("video","视频模块api")) .select() .paths(Predicates.and(PathSelectors.regex("/video/.**"))) .build(); }
private ApiInfo createApiInfo(String title,String description){ return new ApiInfoBuilder() .title(title) .description(description) .version("1.0") .contact(new Contact("kuang","http://www.bilibili,com","1400584782@qq.com")) .build(); } }
|