| | |
| | | package com.xiaopeng.api.factory.map; |
| | | |
| | | import com.xiaopeng.api.dto.WeatherDTO; |
| | | import com.xiaopeng.api.dto.map.OrderRouteAndFareDto; |
| | | import com.xiaopeng.api.dto.map.RouteAndFareDto; |
| | | import com.xiaopeng.api.feignClient.map.XpMapClient; |
| | |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class XpMapClientFallbackFactory implements FallbackFactory<XpMapClient> { |
| | |
| | | return new XpMapClient(){ |
| | | @Override |
| | | public R<RouteVo> getDistanceAndDuration(RouteAndFareDto dto) { |
| | | log.error("获取距离和时长失败:{}", cause.getMessage()); |
| | | return R.fail("获取距离和时长失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<RouteVo>> getDistanceAndDurationList(RouteAndFareDto dto) { |
| | | log.error("获取距离和时长失败:{}", cause.getMessage()); |
| | | return R.fail("获取距离和时长失败"); |
| | | } |
| | |
| | | log.error("判断是否同一经营区域失败:{}", cause.getMessage()); |
| | | return R.fail("判断是否同一经营区域失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R<WeatherDTO> wether(String cityCode) { |
| | | log.error("获取天气失败:{}", cause.getMessage()); |
| | | return R.fail("获取天气失败"); |
| | | } |
| | | }; |
| | | } |
| | | } |