|
|
@@ -45,6 +45,12 @@ public class SmartDataSourceServiceImpl extends ServiceImpl<SmartDataSourceMappe
|
|
|
|
|
|
private final static DriverManagerDataSource dataSource = new DriverManagerDataSource();
|
|
|
|
|
|
+ /**
|
|
|
+ * 添加数据源
|
|
|
+ *
|
|
|
+ * @param smartDataSource 数据源对象
|
|
|
+ * @return 返回
|
|
|
+ */
|
|
|
@Override
|
|
|
public Map<String, Object> insertSmartDataSource(SmartDataSource smartDataSource) {
|
|
|
// 检测参数,还有是否存在重复记录
|
|
|
@@ -101,6 +107,12 @@ public class SmartDataSourceServiceImpl extends ServiceImpl<SmartDataSourceMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改数据源
|
|
|
+ *
|
|
|
+ * @param smartDataSource 数据源对象
|
|
|
+ * @return 返回
|
|
|
+ */
|
|
|
@Override
|
|
|
public Map<String, Object> updateSmartDataSource(SmartDataSource smartDataSource) {
|
|
|
// 检测参数,还有是否存在重复记录
|
|
|
@@ -164,6 +176,14 @@ public class SmartDataSourceServiceImpl extends ServiceImpl<SmartDataSourceMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 数据源分页数据
|
|
|
+ *
|
|
|
+ * @param currentPage 当前页码
|
|
|
+ * @param pageCount 每页显示数据条数
|
|
|
+ * @param smartDataSource 数据源对象
|
|
|
+ * @return 返回
|
|
|
+ */
|
|
|
@Override
|
|
|
public PageInfo<SmartDataSource> queryPageSmartDataSources(int currentPage, int pageCount, SmartDataSource smartDataSource) {
|
|
|
PageHelper.startPage(currentPage, pageCount);
|
|
|
@@ -183,6 +203,12 @@ public class SmartDataSourceServiceImpl extends ServiceImpl<SmartDataSourceMappe
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 验证数据源是否连接成功,是否是有效的连接
|
|
|
+ *
|
|
|
+ * @param smartDataSource 数据源对象
|
|
|
+ * @return 返回
|
|
|
+ */
|
|
|
@Override
|
|
|
public Map<String, Object> vcoSmartDataSource(SmartDataSource smartDataSource) {
|
|
|
// 设置数据源信息
|