package com.ruoyi.other.api.factory;
|
|
import com.ruoyi.other.api.feignClient.GoodsClient;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 商品服务降级处理
|
*
|
* @author ruoyi
|
*/
|
@Component
|
public class GoodsFallbackFactory implements FallbackFactory<GoodsClient>
|
{
|
private static final Logger log = LoggerFactory.getLogger(GoodsFallbackFactory.class);
|
|
@Override
|
public GoodsClient create(Throwable throwable) {
|
log.error("商品调用失败:{}", throwable.getMessage());
|
return new GoodsClient() {
|
|
};
|
}
|
}
|