|
@@ -3,6 +3,7 @@ package com.usky.system.factory;
|
|
|
|
|
|
import com.usky.common.core.bean.ApiResult;
|
|
import com.usky.common.core.bean.ApiResult;
|
|
import com.usky.system.RemoteMceService;
|
|
import com.usky.system.RemoteMceService;
|
|
|
|
+import com.usky.system.domain.MceRequestVO;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
|
@@ -10,24 +11,25 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 消息服务降级处理
|
|
* 消息服务降级处理
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
-public class RemoteMceFallbackFactory implements FallbackFactory<RemoteMceService>
|
|
|
|
-{
|
|
|
|
|
|
+public class RemoteMceFallbackFactory implements FallbackFactory<RemoteMceService> {
|
|
private static final Logger log = LoggerFactory.getLogger(RemoteMceFallbackFactory.class);
|
|
private static final Logger log = LoggerFactory.getLogger(RemoteMceFallbackFactory.class);
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public RemoteMceService create(Throwable throwable)
|
|
|
|
- {
|
|
|
|
|
|
+ public RemoteMceService create(Throwable throwable) {
|
|
log.error("用户服务调用失败:{}", throwable.getMessage());
|
|
log.error("用户服务调用失败:{}", throwable.getMessage());
|
|
- return new RemoteMceService()
|
|
|
|
- {
|
|
|
|
|
|
+ return new RemoteMceService() {
|
|
@Override
|
|
@Override
|
|
- public ApiResult<Void> addMce(String mceInfo)
|
|
|
|
- {
|
|
|
|
- return ApiResult.error("500","新增消息失败:" + throwable.getMessage());
|
|
|
|
|
|
+ public ApiResult<Void> addMce(String mceInfo) {
|
|
|
|
+ return ApiResult.error("500", "新增消息失败:" + throwable.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ApiResult<Void> addMceReceive(MceRequestVO mceInfo) {
|
|
|
|
+ return ApiResult.error("500", "新增消息失败:" + throwable.getMessage());
|
|
}
|
|
}
|
|
};
|
|
};
|
|
}
|
|
}
|