liujie
2026-03-09 bbdd5f4f286fc593c5c30bd1bccd1f39af135dfa
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
package com.xiaopeng.api.factory.vehicleConvoy;
 
import com.xiaopeng.api.dto.vehicleConvoy.BaseImOpenDto;
import com.xiaopeng.api.feignClient.vehicleConvoy.VehicleControlClient;
import com.xiaopeng.api.vo.vehicleConvoy.VehiclesCommandVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
 
import java.util.Set;
 
@Slf4j
public class VehicleControlClientFallbackFactory implements FallbackFactory<VehicleControlClient> {
    @Override
    public VehicleControlClient create(Throwable cause) {
        return new VehicleControlClient() {
            @Override
            public BaseImOpenDto queryVehicleTemperature(String appId, String nonce, String accessToken, String sign, String openId, String vin, Set<String> stateList, String uid) {
                log.error("查询车辆内温度失败:{}", cause.getMessage());
                return null;
            }
 
            @Override
            public BaseImOpenDto vehiclesCommand(String appId, String nonce, String accessToken, String sign, String openId, VehiclesCommandVo vo, Long uid) {
                log.error("车辆控制失败:{}", cause.getMessage());
                return null;
            }
        };
    }
}