Commit e81c1ce7 authored by duanruiming's avatar duanruiming

[add] 事件实时列表优化

parent 93b72b6d
......@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.opt.servicev2.TrendServiceV2;
import net.wanji.opt.vo2.*;
import org.springframework.web.bind.annotation.*;
......@@ -145,10 +146,16 @@ public class TrendControllerV2 {
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = OptMonitoringVO.class),
})
public JsonViewObject eventAlarmRealTimeList() throws Exception {
public JsonViewObject eventAlarmRealTimeList(String type) throws Exception {
List<OptMonitoringVO> list = Collections.emptyList();
try {
list = trendServiceV2.eventAlarmRealTimeList();
if (StringUtils.isBlank(type)) {
list = trendServiceV2.eventAlarmRealTimeList();
} else {
list = trendServiceV2.eventAlarmRealTimeList().stream()
.filter(vo -> StringUtils.equalsIgnoreCase(type, vo.getType()))
.collect(Collectors.toList());
}
} catch (Exception e) {
log.error("态势监测-事件告警-实时列表:", e);
JsonViewObject.newInstance().success(list);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment