|  |  | 
 |  |  | import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j; | 
 |  |  | import com.google.common.base.Function; | 
 |  |  | import com.google.common.base.Optional; | 
 |  |  | import lombok.AllArgsConstructor; | 
 |  |  | import org.springframework.beans.factory.annotation.Value; | 
 |  |  | import org.springframework.context.annotation.Bean; | 
 |  |  | import org.springframework.context.annotation.Configuration; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Value("${swagger.host:}") | 
 |  |  |     private String host; | 
 |  |  |     @Value("${swagger.enabled:}") | 
 |  |  |     private Boolean enabled; | 
 |  |  |  | 
 |  |  |     @Value("${swagger.title:接口文档}") | 
 |  |  |     private String title; | 
 |  |  | 
 |  |  |                 .version(version) | 
 |  |  |                 .build(); | 
 |  |  |     } | 
 |  |  |     @Bean | 
 |  |  |  /*   @Bean | 
 |  |  |     public Docket getDocket() { | 
 |  |  |         return new Docket(DocumentationType.SWAGGER_2) | 
 |  |  |                 .apiInfo(this.getApiInfo()).groupName("【系统管理接口API】") | 
 |  |  | 
 |  |  | //                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) | 
 |  |  |                 .paths(PathSelectors.any()) | 
 |  |  |                 .build(); | 
 |  |  |     } | 
 |  |  |     }*/ | 
 |  |  |     @Bean | 
 |  |  |     public Docket getDocket2() { | 
 |  |  |         return new Docket(DocumentationType.SWAGGER_2) | 
 |  |  |                 .apiInfo(this.getApiInfo()).groupName("【业务管理接口API】") | 
 |  |  |                 .apiInfo(this.getApiInfo()).groupName("default") | 
 |  |  |                 .host(host) | 
 |  |  |                 .enable(enabled) | 
 |  |  |                 .select() | 
 |  |  |                 .apis( basePackage("com.doumee.api.system;com.doumee.api.business;")) | 
 |  |  |                 .apis( basePackage("com.doumee.cloud;com.doumee.api.common")) | 
 |  |  |                 // 设置需要被扫描的类,这里设置为添加了@Api注解的类 | 
 |  |  | //                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) | 
 |  |  |                 .paths(PathSelectors.any()) | 
 |  |  |                 .build(); | 
 |  |  |     } | 
 |  |  | /* | 
 |  |  |     @Bean | 
 |  |  |     public Docket getDocket2() { | 
 |  |  |         return new Docket(DocumentationType.SWAGGER_2) | 
 |  |  |                 .apiInfo(this.getApiInfo()).groupName("default") | 
 |  |  |                 .host(host) | 
 |  |  |                 .select() | 
 |  |  |                 .apis( basePackage("com.doumee.api.system;com.doumee.api.business;com.doumee.api.common")) | 
 |  |  |                 // 设置需要被扫描的类,这里设置为添加了@Api注解的类 | 
 |  |  | //                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) | 
 |  |  |                 .paths(PathSelectors.any()) | 
 |  |  |                 .build(); | 
 |  |  |     } | 
 |  |  | */ | 
 |  |  |    /* @Bean | 
 |  |  |     public Docket getDocket1() { | 
 |  |  |         return new Docket(DocumentationType.SWAGGER_2) | 
 |  |  |             .apiInfo(this.getApiInfo()).groupName("【公共接口API】") | 
 |  |  | 
 |  |  | //                .apis(RequestHandlerSelectors.withClassAnnotation(Api.class)) | 
 |  |  |             .paths(PathSelectors.any()) | 
 |  |  |             .build(); | 
 |  |  |     } | 
 |  |  |     }*/ | 
 |  |  |     /** | 
 |  |  |      * 重写basePackage方法,使能够实现多包访问,复制贴上去 | 
 |  |  |      * @author  teavamc |