zhanghua
2022-12-12 fd071f321fb967f36cf795fc40b4f2e87e89e69d
ycl-platform/src/main/java/com/ycl/controller/cockpit/aiIot/AIIotController.java
@@ -1,16 +1,20 @@
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;
import com.ycl.vo.cockpit.CockpitVO;
import com.ycl.vo.cockpit.aiIot.AIIotVO;
import com.ycl.vo.cockpit.aiIot.VideoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@@ -18,6 +22,7 @@
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @author Lyq
@@ -31,6 +36,12 @@
    @Resource
    private CheckApiUtil checkApiUtil;
    @Autowired
    private IVideoPointService iVideoPointService;
    @Autowired
    private VideoUtil videoUtil;
    @ApiOperation(value = "监测数据")
    @GetMapping("/detection")
@@ -47,23 +58,19 @@
    @ApiOperation(value = "实时视频监控")
    @GetMapping("/video")
    public CommonResult<List<AIIotVO.VideoVO>> video(@Validated CockpitVO params) {
    public CommonResult video(@Validated CockpitVO params) {
        checkApiUtil.cockpit(params);
        List<AIIotVO.VideoVO> videoVOS = new ArrayList<>();
        AIIotVO.VideoVO a = null;
        for (int i = 0; i < 4; i++) {
            a = new AIIotVO.VideoVO();
            a.setLongitude("32.11");
            a.setLatitude("106.111");
            a.setName("设备一");
            a.setResourceId("012");
            a.setBrand("大华");
            a.setModel("球机");
            a.setIp("10.23.14.2");
            a.setUrl("http://10.23.14.2:12001");
            videoVOS.add(a);
        }
        return CommonResult.success(videoVOS);
        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.setModel(item.getEquipmentModel());
            videoVO.setIp(item.getEquipmentIp());
            videoVO.setLatitude(item.getLatitude().toString());
            videoVO.setLongitude(item.getLongitude().toString());
            videoVO.setResourceId(item.getPlatResourceId());
            return videoVO;
        }).collect(Collectors.toList()));
    }
    @ApiOperation(value = "AI算法效能")