mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
Swagger提示版本和POM中版本通过配置保持一致
This commit is contained in:
@@ -15,6 +15,7 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: kafkamanager
|
||||
version: @project.version@
|
||||
profiles:
|
||||
active: dev
|
||||
datasource:
|
||||
|
||||
@@ -15,6 +15,7 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: kafkamanager
|
||||
version: @project.version@
|
||||
profiles:
|
||||
active: dev
|
||||
datasource:
|
||||
|
||||
@@ -18,6 +18,9 @@ public class ConfigUtils {
|
||||
@Value(value = "${custom.idc:cn}")
|
||||
private String idc;
|
||||
|
||||
@Value(value = "${spring.profiles.active}")
|
||||
@Value(value = "${spring.profiles.active:dev}")
|
||||
private String kafkaManagerEnv;
|
||||
|
||||
@Value(value = "${spring.application.version:unknown}")
|
||||
private String applicationVersion;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xiaojukeji.kafka.manager.web.config;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.service.utils.ConfigUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.*;
|
||||
@@ -20,6 +22,9 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@EnableWebMvc
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig implements WebMvcConfigurer {
|
||||
@Autowired
|
||||
private ConfigUtils configUtils;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||
@@ -41,7 +46,7 @@ public class SwaggerConfig implements WebMvcConfigurer {
|
||||
return new ApiInfoBuilder()
|
||||
.title("LogiKM接口文档")
|
||||
.description("欢迎使用滴滴LogiKM")
|
||||
.version("2.5.0")
|
||||
.version(configUtils.getApplicationVersion())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: kafkamanager
|
||||
version: @project.version@
|
||||
profiles:
|
||||
active: dev
|
||||
datasource:
|
||||
|
||||
Reference in New Issue
Block a user