springboot - swagger 集成 (Maven项目)超简单

  • 引入pom,xml包
        
            io.springfox
            springfox-swagger2
            2.9.2
        
        
		
		    io.springfox
		    springfox-swagger-ui
		    2.9.2
		

  • 在启动程序写上注解
@SpringBootApplication
@EnableSwagger2    //写上注解
public class BookShopAdminApplication {

    public static void main(String [] args){
        SpringApplication.run(BookShopAdminApplication.class,args);
    }

}

  • 最后启动程序
  • 访问 http://localhost:8060/项目名/swagger-ui.html 跳转到这个页面产生下面页面就行了,关于其他的详情配置可以参考swagger 文档

springboot - swagger 集成 (Maven项目)超简单_第1张图片

你可能感兴趣的:(springboot - swagger 集成 (Maven项目)超简单)