package com.prolog.rdc.tms.controller;

import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.log.aop.annotation.UserLog;
import com.prolog.rdc.tms.service.ShipBillGpsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hongbo.pan
 * @date 2022/9/20
 */
@RestController
@Api(tags = "在途管理-运单定位/轨迹")
@RequestMapping("/shipBill/gps")
public class ShipBillGpsController {

    @Autowired
    private ShipBillGpsService service;

    @UserLog("运单轨迹")
    @ApiOperation(value = "运单轨迹", notes = "运单轨迹")
    @PostMapping("/getTrackByShipBillId/{positionType}")
    public RestMessage<Object> getTrackByShipBillId(@PathVariable(required = false) String positionType, @RequestParam("shipBillId") String shipBillId) {
        return RestMessage.newInstance(true, "查询成功！", service.getTrackByShipBillId(positionType, shipBillId));
    }

}
