liujie
2026-05-12 d3d65af98906ccc78652c16be7e8a9fbdc03f258
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
package com.xiaopeng.api.factory.operation;
 
 
import com.xiaopeng.api.feignClient.operation.XpRoutePlanClient;
import com.xiaopeng.api.feignClient.operation.XpTestPlanClient;
import com.xiaopeng.api.model.operation.XpRoutePlan;
import com.xiaopeng.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
 
@Slf4j
@Component
public class XpRoutePlanClientFallbackFactory implements FallbackFactory<XpRoutePlanClient> {
    @Override
    public XpRoutePlanClient create(Throwable cause) {
        return new XpRoutePlanClient() {
            @Override
            public R<XpRoutePlan> getXpRoutePlanOpenCityId(Long openCityId) {
                log.error("根据openCityId获取路线规划配置失败:{}", cause.getMessage());
                return R.fail("根据openCityId获取路线规划配置失败");
            }
        };
    }
}