Pu Zhibing
2025-03-26 cbf2486983b77a27af9968bbb362cb8d43789115
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
package com.ruoyi.other.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.GoodsArea;
import com.ruoyi.other.api.feignClient.GoodsAreaClient;
import org.springframework.cloud.openfeign.FallbackFactory;
 
/**
 * @author zhibing.pu
 * @Date 2024/11/27 20:29
 */
public class GoodsAreaClientFallbackFactory implements FallbackFactory<GoodsAreaClient> {
    
    
    @Override
    public GoodsAreaClient create(Throwable cause) {
        return new GoodsAreaClient() {
            
            @Override
            public R<GoodsArea> getGoodsArea(GoodsArea area) {
                return R.fail("根据省市区获取地区价格配置失败:" + cause.getMessage());
            }
        };
    }
}