package com.yuchen.saas.parking.api.feign.order.fallback;

import com.yuchen.saas.parking.api.entity.*;
import com.yuchen.saas.parking.api.feign.order.ParkingOrderBillDataClientFeign;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.order.MonthlyCardBillDataVO;
import com.yuchen.saas.parking.api.vo.order.OrderManageDetailDto;
import com.yuchen.saas.parking.api.vo.order.OrderPmgBatParkBillVo;
import com.yuchen.saas.parking.api.vo.order.StaggeredMonthlyCardBillDataVO;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author zhouhanwei
 * @create 2023/6/16 13:51
 */
@Component
public class ParkingOrderBillDataClientFeignFallback implements FallbackFactory<ParkingOrderBillDataClientFeign> {
    @Override
    public ParkingOrderBillDataClientFeign create(Throwable throwable) {
        return new ParkingOrderBillDataClientFeign() {

            @Override
            public R<PmgBatParkBill> getUnpaidParkingBillData(Long billId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatParkBill> getPayParkingBillData(Long paymentId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Map<Long, OrderPmgBatParkBillVo>> getPayParkingBillDataByPaymentIds(List<Long> paymentIds) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<VehicleOccupancyFeeBill> getUnpaidOccupancyFeeBillData(Long billId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<VehicleOccupancyFeeBill> getPayOccupancyFeeBillData(Long paymentId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<MonthlyCardBillDataVO> getMonthlyCardBillData(Long billId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<MonthlyCardBillDataVO>> getMonthlyCardBillDataByPlateNo(String plateNo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<MonthlyCardBillDataVO>> getMonthlyCardBillDataList(List<Long> billIdList) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<StaggeredMonthlyCardBillDataVO>> getTimeFreeCardBillDataByPlateNo(String plateNo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<StaggeredMonthlyCardBillDataVO>> getStaggeredMonthlyCardBillDataList(List<Long> billIdList) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<PmgBatParkBillPayment>> getParkingBillDataByPlateNo(String plateNo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<PmgBatParkBillPayment>> getBillPaymentByPlateNo(String plateNo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<StaggeredMonthlyCardBillDataVO> getStaggeredMonthlyCardBillData(Long billId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }


            @Override
            public R<OrderManageDetailDto> getOrderManageDetail(Long billId, String orderType,String orderStats) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Map<Long,PmgBatParkingSettlementRatio>> getParkingSettlementRatio() {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
