package com.pj.api.client.transport;

import com.pj.api.FeignInterceptor;
import com.pj.api.consts.FeignConsts;
import com.pj.api.dto.DriverDto;
import com.pj.api.dto.PurchaserDto;
import com.pj.api.dto.TbLogisticsDto;
import com.pj.api.dto.VehicleDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author Mechrevo
 * @Date 2023 07 27 17 02
 **/
@FeignClient(
        name = FeignConsts.TRANSPORT_SERVER, 				// 服务名称
        configuration = FeignInterceptor.class,		// 请求拦截器
        fallbackFactory = TransportInterfaceFallback.class	// 服务降级
)
public interface TransportInterface {

    /** 根据ID查商户 */
    @RequestMapping("rpc/getByPurchaserId")
    public PurchaserDto getByPurchaserId(@RequestParam("id") Long id);

    /** 查司机信息 - 根据id */
    @RequestMapping("/app/TbDriver/rpc/getById")
    public DriverDto getByDriverId(@RequestParam("id") Long id);

    /** 根据二级订单的ID查询物流信息 */
    @RequestMapping("/TbLogistics/rpc/selectByOrderId")
    public TbLogisticsDto selectByOrderId(@RequestParam("orderId") Long orderId);

    /** 添加司机信息 */
    @RequestMapping("driverDto")
    public boolean driverDto(@RequestBody DriverDto driverDto);

    /** 同步航通车辆信息 */
    @RequestMapping("/TbVehicle/rpc/vehicleDto")
    public boolean vehicleDto(@RequestBody VehicleDto vehicleDto);

}
