package com.tofly.base.api.feign.factory;

import com.tofly.base.api.feign.BaseEsLogService;
import com.tofly.base.api.feign.fallback.BaseEsLogServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 * @date 2019/9/3  14:58
 */
@Component
@Slf4j
public class BaseEsLogServiceFallbackFactory implements FallbackFactory<BaseEsLogService> {
    @Override
    public BaseEsLogService create(Throwable throwable) {
        BaseEsLogServiceFallbackImpl baseLogServiceFallbackImpl = new BaseEsLogServiceFallbackImpl();
        baseLogServiceFallbackImpl.setThrowable(throwable);
        return baseLogServiceFallbackImpl;
    }
}
