告警平台对接
parent
370117aecc
commit
9eba1b9b1a
|
@ -87,4 +87,28 @@ public class IndexDataController {
|
||||||
public GeneralResult sevenDayWarnTrend(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
public GeneralResult sevenDayWarnTrend(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
||||||
return indexService.sevenDayWarnTrend(requestContext);
|
return indexService.sevenDayWarnTrend(requestContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单日告警统计
|
||||||
|
* @param pager
|
||||||
|
* @param requestContext
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/oneDayWarnCount")
|
||||||
|
@Operation(summary = "单日告警统计")
|
||||||
|
public GeneralResult oneDayWarnCount(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
||||||
|
return indexService.oneDayWarnCount(requestContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警列表
|
||||||
|
* @param pager
|
||||||
|
* @param requestContext
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/warnList")
|
||||||
|
@Operation(summary = "告警列表")
|
||||||
|
public GeneralResult warnList(@Value(Common.REQ_CONTEXT) RequestContext requestContext) {
|
||||||
|
return indexService.warnList(requestContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,8 @@ public interface IndexService {
|
||||||
GeneralResult userAppList(RequestContext requestContext);
|
GeneralResult userAppList(RequestContext requestContext);
|
||||||
|
|
||||||
GeneralResult sevenDayWarnTrend(RequestContext requestContext);
|
GeneralResult sevenDayWarnTrend(RequestContext requestContext);
|
||||||
|
|
||||||
|
GeneralResult oneDayWarnCount(RequestContext requestContext);
|
||||||
|
|
||||||
|
GeneralResult warnList(RequestContext requestContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,6 +153,31 @@ public class IndexServiceImpl implements IndexService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GeneralResult oneDayWarnCount(RequestContext requestContext) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
String result = warnUtil.call(WarnInfo.get1DayWarnCount.getUrl(), "GET");
|
||||||
|
log.info("result:"+result);
|
||||||
|
return new GeneralResult(true, "查询成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("查询失败", e);
|
||||||
|
return new GeneralResult(false, "查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GeneralResult warnList(RequestContext requestContext) {
|
||||||
|
try {
|
||||||
|
String result = warnUtil.call(WarnInfo.getWarnList.getUrl(), "GET");
|
||||||
|
log.info("result:"+result);
|
||||||
|
return new GeneralResult(true, "查询成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.info("查询失败", e);
|
||||||
|
return new GeneralResult(false, "查询失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<JSONObject> getUserAppList(RequestContext requestContext) throws Exception {
|
private List<JSONObject> getUserAppList(RequestContext requestContext) throws Exception {
|
||||||
//查询当前用户授权应用
|
//查询当前用户授权应用
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
|
|
|
@ -4,6 +4,8 @@ public enum WarnInfo {
|
||||||
|
|
||||||
//单日告警统计
|
//单日告警统计
|
||||||
get1DayWarnCount("/alistar/api/v1/alarm/current/statistics/7d"),
|
get1DayWarnCount("/alistar/api/v1/alarm/current/statistics/7d"),
|
||||||
|
//告警列表
|
||||||
|
getWarnList("/alistar/api/v1/alarm/current"),
|
||||||
//近7日告警趋势统计
|
//近7日告警趋势统计
|
||||||
get7DayWarnTrend("/alistar/api/v1/alarm/current/today/all");
|
get7DayWarnTrend("/alistar/api/v1/alarm/current/today/all");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue