package com.yida.data.school.fallback.transaction;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.school.feign.transaction.RemoteProductOrderService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteProductOrderService fallback处理类
 *
 * @author ZYJ
 * @date 2022/8/26
 */
@Slf4j
@Fallback
public class RemoteProductOrderServiceFallback implements FallbackFactory<RemoteProductOrderService> {

    @Override
    public RemoteProductOrderService create(Throwable throwable) {
        log.error("RemoteProductOrderService fallback reason:{}", throwable.getMessage());

        return new RemoteProductOrderService() {
            /**
             * 更新订单状态
             *
             * @return
             */
            @Override
            public ResultBean updateOrderStatus() {
                return null;
            }

            /**
             * 更新退款订单状态
             *
             * @return
             */
            @Override
            public ResultBean updateRefundStatus() {
                return null;
            }
        };
    }
}
