mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
Swagger API document version keep update-to-date with pom.xml version.
This commit is contained in:
parent
73a5a724ec
commit
4f3b6057b6
@ -214,6 +214,7 @@
|
|||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<goals>
|
<goals>
|
||||||
|
<goal>build-info</goal>
|
||||||
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
|
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.github.kfcfans.powerjob.server.common.config;
|
package com.github.kfcfans.powerjob.server.common.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.info.BuildProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import springfox.documentation.builders.ApiInfoBuilder;
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
@ -8,18 +9,24 @@ import springfox.documentation.spi.DocumentationType;
|
|||||||
import springfox.documentation.spring.web.plugins.Docket;
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import static springfox.documentation.builders.PathSelectors.any;
|
import static springfox.documentation.builders.PathSelectors.any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Swagger UI 配置
|
* Swagger UI 配置
|
||||||
*
|
*
|
||||||
* @author tjq
|
* @author tjq
|
||||||
|
* @author Jiang Jining
|
||||||
* @since 2020/3/29
|
* @since 2020/3/29
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableSwagger2
|
@EnableSwagger2
|
||||||
public class SwaggerConfig {
|
public class SwaggerConfig {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BuildProperties buildProperties;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Docket createRestApi() {
|
public Docket createRestApi() {
|
||||||
// apiInfo()用来创建该Api的基本信息(这些基本信息会展现在文档页面中
|
// apiInfo()用来创建该Api的基本信息(这些基本信息会展现在文档页面中
|
||||||
@ -28,7 +35,7 @@ public class SwaggerConfig {
|
|||||||
.description("Distributed scheduling and computing framework.")
|
.description("Distributed scheduling and computing framework.")
|
||||||
.license("Apache Licence 2")
|
.license("Apache Licence 2")
|
||||||
.termsOfServiceUrl("https://github.com/KFCFans/PowerJob")
|
.termsOfServiceUrl("https://github.com/KFCFans/PowerJob")
|
||||||
.version("3.3.3")
|
.version(buildProperties.getVersion())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user