swagger小使用
swagger默认访问地址 一般为:项目地址+项目端口+/swagger-ui.html sawgger在springboot中如何使用 引入maven依赖 < dependency > < groupId > io . springfox < / groupId > < artifactId > springfox - swagger2 < / artifactId > < / dependency > < dependency > < groupId > io . springfox < / groupId > < artifactId > springfox - swagger - ui < / artifactId > < / dependency > 创建一个SwaggerConfig类 @Configuration @EnableSwagger2 @ComponentScan ( "org.demo.energy.sys.controller" ) public class SwaggerConfig { @Bean public Docket createRestApi ( ) { return new Docket ( DocumentationType . SWAGGER_2 ) . apiInfo ( apiInfo ( ) ) . select ( ) .