package com.ruoyi.other.api.factory;
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.other.api.domain.SystemConfig;
|
import com.ruoyi.other.api.feignClient.SystemConfigClient;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
import java.math.BigDecimal;
|
|
/**
|
* @author zhibing.pu
|
* @Date 2024/11/29 15:58
|
*/
|
public class SystemConfigClientFallbackFactory implements FallbackFactory<SystemConfigClient> {
|
@Override
|
public SystemConfigClient create(Throwable cause) {
|
return new SystemConfigClient() {
|
@Override
|
public R<SystemConfig> getSystemConfig(Integer type) {
|
return R.fail("根据类型获取系统配置失败:" + cause.getMessage());
|
}
|
|
@Override
|
public R<BigDecimal> redPackegeSet() {
|
return R.fail("根据红包配置失败:" + cause.getMessage());
|
}
|
};
|
}
|
}
|