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获取路线规划配置失败");
|
}
|
};
|
}
|
}
|