| | |
| | | */ |
| | | @PostMapping("/delete/{id}") |
| | | public ResponseVO<Object> deleteMonitor(@PathVariable Long id) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_DELETE.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean result = monitorService.deleteMonitor(id); |
| | | if (result) { |
| | | return ResponseUtil.success(null); |
| | |
| | | */ |
| | | @PostMapping("/addYSYMonitor") |
| | | public ResponseVO<Object> addYSYMonitor(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_ADD.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | if (monitorParam == null || monitorParam.getDeviceSerial() == null) { |
| | | throw new BusinessException("参数不正确!"); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/getYSYMonitorInfo") |
| | | public ResponseVO<Object> getYSYMonitorInfo(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_INFO.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | YSY_MonitorDto getMonitorDto = monitorService.getYSYMonitorInfo(monitorService.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | |
| | | if ("200".equals(getMonitorDto.getCode())) { |
| | |
| | | */ |
| | | @PostMapping("/getMonitorVideoUrl") |
| | | public ResponseVO<Object> getMonitorVideoUrl(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_VIDEO_URL.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | String URL = monitorService.getMonitorVideoUrl(monitorService.getAccessToken(), |
| | | monitorParam.getDeviceSerial(), monitorParam.getProtocol(), monitorParam.getExpireTime()); |
| | | |
| | |
| | | */ |
| | | @PostMapping("/updateNotes") |
| | | public ResponseVO<Object> updateNotes(@RequestBody MonitorParam monitorParam) { |
| | | if (!permissionConfig.check(MenuEnum.MONITOR_NOTES.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | boolean flag = monitorService.updateNotes(monitorParam.getDeviceSerial(), monitorParam.getNotes()); |
| | | if (flag) { |
| | | return ResponseUtil.success("修改备注成功!"); |