37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
package com.securityControl.system.api.factory;
|
|
|
|
|
|
import com.securityControl.common.core.domain.R;
|
|
import com.securityControl.system.api.RemoteProteamService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Slf4j
|
|
@Component
|
|
public class RemoteProteamFallbackFactory implements FallbackFactory<RemoteProteamService> {
|
|
|
|
@Override
|
|
public RemoteProteamService create(Throwable throwable) {
|
|
|
|
log.error("工程班组服务调用失败:{}", throwable.getMessage());
|
|
return new RemoteProteamService() {
|
|
@Override
|
|
public R<Object> asyncDeviceList(String source) {
|
|
return R.fail("同步第三方设备数据失败:" + throwable.getMessage());
|
|
}
|
|
|
|
@Override
|
|
public R<Object> catchPicture(String source) {
|
|
return R.fail("单次抓图调用失败:" + throwable.getMessage());
|
|
}
|
|
|
|
@Override
|
|
public R<Object> downloadPic(String source) {
|
|
return R.fail("下载图片转交人工智能平台调用失败:" + throwable.getMessage());
|
|
}
|
|
};
|
|
|
|
}
|
|
}
|