标签:ase agg script ret jar 添加 .com version htm
1. 添加jar包依赖
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.2.2</version> </dependency>
2. 配置文件放config文件夹下
@Configuration @EnableSwagger2 public class Swagger2 { @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.basePackage("com.zc")).paths(PathSelectors.any()).build(); } private ApiInfo apiInfo() { return new ApiInfoBuilder().title("SpringBoot 构建Swagger2 展示Restful-Api").description("描述信息").termsOfServiceUrl("http://www.baidu.com").contact("dzt").version("1.0").build(); } }
3.接口添加注释
。。。。未完待续。。。
4. 网址:localhost:8080/swagger-ui.html
标签:ase agg script ret jar 添加 .com version htm
原文地址:https://www.cnblogs.com/dztHome/p/10292921.html