package com.ard.work.api.factory;
|
|
import com.ard.common.core.domain.R;
|
import com.ard.work.api.RemoteTubesService;
|
import com.ard.work.api.RemoteWellService;
|
import com.ard.work.api.domian.ArdTubes;
|
import com.ard.work.api.domian.ArdTubesDetails;
|
import com.ard.work.api.domian.ArdWell;
|
import com.ard.work.api.domian.ArdWellGuideCamera;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
import org.springframework.stereotype.Component;
|
|
import java.util.List;
|
|
/**
|
* 井服务降级处理
|
*
|
* @author ard
|
*/
|
@Component
|
public class RemoteWellFallbackFactory implements FallbackFactory<RemoteWellService>
|
{
|
private static final Logger log = LoggerFactory.getLogger(RemoteWellFallbackFactory.class);
|
|
@Override
|
public RemoteWellService create(Throwable throwable)
|
{
|
log.error("井服务调用失败:{}", throwable.getMessage());
|
return new RemoteWellService()
|
{
|
@Override
|
public R<List<ArdWell>> listRpc(ArdWell ardWell, String source) {
|
return R.fail(" 井管理列表:" + throwable.getMessage());
|
}
|
@Override
|
public R<ArdWell> infoRpc(String id, String source) {
|
return R.fail(" 井详细信息:" + throwable.getMessage());
|
}
|
@Override
|
public R<List<ArdWellGuideCamera>> guideListRpc(ArdWellGuideCamera ardWellGuideCamera, String source) {
|
return R.fail(" 井引导详细列表:" + throwable.getMessage());
|
}
|
};
|
}
|
}
|