添加人流测试点接口

This commit is contained in:
wuweida 2022-06-07 16:40:47 +08:00
parent bb6029cce9
commit 1721ee0f9b
5 changed files with 63 additions and 30 deletions

View File

@ -1,30 +0,0 @@
package com.hisense.monitormanage.controller;
import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.service.PassengerFlowService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@RestController
@Api("实时人流")
@RequestMapping("api/project/passenger")
public class PassengerFlowController {
@Autowired
private PassengerFlowService passengerFlowService;
@GetMapping("selectPassengerFlow")
public Result selectPassengerFlow(List<Double> vertX, List<Double> vertY,String timeId){
List<Double> list = new ArrayList<>();
Integer integer = passengerFlowService.pnpolyAlgorithm(vertX, vertY, timeId);
Result success = Result.success(integer);
return success;
}
}

View File

@ -0,0 +1,36 @@
package com.hisense.monitormanage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hisense.monitormanage.entity.PassengerTest;
import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.mapper.PassengerTestMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@Api("人流测试点")
@RequestMapping("api/project/passenger")
public class PassengerTestController {
@Autowired
private PassengerTestMapper passengerTestMapper;
/**
* 查询全部人流测试点
* @return
*/
@GetMapping("selectPassengerTest")
@ApiOperation("查询全部人流测试点")
public Result selectPassengerTest(){
QueryWrapper<PassengerTest> queryWrapper = new QueryWrapper<>();
List<PassengerTest> passengerTests = passengerTestMapper.selectList(queryWrapper);
Result success = Result.success(passengerTests);
return success;
}
}

View File

@ -0,0 +1,15 @@
package com.hisense.monitormanage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("t_passenger_test")
public class PassengerTest {
@TableId
private Integer id;
private double longitude;
private double latitude;
private String label;
}

View File

@ -0,0 +1,7 @@
package com.hisense.monitormanage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hisense.monitormanage.entity.PassengerTest;
public interface PassengerTestMapper extends BaseMapper<PassengerTest> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hisense.monitormanage.mapper.PassengerTestMapper">
</mapper>