| | |
| | | <dependency>
|
| | | <groupId>io.springfox</groupId>
|
| | | <artifactId>springfox-boot-starter</artifactId>
|
| | | <version>3.0.0</version>
|
| | | <version>${swagger.version}</version>
|
| | | <exclusions>
|
| | | <exclusion>
|
| | | <groupId>io.swagger</groupId>
|
| | | <artifactId>swagger-models</artifactId>
|
| | | </exclusion>
|
| | | </exclusions>
|
| | | </dependency>
|
| | |
|
| | | <!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
| | |
| | | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
|
| | |
|
| | | /** swagger配置 */
|
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
| | | registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @Bean
|
| | | public Docket createRestApi()
|
| | | {
|
| | | return new Docket(DocumentationType.SWAGGER_2)
|
| | | return new Docket(DocumentationType.OAS_30)
|
| | | // 是否启用Swagger
|
| | | .enable(enabled)
|
| | | // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|