diff --git a/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java b/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java index 958b16d..8f30234 100644 --- a/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java +++ b/bocloud.sms.booter/src/main/java/com/bocloud/sms/booter/controller/IndexDataController.java @@ -87,4 +87,28 @@ public class IndexDataController { public GeneralResult sevenDayWarnTrend(@Value(Common.REQ_CONTEXT) RequestContext 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); + } } diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java index 18cc0ce..fbb8879 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/interfaces/IndexService.java @@ -17,4 +17,8 @@ public interface IndexService { GeneralResult userAppList(RequestContext requestContext); GeneralResult sevenDayWarnTrend(RequestContext requestContext); + + GeneralResult oneDayWarnCount(RequestContext requestContext); + + GeneralResult warnList(RequestContext requestContext); } diff --git a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java index fc8dc34..7d9e38e 100644 --- a/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java +++ b/bocloud.sms.service/src/main/java/com/bocloud/sms/service/IndexServiceImpl.java @@ -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 getUserAppList(RequestContext requestContext) throws Exception { //查询当前用户授权应用 JSONObject param = new JSONObject(); diff --git a/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/WarnInfo.java b/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/WarnInfo.java index 2d3a7f8..6ff59c7 100644 --- a/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/WarnInfo.java +++ b/bocloud.sms.storage/src/main/java/com/bocloud/sms/enums/WarnInfo.java @@ -4,6 +4,8 @@ public enum WarnInfo { //单日告警统计 get1DayWarnCount("/alistar/api/v1/alarm/current/statistics/7d"), + //告警列表 + getWarnList("/alistar/api/v1/alarm/current"), //近7日告警趋势统计 get7DayWarnTrend("/alistar/api/v1/alarm/current/today/all");