| | |
| | | OrganizationSensorsService organizationSensorsService; |
| | | @Resource |
| | | MapPathService mapPathService; |
| | | @Resource |
| | | HistoryService historyService; |
| | | |
| | | |
| | | @GetMapping("test") |
| | |
| | | return new ResultBean<>(mapPath); |
| | | } |
| | | |
| | | /** |
| | | * @Description: 获取用户站点信息 |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.List<com.moral.entity.MonitorPoint>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/12/8 |
| | | */ |
| | | @UserLoginToken |
| | | @GetMapping("monitor-points") |
| | | public ResultBean<List<MonitorPoint>> getmMnitorPoints(HttpServletRequest request) { |
| | |
| | | |
| | | |
| | | /** |
| | | * @Description: 获取一个设备某一个传感器的月平均值 |
| | | * @Param: [datas, devices] |
| | | * @return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/12/8 |
| | | */ |
| | | @UserLoginToken |
| | | @GetMapping("sensor-monthAvg") |
| | | public ResultBean<Map<String, Object>> getSensorMonthAvgByMac(HttpServletRequest request){ |
| | | Map<String, Object> parameters = getParametersStartingWith(request, null); |
| | | if ((!parameters.containsKey("mac"))||(!parameters.containsKey("macKey"))) |
| | | return ResultBean.fail("参数为null"); |
| | | Map<String, Object> result = historyMinutelyService.getAverageBySensor(parameters); |
| | | return new ResultBean<Map<String, Object>>(result); |
| | | } |
| | | |
| | | /** |
| | | * @Description: 获取单台设备一个小时的AQI |
| | | * @Param: [request] |
| | | * @return: com.moral.common.bean.ResultBean<java.util.Map<java.lang.String,java.lang.Object>> |
| | | * @Author: 下雨听风 |
| | | * @Date: 2020/12/8 |
| | | */ |
| | | @UserLoginToken |
| | | @GetMapping("hourly-aqi") |
| | | public ResultBean<Map<String, Object>> getHourlyAQI(HttpServletRequest request){ |
| | | Map<String, Object> parameters = getParametersStartingWith(request, null); |
| | | if (!parameters.containsKey("mac")) |
| | | return ResultBean.fail("参数为null"); |
| | | Map<String, Object> result = historyService.gitHourlyAQIByMacAndTimeslot(parameters); |
| | | return new ResultBean<Map<String, Object>>(result); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @Description: 返回结果添加设备经纬度以及state |
| | | * @Param: [datas, devices] |
| | | * @Author: 下雨听风 |