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