spring boot2集成api文档工具swagger-ui(上)
说明 第一步:创建项目 浏览器打开: https://start.spring.io/,生成一个spring boot项目 点击Generate这个按钮,下载项目包文件 第二步:导入开发工具 打开下载目录,解压项目文件 启动idea,引入项目文件 第三步:引入swagger-ui包 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> 第四步:创建一个swagger 配置 @EnableSwagger2 @Configuration public class SwaggerConfig { @Bean public Docket api(){ return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis