package com.ruoyi.business.api.factory;

import com.ruoyi.business.api.RemoteBusinessService;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

/**
 * @Description: 平台业务模块服务降级处理
 * @ClassName: RemoteBusinessFallbackFactory
 * @Author  : xins
 * @Date    :2023-09-20  20:25
 * @Version :1.0
 */
public class RemoteBusinessFallbackFactory implements FallbackFactory<RemoteBusinessService> {
    @Override
    public RemoteBusinessService create(Throwable throwable) {
        return new RemoteBusinessService() {
            @Override
            public R<?> computeOnlineDevicecCount(int days) {
                return R.fail("获取租户信息失败:" + throwable.getMessage());
            }
        };
    }
}
