package com.xiaopeng.api.factory.automaticPilot; import com.xiaopeng.api.dto.automaticPilot.VehicleBaseRespDto; import com.xiaopeng.api.feignClient.automaticPilot.OrderMissionClient; import com.xiaopeng.api.feignClient.automaticPilot.VmpOpenServiceClient; import lombok.extern.slf4j.Slf4j; import org.springframework.cloud.openfeign.FallbackFactory; import org.springframework.stereotype.Component; import java.util.Collections; import java.util.List; import java.util.Map; @Slf4j @Component public class VmpOpenServiceClientFallbackFactory implements FallbackFactory { @Override public VmpOpenServiceClient create(Throwable cause) { return new VmpOpenServiceClient(){ @Override public VehicleBaseRespDto getVehicleInfoByVin(String vin, List respList) { log.info("通过vin获取车辆基本信息失败:" + cause.getMessage()); return null; } @Override public Map getVehicleBindInfoByVin(String vin, List typeList) { log.info("查询车辆绑定信息失败:" + cause.getMessage()); return Collections.emptyMap(); } @Override public String getVinByXpuId(String xpuId, Integer type) { log.info("通过车辆绑定信息获取车架号失败:" + cause.getMessage()); return ""; } }; } }