package com.xiaopeng.api.factory.operation;
|
|
import com.xiaopeng.api.feignClient.operation.XpTestPlanClient;
|
import com.xiaopeng.api.model.map.XpTestPoint;
|
import com.xiaopeng.api.model.operation.XpTestPlan;
|
import com.xiaopeng.api.model.operation.XpTestPlanPoint;
|
import com.xiaopeng.api.model.operation.XpTestPlanVehicle;
|
import com.xiaopeng.common.core.domain.R;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
@Slf4j
|
@Component
|
public class XpTestPlanClientFallbackFactory implements FallbackFactory<XpTestPlanClient> {
|
@Override
|
public XpTestPlanClient create(Throwable cause) {
|
return new XpTestPlanClient() {
|
|
|
@Override
|
public R<XpTestPlan> getXpTestPlanById(Long id) {
|
log.error("获取测试计划失败:{}", cause.getMessage());
|
return R.fail("获取测试计划失败");
|
}
|
|
@Override
|
public R<XpTestPlanPoint> getXpTestPlanPointById(Long id) {
|
log.error("获取测试计划点失败:{}", cause.getMessage());
|
return R.fail("获取测试计划点失败");
|
}
|
|
@Override
|
public R<XpTestPoint> getXpTestPointById(Long id) {
|
log.error("获取测试点失败:{}", cause.getMessage());
|
return R.fail("获取测试点失败");
|
}
|
@Override
|
public R<List<XpTestPlanVehicle>> getXpTestPlanVehicleByTestPlanId(Long testPlanId) {
|
log.error("获取测试计划车辆失败:{}", cause.getMessage());
|
return R.fail("获取测试计划车辆失败");
|
}
|
};
|
}
|
}
|