use of org.apache.inlong.manager.dao.entity.StreamConfigLogEntity in project incubator-inlong by apache.
the class StreamConfigLogServiceImpl method convertData.
public StreamConfigLogEntity convertData(InlongStreamConfigLogRequest request) {
StreamConfigLogEntity entity = new StreamConfigLogEntity();
entity.setComponentName(request.getComponentName());
entity.setInlongGroupId(request.getInlongGroupId());
entity.setInlongStreamId(request.getInlongStreamId());
entity.setConfigName(request.getConfigName());
entity.setReportTime(new Date(request.getReportTime()));
entity.setVersion(request.getVersion());
entity.setLogInfo(request.getLogInfo());
entity.setLogType(request.getLogType());
entity.setIp(request.getIp());
return entity;
}
use of org.apache.inlong.manager.dao.entity.StreamConfigLogEntity in project incubator-inlong by apache.
the class StreamConfigLogServiceImpl method listByCondition.
@Override
public PageInfo<InlongStreamConfigLogListResponse> listByCondition(InlongStreamConfigLogPageRequest request) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("begin to list source page by " + request);
}
Preconditions.checkNotNull(request.getInlongGroupId(), Constant.GROUP_ID_IS_EMPTY);
PageHelper.startPage(request.getPageNum(), request.getPageSize());
if (request.getReportTime() == null) {
Instant instant = Instant.now().minus(Duration.ofMillis(5));
request.setReportTime(new Date(instant.toEpochMilli()));
}
Page<StreamConfigLogEntity> entityPage = (Page<StreamConfigLogEntity>) streamConfigLogEntityMapper.selectByCondition(request);
List<InlongStreamConfigLogListResponse> detailList = CommonBeanUtils.copyListProperties(entityPage, InlongStreamConfigLogListResponse::new);
PageInfo<InlongStreamConfigLogListResponse> pageInfo = new PageInfo<>(detailList);
pageInfo.setTotal(entityPage.getTotal());
return pageInfo;
}
Aggregations