package com.sckw.transport.controller.enterpriseApp;

import com.alibaba.fastjson.JSONObject;
import com.sckw.core.web.response.BaseResult;
import com.sckw.transport.model.param.VehiclesTrajectoryReq;
import com.sckw.transport.service.kwfTruckTraceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * @author PC
 * app端轨迹controller
 */
@Slf4j
@RestController
@RequestMapping("/appTraceController")
@RequiredArgsConstructor
@Tag(name = "app端轨迹接口", description = "app端轨迹接口")
public class AppTraceController {

    private final kwfTruckTraceService kwfTruckTraceService;
    /**
     * 车辆轨迹上报
     * @return  统计响应结果
     */
    @PostMapping(name = "车辆轨迹上报", path = "/vehicles/trajectory")
    @Operation(summary = "车辆轨迹上报", description = "车辆轨迹上报")
    public BaseResult<Void> vehiclesTrajectory(@Valid  @RequestBody VehiclesTrajectoryReq req) {
        log.info("企业app车辆轨迹上报 请求参数 :{}", JSONObject.toJSONString(req));
        return BaseResult.success(kwfTruckTraceService.vehiclesTrajectory(req));
    }
}
