随笔分类 - Swagger
前后端API
摘要:1. swagger分组(只需要创建几个Docket类型的方法即可) package com.Google.config; import org.springframework.context.annotation.Bean; import org.springframework.context.a
阅读全文
摘要:Swagger只有一个实现类 (Docket) @Bean public Docket docket(Environment environment){ //设置要显示的swagger环境 Profiles profils = Profiles.of("dev"); //通过 environment
阅读全文
摘要:导入Swagger2依赖 <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --> <dependency> <groupId>io.springfox</groupId> <artifactId>spri
阅读全文
摘要:在Swagger配置类中添加@EnableWebMvc注解
阅读全文
摘要:这是在@EnableWebMvc的注释之下,原先swagger2的默认地址失效了,所有需要重新配置 在SwaggerConfig配置类中继承 WebMvcConfigurer,重写addResourceHandlers方法 @Override public void addResourceHandl
阅读全文