use of com.dtstack.taier.develop.vo.datasource.DsListVO in project Taier by DTStack.
the class DsInfoService method dsPage.
/**
* 数据源列表分页
*
* @param dsListParam
* @return
*/
public PageResult<List<DsListVO>> dsPage(DsListParam dsListParam) {
DsListQuery listQuery = DsListTransfer.INSTANCE.toInfoQuery(dsListParam);
listQuery.turn();
Integer total = this.baseMapper.countDsPage(listQuery);
if (total == 0) {
return new PageResult<>(0, 0, 0, 0, new ArrayList<>());
}
List<DsListBO> dsListBOList = baseMapper.queryDsPage(listQuery);
if (CollectionUtils.isEmpty(dsListBOList)) {
return new PageResult<>(0, 0, 0, 0, new ArrayList<>());
}
List<DsListVO> dsListVOS = new ArrayList<>();
for (DsListBO dsListBO : dsListBOList) {
DsListVO dsListVO = DsListTransfer.INSTANCE.toInfoVO(dsListBO);
String linkJson = dsListVO.getLinkJson();
JSONObject linkData = DataSourceUtils.getDataSourceJson(linkJson);
linkData.put("schemaName", dsListVO.getSchemaName());
dsListVO.setLinkJson(DataSourceUtils.getEncodeDataSource(linkData, true));
dsListVOS.add(dsListVO);
}
return new PageResult<>(dsListParam.getCurrentPage(), dsListParam.getPageSize(), total, dsListVOS);
}
Aggregations