1.修改重点事件保障默认查询最近一个月、事件封堵、监测默认查询最近24h

2.完善controller路径
This commit is contained in:
wangwei
2018-12-25 19:51:52 +08:00
parent accad98477
commit ac73eca670
2 changed files with 13 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ import java.util.Map;
* @data 2018/12/24 15:21
*/
@RestController
@RequestMapping("${servicePath}")
@RequestMapping("${servicePath}/log/v1")
@Api(value = "EventInfoController", description = "事件封堵、监测、保障接口")
@SuppressWarnings("all")
public class EventInfoController extends BaseRestController {
@@ -37,7 +37,7 @@ public class EventInfoController extends BaseRestController {
@Autowired
EventService eventService;
@RequestMapping(value = "/log/v1/ntcEventKeyProtection", method = RequestMethod.GET)
@RequestMapping(value = "/ntcEventKeyProtection", method = RequestMethod.GET)
@ApiOperation(value = "重点保障事件总览", httpMethod = "GET", notes = "获取重点保障事件信息", response = Map.class)
public Map<String, ?> getEventKeyProtection(EventKeyProtection eventKeyProtection, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();
@@ -61,7 +61,7 @@ public class EventInfoController extends BaseRestController {
eventKeyProtectionPage, 0);
}
@RequestMapping(value = "/log/v1/ntcEventsMonitorOrBlock", method = RequestMethod.GET)
@RequestMapping(value = "/ntcEventsMonitorOrBlock", method = RequestMethod.GET)
@ApiOperation(value = "事件监测、封堵", httpMethod = "GET", notes = "获取事件监测、封堵信息", response = Map.class)
public Map<String, ?> getEventsMonitorOrBlock(EventMonitorOrBlock eventMonitorOrBlock, HttpServletRequest request, HttpServletResponse response) {
long start = System.currentTimeMillis();

View File

@@ -61,17 +61,17 @@ public class EventService {
}catch(Exception ex){
logger.error("时间参数处理转换异常,{}", ex);
String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime());
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24);
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24*30);
eventKeyProtection = new EventKeyProtection();
eventKeyProtection.setSearchReportStartTime(startTemp);
logger.info("获取重点保障事件API请求参数转换异常,默认查询昨天"+startTemp+"至今数据");
logger.info("获取重点保障事件API请求参数转换异常,默认查询起始时间"+startTemp+"至今数据");
}
if(countParamEmpty == 6){
if(countParamEmpty == 5){
String rangeOfday = CalendarUtils.getRangeOfday(DateUtils.getDateTime());
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24);
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeOfday, -24*30);
eventKeyProtection = new EventKeyProtection();
eventKeyProtection.setSearchReportStartTime(startTemp);
logger.info("获取重点保障事件API请求参数为空,默认查询昨天"+startTemp+"至今数据");
logger.info("获取重点保障事件API请求参数为空,默认查询起始时间"+startTemp+"至今数据");
}
try {
list = eventServiceDao.getEventsKeyProtection(eventKeyProtection);
@@ -117,21 +117,21 @@ public class EventService {
}catch(Exception ex){
logger.error("时间参数处理转换异常,{}", ex);
String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime());
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1);
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -24);
int typeId = eventMonitorOrBlock.getReportType();
eventMonitorOrBlock = new EventMonitorOrBlock();
eventMonitorOrBlock.setSearchReportStartTime(startTemp);
eventMonitorOrBlock.setReportType(typeId);
logger.info("获取"+logMark+"API请求参数转换异常,默认查询上一小时"+startTemp+"到现在的数据");
logger.info("获取"+logMark+"API请求参数转换异常,默认查询起始时间"+startTemp+"到现在的数据");
}
if(countParamEmpty==6){
if(countParamEmpty==5){
String rangeNhourOfTime = CalendarUtils.getRangeOfhour(DateUtils.getDateTime());
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -1);
String startTemp = CalendarUtils.getRangeNhourOfTime(rangeNhourOfTime, -24);
int typeId = eventMonitorOrBlock.getReportType();
eventMonitorOrBlock = new EventMonitorOrBlock();
eventMonitorOrBlock.setSearchReportStartTime(startTemp);
eventMonitorOrBlock.setReportType(typeId);
logger.info("获取"+logMark+"API请求参数为空,默认查询上一小时"+startTemp+"到现在的数据");
logger.info("获取"+logMark+"API请求参数为空,默认查询起始时间"+startTemp+"到现在的数据");
}
try {
list = eventServiceDao.getEventsMonitorOrBlock(eventMonitorOrBlock);