package com.sooka.sponest.monitor.remoteapi.fallback.center.middleground;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.SysUser;
import com.sooka.sponest.monitor.remoteapi.service.center.middleground.RemoteMiddleGroundService;
import com.sooka.sponest.monitor.remoteapi.service.center.system.RemoteService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @program: ruoyi
 * @description: yy
 * @author: yy
 * @create: 2022-06-16 11:05
 **/
@Component
public class RemoteMiddleGroundBaseServiceFallbackFactory implements FallbackFactory<RemoteMiddleGroundService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteMiddleGroundBaseServiceFallbackFactory.class);

    @Override
    public RemoteMiddleGroundService create(Throwable cause) {
        log.error("中台服务-服务调用失败:{}", cause.getMessage());

        return new RemoteMiddleGroundService() {
            @Override
            public String command(@RequestBody String data){
                return null;
            }
        };
    }
}
