Compare commits
2 Commits
a1eeaa234e
...
acd4edd80b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acd4edd80b | ||
|
|
8311467a83 |
|
|
@ -121,15 +121,15 @@ public class StasDataSourceController extends JeecgController<StasDataSource, IS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据库连接测试
|
* 数据库连接测试
|
||||||
* @param sourceId
|
* @param stasDataSource
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "数据库连接测试")
|
@AutoLog(value = "数据库连接测试")
|
||||||
@Operation(summary = "数据库连接测试")
|
@Operation(summary = "数据库连接测试")
|
||||||
@RequestMapping(value = "/testConnection", method = RequestMethod.GET)
|
@RequestMapping(value = "/testConnection", method = RequestMethod.GET)
|
||||||
public Result<StasDataSource> testConnection(String sourceId) {
|
public Result<StasDataSource> testConnection(StasDataSource stasDataSource) {
|
||||||
try {
|
try {
|
||||||
boolean isValue = stasDataSourceService.testConnection(sourceId);
|
boolean isValue = stasDataSourceService.testConnection(stasDataSource);
|
||||||
if(isValue){
|
if(isValue){
|
||||||
return Result.OK("连接成功");
|
return Result.OK("连接成功");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试数据库连接
|
* 测试数据库连接
|
||||||
* @param sourceId
|
* @param stasDataSource
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean testConnection(String sourceId);
|
boolean testConnection(StasDataSource stasDataSource);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有用户信息
|
* 查询所有用户信息
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,7 @@ public class StasDataSourceServiceImpl extends ServiceImpl<StasDataSourceMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean testConnection(String sourceId) {
|
public boolean testConnection(StasDataSource stasDataSource) {
|
||||||
StasDataSource stasDataSource = this.baseMapper.selectById(sourceId);
|
|
||||||
Connection conn = null;
|
Connection conn = null;
|
||||||
try {
|
try {
|
||||||
String urlSource = "";
|
String urlSource = "";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user