liujie
2026-05-18 df7ea92f6e128abf309d389bd99ffc4602ee2049
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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<VmpOpenServiceClient> {
    @Override
    public VmpOpenServiceClient create(Throwable cause) {
        return new VmpOpenServiceClient(){
 
            @Override
            public VehicleBaseRespDto getVehicleInfoByVin(String vin, List<String> respList) {
                log.info("通过vin获取车辆基本信息失败:" + cause.getMessage());
                return null;
            }
 
            @Override
            public Map<String, String> getVehicleBindInfoByVin(String vin, List<String> typeList) {
                log.info("查询车辆绑定信息失败:" + cause.getMessage());
                return Collections.emptyMap();
            }
 
            @Override
            public String getVinByXpuId(String xpuId, Integer type) {
                log.info("通过车辆绑定信息获取车架号失败:" + cause.getMessage());
                return "";
            }
        };
    }
}