实现充电回滚服务所有方法,解决编译问题
This commit is contained in:
parent
f969d2dc9a
commit
a2089e517f
@ -2,21 +2,51 @@ package com.xhpc.common.api.factory;
|
|||||||
|
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.xhpc.common.api.PowerPileService;
|
import com.xhpc.common.api.PowerPileService;
|
||||||
|
import com.xhpc.common.data.down.StartChargingData;
|
||||||
|
import com.xhpc.common.data.redis.CacheRateModel;
|
||||||
|
import com.xhpc.common.data.up.OrderData;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class PowerPileFallbackFactory implements FallbackFactory<PowerPileService> {
|
public class PowerPileFallbackFactory implements FallbackFactory<PowerPileService> {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(PowerPileFallbackFactory.class);
|
private static final Logger logger = LoggerFactory.getLogger(PowerPileFallbackFactory.class);
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PowerPileService create(Throwable cause) {
|
public PowerPileService create(Throwable cause) {
|
||||||
|
|
||||||
logger.error("充电订单服务调用失败:{} //fallback", cause.getMessage());
|
logger.error("充电订单服务调用失败:{} //fallback", cause.getMessage());
|
||||||
return startChargingData -> R.fail("启动充电失败:" + cause.getMessage());
|
return new PowerPileService() {
|
||||||
|
@Override
|
||||||
|
public R<OrderData> startCharging(StartChargingData startChargingData) {
|
||||||
|
|
||||||
|
return R.fail("启动充电失败:" + cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R addPileWhitelist(Set<String> whitelist) {
|
||||||
|
|
||||||
|
return R.fail("增加充电桩白名单失败:" + cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R deletePileWhitelist(String pileNo) {
|
||||||
|
|
||||||
|
return R.fail("删除充电桩白名单失败:" + cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R setStationRateModelId(Long stationId, Long rateModelId, CacheRateModel rateModel) {
|
||||||
|
|
||||||
|
return R.fail("设置电站费率模型失败:" + cause.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user