package com.xiaopeng.api.factory.maintenance;
|
|
import com.xiaopeng.api.feignClient.maintenance.XpCheckLocationClient;
|
import com.xiaopeng.api.model.maintenance.XpCheckLocation;
|
import com.xiaopeng.common.core.domain.R;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 打卡地址Feign客户端降级工厂
|
*
|
* @author mitao
|
* @since 2026-02-13
|
*/
|
@Slf4j
|
@Component
|
public class XpCheckLocationClientFallbackFactory implements FallbackFactory<XpCheckLocationClient> {
|
|
@Override
|
public XpCheckLocationClient create(Throwable cause) {
|
log.error("打卡地址服务调用失败: {}", cause.getMessage());
|
return new XpCheckLocationClient() {
|
@Override
|
public R<XpCheckLocation> queryById(Long id) {
|
log.error("远程调用获取检查点位信息异常:{}", cause.getMessage());
|
return R.fail("远程调用获取检查点位信息异常");
|
}
|
};
|
}
|
}
|