|
|
package com.monitor.javaserver.service.impl;
|
|
|
|
|
|
import com.model.JavaApiInfoStatics;
|
|
|
import com.monitor.common.util.DateTimeUtil;
|
|
|
import com.monitor.influxdb.mapper.impl.JavaApiStaticsMapper;
|
|
|
import com.monitor.javaserver.common.JavaApiStatus;
|
|
|
import com.monitor.javaserver.service.IJavaApiStatusService;
|
...
|
...
|
@@ -8,6 +10,7 @@ import com.monitor.model.request.JavaApiHisReq; |
|
|
import com.monitor.model.request.JavaApiStatusReq;
|
|
|
import com.monitor.model.response.JavaApiStaticsRep;
|
|
|
import com.monitor.model.response.JavaApiStatusRep;
|
|
|
import com.monitor.mysql.mapper.JavaApiInfoStaticsMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
...
|
...
|
@@ -27,6 +30,8 @@ public class JavaAppiStatusServiceImpl implements IJavaApiStatusService { |
|
|
@Autowired
|
|
|
JavaApiStatus javaApiStatus;
|
|
|
|
|
|
@Autowired
|
|
|
JavaApiInfoStaticsMapper mysqlJavaApiStaticsMapper;
|
|
|
|
|
|
@Override
|
|
|
public JavaApiStatusRep getJavaApiStatus(JavaApiStatusReq req) {
|
...
|
...
|
@@ -49,20 +54,21 @@ public class JavaAppiStatusServiceImpl implements IJavaApiStatusService { |
|
|
List<JavaApiStatusRep> repList = new ArrayList<JavaApiStatusRep>();
|
|
|
|
|
|
|
|
|
List<JavaApiStaticsModel> modelList = javaApiStaticsMapper.selectlatestJavaApiStaticsList(null, reqList);
|
|
|
// List<JavaApiStaticsModel> modelList = javaApiStaticsMapper.selectlatestJavaApiStaticsList(null, reqList);
|
|
|
|
|
|
for (JavaApiStaticsModel req : modelList) {
|
|
|
JavaApiStatusRep rep = new JavaApiStatusRep();
|
|
|
rep.setServiceId(req.getServiceId());
|
|
|
rep.setMObjectId(req.getMObjectId());
|
|
|
rep.setStatus(req.getStatus());
|
|
|
List<JavaApiInfoStatics> modelList = mysqlJavaApiStaticsMapper.selectJavaApiStaticsByIds(reqList);
|
|
|
|
|
|
rep.setEndTime(req.getEndTime());
|
|
|
rep.setStartTime(req.getStartTime());
|
|
|
rep.setCostTime(req.getCostTime());
|
|
|
rep.setException(req.getException());
|
|
|
|
|
|
for (JavaApiInfoStatics req : modelList) {
|
|
|
JavaApiStatusRep rep = new JavaApiStatusRep();
|
|
|
rep.setServiceId(req.getApiId());
|
|
|
rep.setMObjectId(req.getMobjId());
|
|
|
rep.setStatus(req.getIsException() == 1 ? 0 : 1);
|
|
|
|
|
|
rep.setEndTime(DateTimeUtil.unix2time(req.getEndTime()));
|
|
|
rep.setStartTime(DateTimeUtil.unix2time(req.getStartTime()));
|
|
|
rep.setCostTime((int) (req.getEndTime() - req.getStartTime()));
|
|
|
rep.setException(req.getException());
|
|
|
repList.add(rep);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -138,7 +144,7 @@ public class JavaAppiStatusServiceImpl implements IJavaApiStatusService { |
|
|
@Override
|
|
|
public List<JavaApiStaticsRep> getAllJavaApiStatus() {
|
|
|
|
|
|
return javaApiStatus.getStatusList();
|
|
|
return javaApiStatus.getStatusList();
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|