package com.ruoyi.integration.api.factory;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.integration.api.feignClient.TCECClient;
|
import com.ruoyi.integration.api.vo.StartChargeResult;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
import java.util.List;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2025/1/24 10:33
|
*/
|
public class TCECClientFallbackFactory implements FallbackFactory<TCECClient> {
|
@Override
|
public TCECClient create(Throwable cause) {
|
|
|
return new TCECClient() {
|
@Override
|
public R pushChargingGunStatus(Integer id, Integer status) {
|
return R.fail("接口状态变化后推送给第三方失败:" + cause.getMessage());
|
}
|
|
@Override
|
public R notificationStartChargeResult(StartChargeResult result) {
|
return R.fail("启动充电结果推送失败:" + cause.getMessage());
|
}
|
|
@Override
|
public R notificationEquipChargeStatus(String startChargeSeq, Integer operatorId) {
|
return R.fail("推送充电状态失败:" + cause.getMessage());
|
}
|
|
@Override
|
public R notificationStopChargeResult(String startChargeSeq, String connectorID, Integer operatorId) {
|
return R.fail("推送停止充电结果失败:" + cause.getMessage());
|
}
|
|
|
@Override
|
public R notificationChargeOrderInfo(String startChargeSeq, Integer operatorId) {
|
return R.fail("推送订单信息失败:" + cause.getMessage());
|
}
|
|
@Override
|
public R notificationStationChange(List<Integer> siteIds) {
|
return R.fail("站点变更推送通知失败:" + cause.getMessage());
|
}
|
};
|
}
|
}
|