package com.yuchen.saas.parking.charge.api.feign;

import com.yuchen.saas.parking.charge.api.entity.charge.SpcChargeBill;
import com.yuchen.saas.parking.charge.api.util.ParkChargingFeignFallbackUtils;
import com.yuchen.saas.parking.charge.api.vo.charge.*;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class SpcChargeBillFeignFallback implements FallbackFactory<SpcChargeBillFeignClient> {

    @Override
    public SpcChargeBillFeignClient create(Throwable throwable) {
        return new SpcChargeBillFeignClient() {
            @Override
            public R<SpcChargeBillVO> getChargeBillById(Long billId) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<SpcAdminChargeBillVO> getChargeBill(Long billId) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<ChargeTmlChargingCashVO> getChargingBill(Long billId) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public Boolean updateInvoicingStatus(String ids,String payUserId, int invoicingStatus) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable).isSuccess();
            }

            @Override
            public R<List<SpcChargeBill>> getChargeBillDataByPlateNo(String plateNo) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<SpcAdminChargeBillVO>> getChargeBillDataList(List<Long> billIdList) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<SpcChargeBillFinacalExcelVo>> exportChargeOrderData(List<Long> billIdList) {
                return ParkChargingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }

}
