...
|
...
|
@@ -4,9 +4,11 @@ import com.google.common.base.Preconditions; |
|
|
import com.monitor.model.response.BaseResponse;
|
|
|
import com.monitor.nginxsync.constant.Constants;
|
|
|
import com.monitor.nginxsync.model.CmdTaskInfo;
|
|
|
import com.monitor.nginxsync.model.LogMsgResp;
|
|
|
import com.monitor.nginxsync.model.TaskInfo;
|
|
|
import com.monitor.nginxsync.nio.model.LogMsg;
|
|
|
import com.monitor.nginxsync.nio.service.LogService;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
...
|
...
|
@@ -97,8 +99,36 @@ public class NginxSyncService { |
|
|
|
|
|
BaseResponse baseResponse = new BaseResponse();
|
|
|
|
|
|
baseResponse.setData(logService.outLogMsg(taskInfo.getTaskId()));
|
|
|
LogMsg logMsg = logService.outLogMsg(taskInfo.getTaskId());
|
|
|
|
|
|
baseResponse.setData(convertLogMsg(logMsg));
|
|
|
|
|
|
return baseResponse;
|
|
|
}
|
|
|
|
|
|
|
|
|
private LogMsgResp convertLogMsg(LogMsg logMsg) {
|
|
|
LogMsgResp logMsgResp = new LogMsgResp();
|
|
|
|
|
|
logMsgResp.setIsFinished(logMsg.getIsFinished());
|
|
|
|
|
|
logMsgResp.setTaskId(logMsg.getTaskId());
|
|
|
|
|
|
String str = StringUtils.EMPTY;
|
|
|
|
|
|
if (null != logMsg.getMsgList()) {
|
|
|
for (String logItem : logMsg.getMsgList()) {
|
|
|
|
|
|
if(StringUtils.isEmpty(logItem))
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
str += "\r\n" + logItem;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
logMsgResp.setLog(str);
|
|
|
|
|
|
return logMsgResp;
|
|
|
}
|
|
|
} |
...
|
...
|
|