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

import com.yuchen.saas.parking.api.entity.StaggeredMonthChargeRule;
import com.yuchen.saas.parking.api.entity.StaggeredMonthlyCardBillData;
import com.yuchen.saas.parking.api.util.SaasParkingFeignFallbackUtils;
import com.yuchen.saas.parking.api.vo.RefundCardVo;
import com.yuchen.saas.parking.api.vo.StaggeredMonthlyCardBillDataVo;
import com.yuchen.saas.parking.api.vo.StaggeredMonthlyCardDataVo;
import com.yuchen.saas.parking.api.vo.StaggeredMonthlyCardDetailVo;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName StaggeredMonthlyCardClientFallback
 * @Description 调用core-service的错时停车接口回调类
 * * @Author 肖润飞
 * * @Date 2022/9/23 16:42
 */
@Component
public class StaggeredMonthlyCardClientFallback implements FallbackFactory<StaggeredMonthlyCardClient> {
    @Override
    public StaggeredMonthlyCardClient create(Throwable throwable) {
        return new StaggeredMonthlyCardClient() {
            @Override
            public R getAuditPage(String payUserId, String personPhone, Integer current, Integer size) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

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

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

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

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

            @Override
            public R<StaggeredMonthlyCardBillData> createMonthlyCardPay(String payUserId, Long id, Integer number) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

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

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

            @Override
            public R<List<StaggeredMonthChargeRule>> getStaggeredRule(Long parkId, Long parkingId) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

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

            @Override
            public R residueByRuleId(Long parkId, Long ruleId) {
                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 refundCard(RefundCardVo refundCardVo) {
                return SaasParkingFeignFallbackUtils.printLogAndReturn(throwable);
            }

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