소스 검색

update 优化 sse 自动装配

疯狂的狮子Li 11 달 전
부모
커밋
1619edb8a1
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/config/SseAutoConfiguration.java

+ 8 - 0
ruoyi-common/ruoyi-common-sse/src/main/java/org/dromara/common/sse/config/SseAutoConfiguration.java

@@ -1,5 +1,6 @@
 package org.dromara.common.sse.config;
 
+import org.dromara.common.sse.controller.SseController;
 import org.dromara.common.sse.core.SseEmitterManager;
 import org.dromara.common.sse.listener.SseTopicListener;
 import org.springframework.boot.autoconfigure.AutoConfiguration;
@@ -8,6 +9,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
 import org.springframework.context.annotation.Bean;
 
 /**
+ * SSE 自动装配
+ *
  * @author Lion Li
  */
 @AutoConfiguration
@@ -25,4 +28,9 @@ public class SseAutoConfiguration {
         return new SseTopicListener();
     }
 
+    @Bean
+    public SseController sseController(SseEmitterManager sseEmitterManager) {
+        return new SseController(sseEmitterManager);
+    }
+
 }