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

import com.yuchen.saas.parking.api.dto.coupon.*;
import com.yuchen.saas.parking.api.entity.coupon.PmgBatCouponRecord;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.coupon.*;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class PmgBatCouponFeignClientFallback implements FallbackFactory<PmgBatCouponFeignClient> {

    @Override
    public PmgBatCouponFeignClient create(Throwable throwable) {
        return new PmgBatCouponFeignClient() {
            @Override
            public R<List<PmgBatCouponCardAppVO>> getCouponCardAppList(Long companyId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<PmgBatCouponCardAppVO>> getMyCouponCardAppList(String phone) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatCouponCardVO> getCouponCardDetailById(Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<PmgBatCouponRecordUseDetailAppVO>> getAppCouponCardUseDetail(Long couponCardId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatDistributeCouponResVO> distributeCoupon(PmgBatCouponRecordDTO couponRecordDTO) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatCouponRecordScanVO> getCouponRecordScanInfo(Long couponId, Long qrCodeId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatCouponRecord> receiveCoupon(PmgBatCouponReceiveDTO couponReceiveDTO) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<PmgBatMyAppCouponRecordVO>> getAppMyCouponRecordPageList(PmgBatMyAppCouponRecordQueryDTO queryDTO) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatCouponQrCodeVO> createQrCode(PmgBatCouponQrCodeDTO couponQrCodeDTO) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> couponCardBindVisitor(PmgBatCouponCardBindVisitorDTO bindVisitorDTO) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<PmgBatCouponRecordVO> getCouponRecordById(Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
