| | |
| | | package com.ycl.controller.cockpit.aiIot; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.entity.video.VideoPoint; |
| | | import com.ycl.service.video.impl.IVideoPointService; |
| | | import com.ycl.util.CheckApiUtil; |
| | | import com.ycl.util.VideoUtil; |
| | |
| | | @Autowired |
| | | private VideoUtil videoUtil; |
| | | |
| | | |
| | | @ApiOperation(value = "监测数据") |
| | | @GetMapping("/detection") |
| | | public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO params) { |
| | |
| | | @ApiOperation(value = "实时视频监控") |
| | | @GetMapping("/video") |
| | | public CommonResult video(@Validated CockpitVO params) { |
| | | //checkApiUtil.cockpit(params); |
| | | return CommonResult.success(iVideoPointService.list().stream().map(item -> { |
| | | checkApiUtil.cockpit(params); |
| | | return CommonResult.success(iVideoPointService.list(new LambdaQueryWrapper<VideoPoint>().eq(params.getStreetId()==null,VideoPoint::getStreetId,params.getStreetId())).stream().map(item -> { |
| | | VideoVO videoVO = new VideoVO(); |
| | | videoVO.setName(item.getName()); |
| | | videoVO.setBrand(item.getEquipmentBrand()); |
| | |
| | | videoVO.setIp(item.getEquipmentIp()); |
| | | videoVO.setLatitude(item.getLatitude().toString()); |
| | | videoVO.setLongitude(item.getLongitude().toString()); |
| | | videoVO.setUrl(videoUtil.getVideo(item.getPlatResourceId(), "HLS", 0)); |
| | | videoVO.setResourceId(item.getPlatResourceId()); |
| | | return videoVO; |
| | | }).collect(Collectors.toList())); |
| | | } |