IPath.java 1.6 KB
package com.dituhui.pea.dispatch;

import com.dituhui.pea.common.Result;
import com.dituhui.pea.pojo.DistanceDTO;
import com.dituhui.pea.pojo.DistanceParam;
import org.springframework.cloud.openfeign.FeignClient;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 道路相关接口
 *
 * @author
 */
@FeignClient(value = "project-dispatch", contextId = "dispatch")
public interface IPath {

    /**
     * 获取2个订单之间的道路距离
     *
     * @param fromOrderId 出发订单id
     * @param toOrderId   到达订单id
     * @param vehicleType 交通工具:1汽车;2电动车;3自行车;4步行 默认是汽车
     * @return
     */
    @RequestMapping(value = "/pea-dispatch/getRoadDistance", method = RequestMethod.POST)
    public Result<DistanceDTO> getRoadDistance(@RequestParam("fromOrderId") String fromOrderId,
                                               @RequestParam("toOrderId") String toOrderId,
                                               @RequestParam(name = "vehicleType", required = false) Integer vehicleType);


    /**
     * 根据交通方式计算两点间距离
     *
     * @param distanceParam 参数, 包含起始点, 交通方式
     * @return 返回两点距离以及所需时间
     */
    @PostMapping("/pea-dispatch/locationDistance")
    DistanceDTO getLocationDistance(@RequestBody DistanceParam distanceParam);

}