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

import com.yuchen.saas.payment.api.dto.order.OrderRefundAppealApplyDTO;
import com.yuchen.saas.payment.api.dto.order.OrderRefundAppealCancleDTO;
import com.yuchen.saas.payment.api.util.PayFeignFallbackUtils;
import feign.hystrix.FallbackFactory;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.stereotype.Component;

@Component
public class OrderAppealFeignFallback implements FallbackFactory<OrderAppealFeign>  {

    @Override
    public OrderAppealFeign create(Throwable throwable) {

        return new OrderAppealFeign() {
            @Override
            public R<Boolean> appealApply(OrderRefundAppealApplyDTO applyDto) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }

            @Override
            public R<Boolean> appealCancle(OrderRefundAppealCancleDTO cancleDTO) {
                return PayFeignFallbackUtils.printLogAndReturn(throwable);
            }
        };

    }
}
