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

import com.yuchen.saas.parking.api.param.AuditMonthlyCardParam;
import com.yuchen.saas.parking.api.param.ReplacePlateNoCancelParam;
import com.yuchen.saas.parking.api.param.ReplacePlateNoRecordAddParam;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.RefundCardVo;
import com.yuchen.saas.parking.api.vo.ReplacePlateNoRecordAppVo;
import com.yuchen.saas.parking.api.vo.VehicleMonthlyCardDataVo;
import com.yuchen.saas.parking.api.vo.VehicleMonthlyCardDetailVo;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

/**
 * @ClassName VisitorClient
 * @Description 访客 feign 接口熔断
 * @Author 张逸飞
 * @Date 2022/6/16 15:50
 */
@Component
public class VehicleMonthlyCardDataClientFallback implements FallbackFactory<VehicleMonthlyCardDataClient> {
    @Override
    public VehicleMonthlyCardDataClient create(Throwable throwable) {
        return new VehicleMonthlyCardDataClient() {
            @Override
            public R createMonthlyCardPay(String payUserId, Long id, Integer number) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R getMonthlyCardBill(String payUserId, Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R monthlyCardPaySuccess(Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R delMonthlyCard(Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R applyFree(VehicleMonthlyCardDataVo cardDataVo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R applyReplace(ReplacePlateNoRecordAddParam replacePlateNoRecord) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

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

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

            @Override
            public R appCancelReplace(ReplacePlateNoCancelParam param) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R countByParkCompany(Long parkId, Long companyId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R getRefundInfo(Long id, Long refundTime) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Long> getRefundMoney(Long billId, Long refundTime) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R cancelCard(Long id) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R refundCard(RefundCardVo refundCardVo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

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

            @Override
            public R auditData(AuditMonthlyCardParam param) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R getAuditPage(String payUserId, String personPhone, Integer current, Integer size) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R applyMonthlyCard(VehicleMonthlyCardDataVo cardDataVo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R updateMonthlyCard(VehicleMonthlyCardDataVo cardDataVo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };
    }
}
