use of com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO in project apollo by ctripcorp.
the class ReleaseHistoryService method transformReleaseHistoryDTO2BO.
private ReleaseHistoryBO transformReleaseHistoryDTO2BO(ReleaseHistoryDTO dto, ReleaseDTO release) {
ReleaseHistoryBO bo = new ReleaseHistoryBO();
bo.setId(dto.getId());
bo.setAppId(dto.getAppId());
bo.setClusterName(dto.getClusterName());
bo.setNamespaceName(dto.getNamespaceName());
bo.setBranchName(dto.getBranchName());
bo.setReleaseId(dto.getReleaseId());
bo.setPreviousReleaseId(dto.getPreviousReleaseId());
bo.setOperator(dto.getDataChangeCreatedBy());
bo.setOperatorDisplayName(dto.getDataChangeCreatedByDisplayName());
bo.setOperation(dto.getOperation());
Date releaseTime = dto.getDataChangeLastModifiedTime();
bo.setReleaseTime(releaseTime);
bo.setReleaseTimeFormatted(RelativeDateFormat.format(releaseTime));
bo.setOperationContext(dto.getOperationContext());
// set release info
setReleaseInfoToReleaseHistoryBO(bo, release);
return bo;
}
use of com.ctrip.framework.apollo.portal.entity.bo.ReleaseHistoryBO in project apollo by ctripcorp.
the class ReleaseHistoryService method transformReleaseHistoryDTO2BO.
private List<ReleaseHistoryBO> transformReleaseHistoryDTO2BO(List<ReleaseHistoryDTO> source, List<ReleaseDTO> releases) {
if (CollectionUtils.isEmpty(source)) {
return Collections.emptyList();
}
this.additionalUserInfoEnrichService.enrichAdditionalUserInfo(source, BaseDtoUserInfoEnrichedAdapter::new);
Map<Long, ReleaseDTO> releasesMap = BeanUtils.mapByKey("id", releases);
List<ReleaseHistoryBO> bos = new ArrayList<>(source.size());
for (ReleaseHistoryDTO dto : source) {
ReleaseDTO release = releasesMap.get(dto.getReleaseId());
bos.add(transformReleaseHistoryDTO2BO(dto, release));
}
return bos;
}
Aggregations