Kaynağa Gözat

add
创建长期记忆体

lifang 3 ay önce
ebeveyn
işleme
a1a9d075f1

+ 0 - 44
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/app/controller/SseController.java

@@ -1,44 +0,0 @@
-package cn.tr.module.smart.app.controller;
-
-import cn.dev33.satoken.annotation.SaIgnore;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
-
-import javax.annotation.PostConstruct;
-import java.io.IOException;
-import java.time.LocalTime;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.stream.Stream;
-
-@RestController
-@SaIgnore
-public class SseController {
-    private final ExecutorService executorService = Executors.newFixedThreadPool(10);
-    @PostConstruct
-    public void init(){
-        System.out.println("123");
-    }
-    @GetMapping(value = "/sse/stream",  produces = MediaType.TEXT_EVENT_STREAM_VALUE + ";charset=UTF-8")
-    public SseEmitter stream() {
-        SseEmitter emitter = new SseEmitter(Long.MAX_VALUE);
-
-        executorService.execute(() -> {
-            try {
-                for (int i = 0; i < 10; i++) {
-                    emitter.send(SseEmitter.event()
-                            .name("message")
-                            .data("当前时间:" + LocalTime.now()));
-                    Thread.sleep(1000); // 每秒发送一次
-                }
-                emitter.complete();
-            } catch (IOException | InterruptedException e) {
-                emitter.completeWithError(e);
-            }
-        });
-
-        return emitter;
-    }
-}

+ 0 - 2
tr-modules/tr-module-smartFollowUp/src/main/java/cn/tr/module/smart/common/controller/BaiLianPluginsController.java

@@ -14,8 +14,6 @@ import lombok.AllArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.security.auth.login.LoginContext;
-
 @Api(tags = "百炼插件",hidden = true)
 @RestController
 @RequestMapping("/bailian/plugins")