ZhuDongming
2019-08-09 def4359b55046dfb32d806f3778cf5a813310e7a
新增判断能否查到无人机飞行数据的接口
1 files modified
21 ■■■■■ changed files
src/main/java/com/moral/controller/ScreenController.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/com/moral/controller/ScreenController.java
@@ -1190,4 +1190,25 @@
        }
    }
    @GetMapping("/getSensors")
    @ApiOperation(value = "查询无人机因子", notes = "查询无人机因子")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "mac", value = "设备mac(格式:p5dnd7a0392068)", required = true, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "startTime", value = "开始时间(格式:2019-07-17 17:07:00)", required = false, paramType = "query", dataType = "String"),
            @ApiImplicitParam(name = "endTime", value = "结束时间(格式:2019-07-17 17:07:00)", required = false, paramType = "query", dataType = "String")
    })
    public ResultBean getSensors(HttpServletRequest request) throws Exception{
        Map<String, Object> parameters = WebUtils.getParametersStartingWith(request, null);
        String mac = parameters.get("mac").toString();
        if (mac != null && mac.length() != 0) {
            List<Map<String, Object>> sensorList = historyMinutelyService.getSensorData(parameters);
            if(sensorList.size()==0){
                return new ResultBean("查询不到数据",1);
            }else{
                return new ResultBean("查询到数据",0);
            }
        }
        return null;
    }
}