package com.clx.performance.controller.temp;

import com.clx.performance.param.temp.DriverTraceAddParam;
import com.clx.performance.param.temp.TruckTraceAddParam;
import com.clx.performance.service.trace.TruckTraceService;
import com.clx.performance.vo.pc.trace.DriverTraceVO;
import com.clx.performance.vo.pc.trace.DriverTruckTraceVO;
import com.msl.common.result.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;


/**
 * @Author: aiqingguo
 * @Description: 临时接口
 * @Date: 2023-8-21 12:10:16
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping(value="/temp/trace")
public class TempTraceController {

    @Autowired
    private TruckTraceService truckTraceService;

    @ApiOperation(value = "车辆轨迹同步", notes = "<br>By:艾庆国")
    @PostMapping("/truckTraceSync")
    public Result truckTraceSync(@RequestBody TruckTraceAddParam param) {

        truckTraceService.truckTraceSave(param);

        return Result.ok();
    }

    @ApiOperation(value = "查询车辆轨迹", notes = "<br>By:艾庆国")
    @PostMapping("/listTruckTraceByTime")
    public Result<List<DriverTruckTraceVO>> listTruckTraceByTime(String truckNo, String beginTime, String endTime) {

        return Result.ok(truckTraceService.listTruckTraceByTime(truckNo,beginTime,endTime));
    }

    @ApiOperation(value = "司机轨迹同步", notes = "<br>By:艾庆国")
    @PostMapping("/driverTraceSync")
    public Result driverTraceSync(@RequestBody DriverTraceAddParam param) {

        truckTraceService.driverTraceSave(param);

        return Result.ok();
    }

    @ApiOperation(value = "查询司机轨迹", notes = "<br>By:艾庆国")
    @PostMapping("/listDriverTraceByTime")
    public Result<List<DriverTraceVO>> listDriverTraceByTime(Long userNo, String beginTime, String endTime) {

        return Result.ok(truckTraceService.listDriverTraceByTime(userNo,beginTime,endTime));
    }

}
