luodangjia
2024-08-07 980d0d6571f4b50b51502ee60094a3dbdf1fb2f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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() {
        
        };
    }
}