Open chengfengjie opened 6 years ago
/// swagger 版本号2.6.1
<properties>
<swagger2.version>2.6.1</swagger2.version>
</properties>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger2.version}</version>
</dependency>
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket testApi() {
return new Docket(DocumentationType.SWAGGER_2)
.host(SpringUtil.managerHostPublic())
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("huijinhang.hms.controller"))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("swagger 标题")
.version("版本")
.build();
}
}
项目基本目录结构