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

import com.tofly.base.api.feign.BaseLogService;
import com.tofly.base.api.feign.fallback.BaseLogServiceFallbackImpl;
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 BaseLogServiceFallbackFactory implements FallbackFactory<BaseLogService> {
    @Override
    public BaseLogService create(Throwable throwable) {
        BaseLogServiceFallbackImpl baseLogServiceFallbackImpl = new BaseLogServiceFallbackImpl();
        baseLogServiceFallbackImpl.setThrowable(throwable);
        return baseLogServiceFallbackImpl;
    }
}
