package com.ghb.base.modules.test.feign.factory;




import org.springframework.cloud.openfeign.FallbackFactory;
import com.ghb.base.modules.test.feign.client.GhbTestClient;
import com.ghb.base.modules.test.feign.fallback.GhbTestFallback;
import org.springframework.stereotype.Component;

/**
 * @author qinfeng
 */
@Component
public class GhbTestClientFactory implements FallbackFactory<GhbTestClient> {

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