...
|
...
|
@@ -2,7 +2,6 @@ package com.monitor.cmdb.service.impl; |
|
|
|
|
|
import com.monitor.cmdb.service.IZkMoitorService;
|
|
|
import com.monitor.influxdb.mapper.IZkMapper;
|
|
|
import com.monitor.influxdb.model.ZkInfo;
|
|
|
import com.monitor.model.domain.PageBean;
|
|
|
import com.monitor.model.request.ZkInfoReq;
|
|
|
import com.monitor.model.response.PageResponse;
|
...
|
...
|
@@ -10,7 +9,6 @@ import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
...
|
...
|
@@ -27,7 +25,7 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
IZkMapper zkMapper;
|
|
|
|
|
|
@Override
|
|
|
public PageResponse<ZkInfo> getZkMonitorRecords(ZkInfoReq req) {
|
|
|
public PageResponse<Object> getZkMonitorRecords(ZkInfoReq req) {
|
|
|
logger.info("getHostInfos with param is {}", req);
|
|
|
// 组装分页对象
|
|
|
PageBean page = PageBean.initPageInfo(req.getCurrentPage(),
|
...
|
...
|
@@ -42,16 +40,16 @@ public class ZkMoitorServiceImpl implements IZkMoitorService { |
|
|
return null;
|
|
|
}
|
|
|
// 获取列表
|
|
|
List<ZkInfo> zkInfos = zkMapper.selectZkInfosByCodition(page);
|
|
|
if (CollectionUtils.isEmpty(zkInfos)) {
|
|
|
logger.debug("getHostInfos is null with param is {}", req);
|
|
|
List<?> zkInfos = zkMapper.selectZkInfosByCodition(page);
|
|
|
if (zkInfos==null) {
|
|
|
logger.debug("selectZkInfosByCodition is null with param is {}", page);
|
|
|
return null;
|
|
|
}
|
|
|
PageResponse<ZkInfo> response = new PageResponse<ZkInfo>();
|
|
|
PageResponse<Object> response = new PageResponse<Object>();
|
|
|
response.setCurrentPage(req.getCurrentPage());
|
|
|
response.setPageSize(req.getPageSize());
|
|
|
response.setTotal(total);
|
|
|
response.setRows(zkInfos);
|
|
|
response.setRows((List<Object>) zkInfos);
|
|
|
return response;
|
|
|
}
|
|
|
} |
...
|
...
|
|