use of com.ibeiliao.deployment.admin.service.server.DeployLogService 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