package com.sptg.permissions.api.feigns.fallback;

import com.sptg.permissions.api.entity.ApiDockingConf;
import com.sptg.permissions.api.feigns.ApiDockingConfFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * title: RoleFeignFallbackFactory
 * package: com.sptg.permissions.api.feigns.fallback
 * description: api接口配置参数对外服务接口容错处理
 *
 *               
 *                 
 */
@Component
@Slf4j
public class ApiDockingConfFeignFallbackFactory implements FallbackFactory<ApiDockingConfFeign> {

    @Override
    public ApiDockingConfFeign create(Throwable cause) {
        return new ApiDockingConfFeign(){
            @Override
            public ApiDockingConf selectEntityById(Long orgId) {
                log.error(cause.getMessage(), cause);
                return null;
            }
        };
    }
}
