package com.ningdatech.carapi.car.position.controller;

import com.ningdatech.carapi.car.position.manage.PositionMonitorManage;
import com.ningdatech.carapi.car.position.model.po.ReqRealTimeMonitorPO;
import com.ningdatech.carapi.car.position.model.po.ReqTrajectoryDataPO;
import com.ningdatech.carapi.car.position.model.vo.ResRealTimeMonitorStatisticsVO;
import com.ningdatech.carapi.car.position.model.vo.ResRealTimeMonitorVehicleGisListVO;
import com.ningdatech.carapi.car.position.model.vo.ResTrajectoryDataVO;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @author liuxinxin
 * @date 2022/10/8 上午10:25
 */

@RestController
@RequestMapping(value = "/api/v1/car-manage/position-monitor")
@Api(tags = "车辆管理-定位监控")
@Validated
@RequiredArgsConstructor
public class PositionMonitorController {

    private final PositionMonitorManage positionMonitorManage;

    @PostMapping("/trajectory-data-list")
    @ApiOperation("获取车辆轨迹数据列表(无分页)")
    @WebLog
    public List<ResTrajectoryDataVO> trajectoryDatalist(@Valid @RequestBody ReqTrajectoryDataPO po) {
        return positionMonitorManage.trajectoryDatalist(po);
    }

    @PostMapping("/real-time-monitor-statistics")
    @ApiOperation("实时监控数量统计")
    public ResRealTimeMonitorStatisticsVO realTimeMonitorStatistics(@Valid @RequestBody ReqRealTimeMonitorPO po) {
        return positionMonitorManage.realTimeMonitorStatistics(po);
    }

    @PostMapping("/real-time-monitor-vehicle-gis-list")
    @ApiOperation("实时监控车辆gis列表")
    public List<ResRealTimeMonitorVehicleGisListVO> realTimeMonitorVehicleGisList(@Valid @RequestBody ReqRealTimeMonitorPO po) {
        return positionMonitorManage.realTimeMonitorVehicleGisList(po);
    }
}
