package com.yida.data.device.fallback;

import com.yida.data.common.core.annotation.Fallback;
import com.yida.data.common.core.common.ResultBean;
import com.yida.data.device.feign.consume.RemoteConsumeOrderService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * RemoteConsumeOrderService fallback处理类
 *
 * @author ZYJ
 * @date 2023/4/3
 */
@Slf4j
@Fallback
public class RemoteConsumeOrderServiceFallback implements FallbackFactory<RemoteConsumeOrderService> {

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

        return new RemoteConsumeOrderService() {

            @Override
            public ResultBean<String> updateOrderStatus() {
                return null;
            }

            @Override
            public ResultBean<String> updateRefundStatus() {
                return null;
            }
        };
    }
}
