package com.yifu.cloud.plus.v1.provider.feign.factory;

import com.yifu.cloud.plus.v1.provider.feign.RemoteProviderService;
import com.yifu.cloud.plus.v1.provider.feign.fallback.RemoteProviderServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

//异常回调工厂
@Component
public class RemoteProviderServiceFallbackFactory implements FallbackFactory<RemoteProviderService> {
	@Override
	public RemoteProviderService create(Throwable cause) {
		RemoteProviderServiceFallbackImpl remoteProviderServiceFallback = new RemoteProviderServiceFallbackImpl();
		remoteProviderServiceFallback.setCause(cause);
		return remoteProviderServiceFallback;
	}
}
