无关风月
2024-08-30 d33c34c76e74dbacf1bf7a57d7d3109e2bc54e68
ruoyi-api/ruoyi-api-order/src/main/java/com/ruoyi/order/api/factory/ChargingOrderFallbackFactory.java
@@ -1,6 +1,9 @@
package com.ruoyi.order.api.factory;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.api.feignClient.ChargingOrderClient;
import com.ruoyi.order.api.model.TChargingOrder;
import com.ruoyi.order.api.query.TChargingCountQuery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -20,7 +23,32 @@
    public ChargingOrderClient create(Throwable throwable) {
        log.error("充电订单调用失败:{}", throwable.getMessage());
        return new ChargingOrderClient() {
            @Override
            public R<Long> useOrderCount(Long userId) {
                return R.fail("订单计数:" + throwable.getMessage());
            }
            @Override
            public R<TChargingOrder> orderDetail(Long orderId) {
                return R.fail("订单详情:" + throwable.getMessage());
            }
            @Override
            public R<Integer> getChargingCount(TChargingCountQuery req) {
                return R.fail("根据会员id和有效期查询有效期内享受充电折扣次数:" + throwable.getMessage());
            }
            @Override
            public R<TChargingOrder> getOrderDetailByGunId(Integer chargingGunId) {
                return R.fail("根据充电枪获取正在充电的订单:" + throwable.getMessage());
            }
            @Override
            public R<Long> getCar() {
                return R.fail("获取用户最近使用车辆充电的车辆id:" + throwable.getMessage());
            }
        };
    }
}