...
|
...
|
@@ -5,6 +5,8 @@ import com.monitor.javaserver.service.IJavaApiStatusService; |
|
|
import com.monitor.model.request.JavaApiStatusReq;
|
|
|
import com.monitor.model.response.BaseResponse;
|
|
|
import com.monitor.model.response.JavaApiStatusRep;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
...
|
...
|
@@ -22,6 +24,7 @@ import java.util.List; |
|
|
@RequestMapping("javaApiStatus")
|
|
|
public class JavaAppInfoCtrl {
|
|
|
|
|
|
Logger log = LoggerFactory.getLogger(JavaAppInfoCtrl.class);
|
|
|
@Autowired
|
|
|
IJavaApiStatusService javaApiStatusService;
|
|
|
|
...
|
...
|
@@ -34,6 +37,7 @@ public class JavaAppInfoCtrl { |
|
|
JavaApiStatusRep javaApiStatusRep = javaApiStatusService.getJavaApiStatus(req);
|
|
|
rep.setData(javaApiStatusRep);
|
|
|
} catch (Exception e) {
|
|
|
log.warn("queryOne failed req :{} ", req, e);
|
|
|
rep.setCode(400);
|
|
|
rep.setMessage(e.getMessage());
|
|
|
}
|
...
|
...
|
@@ -51,6 +55,7 @@ public class JavaAppInfoCtrl { |
|
|
List<JavaApiStatusRep> javaApiStatusRepList = javaApiStatusService.getJavaApiStatusList(list);
|
|
|
rep.setData(javaApiStatusRepList);
|
|
|
} catch (Exception e) {
|
|
|
log.warn("query failed req :{} ", req, e);
|
|
|
rep.setCode(400);
|
|
|
rep.setMessage(e.getMessage());
|
|
|
}
|
...
|
...
|
@@ -81,6 +86,7 @@ public class JavaAppInfoCtrl { |
|
|
List<JavaApiStatusRep> javaApiStatusRepList = javaApiStatusService.getJavaApiStatusHisLatest(api_id, mobj_id);
|
|
|
rep.setData(javaApiStatusRepList);
|
|
|
} catch (Exception e) {
|
|
|
log.warn("querylatesthis failed apiId :{} mobjId:{}", api_id, mobj_id, e);
|
|
|
rep.setCode(400);
|
|
|
rep.setMessage(e.getMessage());
|
|
|
}
|
...
|
...
|
@@ -89,8 +95,27 @@ public class JavaAppInfoCtrl { |
|
|
|
|
|
@RequestMapping("/queryhis")
|
|
|
@ResponseBody
|
|
|
public BaseResponse getJavaApiStatusHis() {
|
|
|
public BaseResponse getJavaApiStatusHis(@RequestParam(required = false, defaultValue = "0") int api_id,
|
|
|
@RequestParam(required = false, defaultValue = "0") int mobj_id,
|
|
|
@RequestParam(required = false, defaultValue = "0") long start_time,
|
|
|
@RequestParam(required = false, defaultValue = "0") long end_time,
|
|
|
@RequestParam(required = false, defaultValue = "0") int page) {
|
|
|
BaseResponse rep = new BaseResponse();
|
|
|
if (start_time == 0) {
|
|
|
return getJavaApiStatusHisLatest(api_id, mobj_id);
|
|
|
}
|
|
|
|
|
|
if (end_time == 0)
|
|
|
end_time = System.currentTimeMillis();
|
|
|
|
|
|
try {
|
|
|
List<JavaApiStatusRep> javaApiStatusRepList = javaApiStatusService.getJavaApiStatusHisByTime(api_id, mobj_id, start_time, end_time, page);
|
|
|
rep.setData(javaApiStatusRepList);
|
|
|
} catch (Exception e) {
|
|
|
log.warn("queryhis failed apiId :{} mobjId:{} start_time:{} endTime:{} ,page:{} ", api_id, mobj_id, start_time, end_time, page, e);
|
|
|
rep.setCode(400);
|
|
|
rep.setMessage(e.getMessage());
|
|
|
}
|
|
|
|
|
|
return rep;
|
|
|
}
|
...
|
...
|
|