zhanghua
2022-12-12 fd071f321fb967f36cf795fc40b4f2e87e89e69d
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java
@@ -1,6 +1,8 @@
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;
@@ -40,6 +42,7 @@
    @Autowired
    private VideoUtil videoUtil;
    @ApiOperation(value = "监测数据")
    @GetMapping("/detection")
    public CommonResult<AIIotVO.DetectionVO> detection(@Validated CockpitVO params) {
@@ -56,8 +59,8 @@
    @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());
@@ -65,7 +68,7 @@
            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()));
    }