use of com.ibeiliao.deployment.admin.vo.server.ServerDeployLog in project Corgi by kevinYin.
the class DeployHistoryServiceImpl method fillLogIntoServerDeploy.
private void fillLogIntoServerDeploy(List<ServerDeployHistory> deployHistoryList) {
List<Integer> serverDeployIds = Lists.newArrayList();
for (ServerDeployHistory history : deployHistoryList) {
serverDeployIds.add(history.getId());
}
List<ServerDeployLog> deployLogs = deployLogService.getByServerDeployHistoryIds(serverDeployIds);
ArrayListMultimap<Integer, ServerDeployLog> serverDeployId2DeployLogsMap = ArrayListMultimap.create();
for (ServerDeployLog deployLog : deployLogs) {
serverDeployId2DeployLogsMap.put(deployLog.getServerDeployId(), deployLog);
}
for (ServerDeployHistory deployHistory : deployHistoryList) {
if (serverDeployId2DeployLogsMap.get(deployHistory.getId()) != null) {
deployHistory.setServerDeployLogs(serverDeployId2DeployLogsMap.get(deployHistory.getId()));
}
}
}
use of com.ibeiliao.deployment.admin.vo.server.ServerDeployLog in project Corgi by kevinYin.
the class LogMessageProcessor method readLogs.
private List<ShellLogResponseMessage.ServerShellLog> readLogs(ShellLogRequestMessage request) {
List<ShellLogResponseMessage.ServerShellLog> shellLogList = new ArrayList<>();
DeployLogService deployLogService = SpringContextUtil.getBean(DeployLogService.class);
StringBuilder sb = new StringBuilder(1024);
for (Integer id : request.getServerDeployIdList()) {
List<ServerDeployLog> list = deployLogService.getServerDeployLog(id);
if (!CollectionUtils.isEmpty(list)) {
sb.setLength(0);
ShellLogResponseMessage.ServerShellLog log = new ShellLogResponseMessage.ServerShellLog();
log.setServerDeployId(id);
for (ServerDeployLog temp : list) {
sb.append(temp.getShellLog()).append("\n");
}
log.setLog(sb.toString());
shellLogList.add(log);
}
}
return shellLogList;
}
Aggregations