|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.ruoyi.web.core.config;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import com.ruoyi.common.config.Global;
|
|
|
|
@ -22,6 +23,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|
|
|
|
@EnableSwagger2
|
|
|
|
|
public class SwaggerConfig
|
|
|
|
|
{
|
|
|
|
|
/** 是否开启swagger */
|
|
|
|
|
@Value("${swagger.enabled}")
|
|
|
|
|
private boolean enabled;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 创建API
|
|
|
|
|
*/
|
|
|
|
@ -29,6 +34,8 @@ public class SwaggerConfig
|
|
|
|
|
public Docket createRestApi()
|
|
|
|
|
{
|
|
|
|
|
return new Docket(DocumentationType.SWAGGER_2)
|
|
|
|
|
// 是否启用Swagger
|
|
|
|
|
.enable(enabled)
|
|
|
|
|
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
|
|
|
|
.apiInfo(apiInfo())
|
|
|
|
|
// 设置哪些接口暴露给Swagger展示
|
|
|
|
|