Добавил вывод дату сборки
This commit is contained in:
@ -2,6 +2,7 @@ spring.application.name=kz_istransit_jwt
|
|||||||
server.port=8082
|
server.port=8082
|
||||||
issuer.name=istransit
|
issuer.name=istransit
|
||||||
|
|
||||||
|
|
||||||
logging.level.com.zaxxer.hikari=DEBUG
|
logging.level.com.zaxxer.hikari=DEBUG
|
||||||
|
|
||||||
spring.datasource.url=jdbc:postgresql://10.101.1.6:5432/transit_2024_09_03?ApplicationName=kz_istransit_jwt
|
spring.datasource.url=jdbc:postgresql://10.101.1.6:5432/transit_2024_09_03?ApplicationName=kz_istransit_jwt
|
||||||
|
|||||||
10
pom.xml
10
pom.xml
@ -111,6 +111,7 @@
|
|||||||
<artifactId>googleauth</artifactId>
|
<artifactId>googleauth</artifactId>
|
||||||
<version>1.5.0</version>
|
<version>1.5.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -118,7 +119,15 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>build-info</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
@ -129,6 +138,7 @@
|
|||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,12 @@ import java.time.Duration;
|
|||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.jar.Attributes;
|
||||||
|
import java.util.jar.JarFile;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class MainController implements ServletContextAware {
|
public class MainController implements ServletContextAware {
|
||||||
@ -262,10 +267,26 @@ public class MainController implements ServletContextAware {
|
|||||||
public String index(Model model,@RequestParam(required=false,name="lng",defaultValue = "1") String language_id) {
|
public String index(Model model,@RequestParam(required=false,name="lng",defaultValue = "1") String language_id) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("error_code",0);
|
json.put("error_code",0);
|
||||||
json.put("error_message","Application name: "+application_name);
|
json.put("error_message","");
|
||||||
json.put("error_marker",(String)null);
|
json.put("error_marker",(String)null);
|
||||||
json.put("active_connections",dataSource.getHikariPoolMXBean().getActiveConnections());
|
String buildDate="";
|
||||||
json.put("idle_connections",dataSource.getHikariPoolMXBean().getIdleConnections());
|
//String buildVersion="";
|
||||||
|
try {
|
||||||
|
InputStream inputStream = MainController.class.getClassLoader().getResourceAsStream("META-INF/build-info.properties");
|
||||||
|
if (inputStream != null) {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
properties.load(inputStream);
|
||||||
|
buildDate = properties.getProperty("build.time");
|
||||||
|
//buildVersion = properties.getProperty("build.version");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
json.put("build_date",buildDate);
|
||||||
|
//json.put("build_version",buildVersion);
|
||||||
|
json.put("name",application_name);
|
||||||
|
//json.put("active_connections",dataSource.getHikariPoolMXBean().getActiveConnections());
|
||||||
|
//json.put("idle_connections",dataSource.getHikariPoolMXBean().getIdleConnections());
|
||||||
return json.toString();
|
return json.toString();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user