Sfoglia il codice sorgente

临期提醒 解决定时任务执行报错

zhulu 10 mesi fa
parent
commit
c7ef1d2c56

+ 2 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/RemoteMessageSendService.java

@@ -3,6 +3,7 @@ package com.xunmei.system.api;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.constant.ServiceNameConstants;
 import com.xunmei.common.core.web.domain.AjaxResult;
+import com.xunmei.system.api.factory.RemoteMessageSendFallbackFactory;
 import com.xunmei.system.api.factory.RemoteRetrievalTaskFallbackFactory;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -15,7 +16,7 @@ import java.time.LocalDate;
  * @author :LuoWei
  * @date : 2023/9/19
  */
-@FeignClient(contextId = "remoteMessageSendService", value = ServiceNameConstants.CORE_SERVICE, fallbackFactory = RemoteRetrievalTaskFallbackFactory.class)
+@FeignClient(contextId = "remoteMessageSendService", value = ServiceNameConstants.CORE_SERVICE, fallbackFactory = RemoteMessageSendFallbackFactory.class)
 public interface RemoteMessageSendService {
     /**
      * 每天扫描,生成任务

+ 33 - 3
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/factory/RemoteMessageSendFallbackFactory.java

@@ -1,7 +1,7 @@
 package com.xunmei.system.api.factory;
 
+import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.system.api.RemoteMessageSendService;
-import com.xunmei.system.api.RemoteRetrievalTaskService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.cloud.openfeign.FallbackFactory;
@@ -16,7 +16,37 @@ public class RemoteMessageSendFallbackFactory implements FallbackFactory<RemoteM
     private static final Logger log = LoggerFactory.getLogger(RemoteMessageSendService.class);
     @Override
     public RemoteMessageSendService create(Throwable cause) {
-        log.error("监控调阅服务调用失败:{}", cause.getMessage());
-        return null;
+        return new RemoteMessageSendService() {
+
+            @Override
+            public AjaxResult timedTransmission(String source) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult resumptionRemind(String source) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult font(String source) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult centre(String source) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult after(String source) {
+                return null;
+            }
+
+            @Override
+            public AjaxResult allDay(String source) {
+                return null;
+            }
+        };
     }
 }

+ 2 - 1
soc-api/soc-api-system/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -17,4 +17,5 @@ com.xunmei.system.api.factory.RemoteSafetyIndexFallbackFactory
 com.xunmei.system.api.factory.RemoteLetterFallbackFactory
 com.xunmei.system.api.factory.RemoteMediatorFallbackFactory
 com.xunmei.system.api.factory.RemoteReminderFallbackFactory
-com.xunmei.system.api.factory.RemoteHostFallbackFactory
+com.xunmei.system.api.factory.RemoteHostFallbackFactory
+com.xunmei.system.api.factory.RemoteMessageSendFallbackFactory