无关风月
2025-02-17 dfd423f90894d24081e7d7da08d09498898ee9c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.ruoyi.other.api.factory;
 
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.feignClient.SystemConfigurationClient;
import org.springframework.cloud.openfeign.FallbackFactory;
 
/**
 * @author zhibing.pu
 * @Date 2025/2/17 9:46
 */
public class SystemConfigurationClientFallbackFactory  implements FallbackFactory<SystemConfigurationClient> {
    @Override
    public SystemConfigurationClient create(Throwable cause) {
        return new SystemConfigurationClient() {
            @Override
            public R<String> getServerPhone() {
                return R.fail("获取客服电话失败:" + cause.getMessage());
            }
        };
    }
}