package com.ningdatech.carapi.open.controller;

import java.util.List;

import javax.validation.Valid;

import com.ningdatech.basic.model.PageVo;
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 com.ningdatech.carapi.car.position.model.po.ReqTrajectoryDataPO;
import com.ningdatech.carapi.car.position.model.vo.ResRealTimeMonitorVehicleGisListVO;
import com.ningdatech.carapi.car.position.model.vo.ResTrajectoryDataVO;
import com.ningdatech.carapi.open.manage.OpenCarPositionManage;
import com.ningdatech.carapi.open.model.po.ReqRealTimeCapPositionPO;
import com.ningdatech.log.annotation.WebLog;

import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-10-09
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/open/api/car/position")
@RequiredArgsConstructor
public class OpenApiCarPositionController {

    private final OpenCarPositionManage openCarPositionManage;

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

    @PostMapping("/real-time-monitor-vehicle-gis-data")
    @ApiOperation("实时监控车辆gis数据")
    @WebLog
    public PageVo<ResRealTimeMonitorVehicleGisListVO> realTimeMonitorVehicleGisData(@Valid @RequestBody ReqRealTimeCapPositionPO po) {
        return openCarPositionManage.realTimeMonitorAllGisList(po);
    }
}
