|
|
@@ -2,6 +2,7 @@ package com.zksy.cockpit.event;
|
|
|
|
|
|
import com.zksy.cockpit.detail.CockpitSectionResult;
|
|
|
import com.zksy.cockpit.foundation.CockpitCoordinateValidation;
|
|
|
+import com.zksy.cockpit.foundation.CockpitFreshnessStatus;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
@@ -54,6 +55,15 @@ public class CockpitCurrentEventsResponse {
|
|
|
public Filters getFilters() { return filters; }
|
|
|
public Pagination getPagination() { return pagination; }
|
|
|
public MapFilter getMapFilter() { return mapFilter; }
|
|
|
+ public CockpitFreshnessStatus getFreshness() {
|
|
|
+ if (sections == null || sections.getEvents() == null
|
|
|
+ || sections.getEvents().getState() == com.zksy.cockpit.detail.CockpitSectionState.FAILED) {
|
|
|
+ return CockpitFreshnessStatus.FAILED;
|
|
|
+ }
|
|
|
+ return sections.getEvents().getData() == null || sections.getEvents().getData().isEmpty()
|
|
|
+ ? CockpitFreshnessStatus.EMPTY : CockpitFreshnessStatus.CURRENT;
|
|
|
+ }
|
|
|
+
|
|
|
public Sections getSections() { return sections; }
|
|
|
|
|
|
public static class Filters {
|