package com.ruoyi.chargingPile.api.factory;
|
|
import com.ruoyi.chargingPile.api.feignClient.ParkingRecordClient;
|
import com.ruoyi.chargingPile.api.model.TParkingRecord;
|
import com.ruoyi.chargingPile.api.vo.GetParkingRecord;
|
import com.ruoyi.common.core.domain.R;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.stereotype.Component;
|
|
|
/**
|
* 停车场服务降级处理
|
*
|
* @author ruoyi
|
*/
|
@Component
|
public class ParkingRecordFallbackFactory implements org.springframework.cloud.openfeign.FallbackFactory<ParkingRecordClient>
|
{
|
private static final Logger log = LoggerFactory.getLogger(ParkingRecordFallbackFactory.class);
|
|
@Override
|
public ParkingRecordClient create(Throwable throwable) {
|
log.error("停车记录调用失败:{}", throwable.getMessage());
|
return new ParkingRecordClient() {
|
|
|
@Override
|
public R<TParkingRecord> getParkingRecord(GetParkingRecord query) {
|
return R.fail("根据车牌和状态查询停车数据失败:" + throwable.getMessage());
|
}
|
|
@Override
|
public void updateParkingRecord(TParkingRecord parkingRecord) {
|
|
}
|
|
@Override
|
public R<TParkingRecord> getParkingRecordById(Long id) {
|
return R.fail("根据id获取数失败:" + throwable.getMessage());
|
}
|
|
@Override
|
public R<TParkingRecord> getParkingRecordByChargingOrderId(Long chargingOrderId) {
|
return R.fail("根据充电订单id获取数据失败:" + throwable.getMessage());
|
}
|
|
@Override
|
public R<TParkingRecord> getParkingRecordByChargingOrderId(Long chargingOrderId) {
|
return R.fail("根据充电订单id获取数据失败:" + throwable.getMessage());
|
}
|
|
@Override
|
public void addParkingRecord(TParkingRecord parkingRecord) {
|
}
|
};
|
}
|
}
|