Commit fa3d6dc4 authored by alex yao's avatar alex yao

feat: Agent应用数据库配置

parent 1055da0d
...@@ -61,7 +61,7 @@ public class DatabaseRestImpl implements DatabaseRest { ...@@ -61,7 +61,7 @@ public class DatabaseRestImpl implements DatabaseRest {
Assert.notBlank(dto.getDbName(), "Database Name must not be blank"); Assert.notBlank(dto.getDbName(), "Database Name must not be blank");
Assert.notBlank(dto.getDbUsername(), "Database Username must not be blank"); Assert.notBlank(dto.getDbUsername(), "Database Username must not be blank");
Assert.notBlank(dto.getDbPassword(), "Database Password must not be blank"); Assert.notBlank(dto.getDbPassword(), "Database Password must not be blank");
boolean connect = DatabaseUtil.testConnect(dto.getDbHost(), dto.getDbPort(), dto.getDbName(), dto.getDbUsername(), dto.getDbPassword()); boolean connect = DatabaseUtil.testConnect(dto.getDbHost(), dto.getDbPort(), dto.getDbUsername(), dto.getDbPassword(), dto.getDbName());
DatabaseTestContentDto result = new DatabaseTestContentDto(); DatabaseTestContentDto result = new DatabaseTestContentDto();
result.setStatus(connect ? "success" : "fail"); result.setStatus(connect ? "success" : "fail");
return result; return result;
......
...@@ -23,7 +23,7 @@ public class DatabaseUtilTest { ...@@ -23,7 +23,7 @@ public class DatabaseUtilTest {
String host = "192.168.21.31"; String host = "192.168.21.31";
int port = 3306; int port = 3306;
String username = "poc_root"; String username = "poc_root";
String password = "8dlb58a2836dc..."; String password = "8db58a2836dc";
String database = "gsst_poc_sit"; String database = "gsst_poc_sit";
System.out.println(DatabaseUtil.testConnect(host, port, username, password, database)); System.out.println(DatabaseUtil.testConnect(host, port, username, password, database));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment