package com.ruoyi.integration.api.factory;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.integration.api.feignClient.PlatformStartChargingReplyClient;
|
import com.ruoyi.integration.api.model.PlatformStartChargingReply;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2024/8/31 15:16
|
*/
|
@Component
|
public class PlatformStartChargingReplyFallbackFactory implements FallbackFactory<PlatformStartChargingReplyClient> {
|
|
private static final Logger log = LoggerFactory.getLogger(PlatformStartChargingReplyFallbackFactory.class);
|
|
|
@Override
|
public PlatformStartChargingReplyClient create(Throwable throwable) {
|
log.error("远程启机应答调用失败:{}", throwable.getMessage());
|
return new PlatformStartChargingReplyClient(){
|
|
@Override
|
public R<List<PlatformStartChargingReply>> getPlatformStartChargingReply(String code) {
|
return R.fail("根据订单编号查询远程启机应答结果失败:" + throwable.getMessage());
|
}
|
};
|
}
|
}
|