package com.sptg.video.cloud.api.feigns.fallback;

import com.sptg.video.cloud.api.entity.SysParams;
import com.sptg.video.cloud.api.feigns.SysParamsFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author zwx
 * @create 2020/10/16 18:17
 */
@Slf4j
@Component
public class SysParamsFeignFallbackFactory implements FallbackFactory<SysParamsFeign> {
    @Override
    public SysParamsFeign create(Throwable cause) {
        return new SysParamsFeign() {
            @Override
            public SysParams findSysParamsById(Long id) {
                log.error(cause.getMessage(),cause);
                return null;
            }
        };
    }
}
