package com.xiaopeng.api.factory.operation;
|
|
import com.xiaopeng.api.feignClient.operation.XpTestPointClient;
|
import com.xiaopeng.api.model.map.XpTestPoint;
|
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 XpTestPointClientFallbackFactory implements FallbackFactory<XpTestPointClient> {
|
@Override
|
public XpTestPointClient create(Throwable cause) {
|
return new XpTestPointClient() {
|
|
@Override
|
public R<XpTestPoint> queryById(Long id) {
|
log.error("获取点位详情失败:{}", cause.getMessage());
|
return R.fail("获取点位详情失败");
|
}
|
@Override
|
public R<Boolean> nowInTimePoint(Long pointId) {
|
log.error("判断点位是在有效期内失败:{}", cause.getMessage());
|
return R.fail("判断点位是在有效期内失败");
|
}
|
};
|
}
|
}
|