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

import com.yuchen.saas.payment.api.dto.FindOrderManageReqDTO;
import com.yuchen.saas.payment.api.dto.PageMoreOrderRefundRecordReqDTO;
import com.yuchen.saas.payment.api.dto.PageOrderManageReqDTO;
import com.yuchen.saas.payment.api.dto.SiteListDataDTO;
import com.yuchen.saas.payment.api.dto.order.*;
import com.yuchen.saas.payment.api.entity.OrderManage;
import com.yuchen.saas.payment.api.util.PayFeignFallbackUtils;
import com.yuchen.saas.payment.api.vo.OrderManageInvoiceRecordDataVO;
import com.yuchen.saas.payment.api.vo.OrderManageVO;
import com.yuchen.saas.payment.api.vo.moreOrderRefund.OrderRefundVO;
import com.yuchen.saas.payment.api.vo.moreOrderRefund.OrderRefundableCostDetailVO;
import com.yuchen.saas.payment.api.vo.moreOrderRefund.PmgBatParkPayMoreOrderRefundRecordVO;
import com.yuchen.saas.payment.api.vo.orderCenter.*;
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;

/**
 * @description: 订单管理接口熔断
 * @author mqs
 * @date 2023/5/18 15:22
 * @version 1.0
 */
@Component
public class OrderManageFeignServiceFallback implements FallbackFactory<OrderManageFeignService> {

    @Override
    public OrderManageFeignService create(Throwable throwable) {

        return new OrderManageFeignService() {

            @Override
            public R sendOrderMqAsync(OrderManageVO orderManageVO) {
                return R.error("进入熔断");
            }

            @Override
            public R createOrderManage(OrderManageVO orderManageVO){
                return R.error("进入熔断");
            }

            @Override
            public R update(OrderManage orderManage) {
                return R.error("进入熔断");
            }

            @Override
            public R remove(String id) {
                return R.error("进入熔断");
            }

            @Override
            public R detail(String id) {
                return R.error("进入熔断");
            }

            @Override
            public R<NestPage<OrderManage>> page(PageOrderManageReqDTO pageOrderManageReqDTO) {
                return R.error("进入熔断");
            }

            @Override
            public R<NestPage<OrderAllDataVO>> pageOrderAllData(UserOrderReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<OrderUnpaidVO>> pageUnpaid(UserOrderReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<OrderPaidVO>> pageOrderPaid(UserOrderReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<OrderUnpaidVO>> pageOrderClose(UserOrderReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<OrderUnpaidVO>> pageOrderUnderWayData(UserOrderReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> cancelOrderData(CancelOrderDataReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<PmgBatParkPayMoreOrderRefundRecordVO>> pageOrderRefundData(PageMoreOrderRefundRecordReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderRefundRecordDetailVO> getOrderRefundData(Long id) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<OrderRefundVO>> getOrderManageRefundRecordData(String orderNo) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderRefundableCostDetailVO> verifyRefundInfoData(VerifyRefundInfoReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Long> verifyRefundInfo(VerifyRefundInfoReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> applyStoppingOrderRefundProcess(ApplyStoppingOrderRefundReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<NestPage<OrderRefundAuditVO>> pageRefundAuditData(OrderRefundAuditReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderRefundAuditVO> getRefundAuditDetail(Long id) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> cancelStoppingOrderRefund(Long id) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManageDetailVO> getStoppingOrOccupancyDetailById(Long id) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManageDetailVO> getStoppingOrOccupancyDetailByIdV2(Long id) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManageInfoDataVO> getOrderManageInfoData(Long id) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManageInfoDataVO> getOrderInfoByPayNoAndBillNo(String payNo, String billId) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManage> createOrderManageInfoData(CreateOrderManageReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManage> createCompletedOrderData(CreateCompletedOrderReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> updateOrderManageInfoData(CreateOrderManageReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManage> noFeelPayCreateOrderData(NoFeelPayCreateOrderDataReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> exceptionCloseOrderData(CreateOrderManageReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<OrderManage>> getOrderManageListByBillIdList(FindOrderManageReqDTO reqDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<OrderManage>> listByBillNos(List<Long> billNos) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderInfoVO> getOrderInfoByCouponRecordId(Long couponRecordId) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<OrderManageInvoiceRecordDataVO>> getOrderManageInvoiceRecordData(Long orderId) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<OrderManage> getOrderDetails(Long billId, Integer orderType) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<SiteListDataDTO>> getAllSiteListByOperator(Long operator) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<OrderCouponInfoVO>> getOrderInfoByCouponRecordIdList(List<Long> couponRecordIdList) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<List<OrderManage>> getOrderInfoByOrderNo(String orderNo) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

        };
    }
}