Pre Merge pull request !245 from 淡蓝色的忧伤/dev
This commit is contained in:
commit
46611fbf38
14
pom.xml
14
pom.xml
|
|
@ -31,6 +31,8 @@
|
||||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<velocity.version>1.7</velocity.version>
|
||||||
|
<knife4j.version>2.0.5</knife4j.version>
|
||||||
|
<swagger.bootstrap.ui.version>1.9.6</swagger.bootstrap.ui.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
|
|
@ -144,6 +146,18 @@
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
<version>${swagger.version}</version>
|
<version>${swagger.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--knife4j-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
<version>${knife4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||||
|
<version>${swagger.bootstrap.ui.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--io常用工具类 -->
|
<!--io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.ruoyi.web.core.config;
|
||||||
|
|
||||||
|
|
||||||
|
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||||
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
import springfox.documentation.service.ApiInfo;
|
||||||
|
import springfox.documentation.service.Contact;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description swagger2Knife4j
|
||||||
|
* @Author liuwy
|
||||||
|
* @Date 2020/12/18
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
@EnableSwagger2
|
||||||
|
@EnableKnife4j
|
||||||
|
@Import(BeanValidatorPluginsConfiguration.class)
|
||||||
|
public class Swagger2Knife4jConfig {
|
||||||
|
|
||||||
|
@Bean(value = "adminApi")
|
||||||
|
public Docket createRestApi() {
|
||||||
|
Docket docket=new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
.enable(true)
|
||||||
|
.apiInfo(apiInfo())
|
||||||
|
//分组名称
|
||||||
|
.groupName("若依")
|
||||||
|
.select()
|
||||||
|
//扫描所有有注解的api,用这种方式更灵活
|
||||||
|
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
|
.paths(PathSelectors.any())
|
||||||
|
.build();
|
||||||
|
return docket;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiInfo apiInfo() {
|
||||||
|
return new ApiInfoBuilder()
|
||||||
|
//标题
|
||||||
|
.title("标题:若依管理系统_接口文档")
|
||||||
|
//描述
|
||||||
|
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||||
|
//作者
|
||||||
|
.contact(new Contact(RuoYiConfig.getName(), null, null))
|
||||||
|
//服务url
|
||||||
|
.termsOfServiceUrl("http://ruoyi.vip")
|
||||||
|
//版本号
|
||||||
|
.version("版本号:" + RuoYiConfig.getVersion())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -71,6 +71,16 @@
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--knife4j-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- io常用工具类 -->
|
<!-- io常用工具类 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue