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

import com.tofly.base.api.feign.AuthTokenService;
import com.tofly.base.api.feign.fallback.AuthTokenServiceFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author Administrator
 * @date 2019/9/12  11:47
 */
@Component
public class AuthTokenServiceFallbackFactory implements FallbackFactory<AuthTokenService> {
    @Override
    public AuthTokenService create(Throwable throwable) {
        AuthTokenServiceFallbackImpl baseTokenServiceFallback = new AuthTokenServiceFallbackImpl();
        baseTokenServiceFallback.setCause(throwable);
        return baseTokenServiceFallback;
    }
}
