介绍
本篇文章给大家分享的是有关如何在SpringBoot中应用狂妄自大,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。
SpringBoot是什么
SpringBoot一种全新的编程规范,其设计目的是用来简化新弹簧应用的初始搭建以及开发过程,SpringBoot也是一个服务于框架的框架,服务范围是简化配置文件。
一、基本使用
使用时需要导入下面的依赖:
& lt; !——引入狂妄自大,自动生成api说明文档——比; ,,,,,,,& lt; dependency> ,,,,,,,,,,,& lt; groupId> io.springfox ,,,,,,,,,,,& lt; artifactId> springfox-swagger2 ,,,,,,,,,,,& lt; version> 2.9.2 ,,,,,,,& lt;/dependency> ,,,,,,,& lt; dependency> ,,,,,,,,,,,& lt; groupId> io.springfox ,,,,,,,,,,,& lt; artifactId> springfox-swagger-ui ,,,,,,,,,,,& lt; version> 2.9.2 ,,,,,,,& lt;/dependency>
然后书写下面的配置类即可完成配置!
@ configuration @EnableSwagger2 //开启swagger2 public class  SwaggerConfig { }
浏览器访问<代码> http://localhost: 8910/swagger-ui。>