package com.ghb.base.common.online.api.factory;

import com.ghb.base.common.online.api.IOnlineBaseExtApi;
import com.ghb.base.common.online.api.fallback.OnlineBaseExtApiFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Description: OnlineBaseExtAPIFallbackFactory
 * @author: Ghb-boot
 */
@Component
public class OnlineBaseExtApiFallbackFactory implements FallbackFactory<IOnlineBaseExtApi> {

    @Override
    public IOnlineBaseExtApi create(Throwable throwable) {
        OnlineBaseExtApiFallback fallback = new OnlineBaseExtApiFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}