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

import com.yuchen.saas.payment.api.entity.PmgBatParkPayRefund;
import com.yuchen.saas.payment.api.vo.*;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName ParkPayRefundFeignServiceFallback
 * @Description 支付退款远程接口熔断
 * @Author 张逸飞
 * @Date 2022年11月19日 14:34:04
 */
@Component
public class ParkPayRefundFeignServiceFallback implements FallbackFactory<ParkPayRefundFeignService> {

    @Override
    public ParkPayRefundFeignService create(Throwable cause) {

        return new ParkPayRefundFeignService() {

            @Override
            public PmgBatParkPayRefund getRefundByOrderNumber(String orderNumber) {
                return new PmgBatParkPayRefund();
            }

            @Override
            public R<List<PmgBatParkPayRefundVo>> getRefundList(PmgBatParkPayRefundDto dto) {
                return null;
            }

            @Override
            public R<List<TempRefundExcelVO>> getTempRefundListByExport(PmgBatParkPayRefundDto dto) {
                return null;
            }

            @Override
            public R<List<MonthlyRefundExcelVO>> getMonthlyRefundListByExport(PmgBatParkPayRefundDto dto) {
                return null;
            }

            @Override
            public R<List<StaggeredRefundExcelVO>> getStaggeredRefundListByExport(PmgBatParkPayRefundDto dto) {
                return null;
            }


            @Override
            public R<PmgBatParkPayRefund> createRefund(CreateRefundVo refundVo) {
                return R.fail("远程调用失败");
            }

            @Override
            public R cancelRefund(CancelRefundVo refundVo) {
                return R.fail("远程调用失败");
            }

            @Override
            public R<List<PmgBatParkPayRefund>> myRefundList() {
                return R.data(new ArrayList<>());
            }
        };
    }
}
