yeg
2026-09-05 92f32acd847ea1700590bc669750f23ef499840e
ruoyi-admin/src/main/java/com/battery/business/web/TTestLiveController.java
File was renamed from ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TTestLiveController.java
@@ -1,4 +1,4 @@
package com.ruoyi.web.controller.system;
package com.battery.business.web;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -9,7 +9,7 @@
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.service.ITestLiveService;
import com.battery.business.service.ITestLiveService;
/** 测试控制台实时 REST/SSE 入口,仅负责鉴权和协议转发。 */
@RestController
@@ -17,8 +17,9 @@
public class TTestLiveController extends BaseController
{
    private final ITestLiveService liveService;
    public TTestLiveController(ITestLiveService liveService)
    { this.liveService = liveService; }
    private final TestLiveStream stream;
    public TTestLiveController(ITestLiveService liveService, TestLiveStream stream)
    { this.liveService = liveService; this.stream = stream; }
    @PreAuthorize("@ss.hasPermi('system:test:query')")
    @GetMapping("/{testId}/live-state")
@@ -27,5 +28,5 @@
    /** 推送实时快照、设备状态和可追溯的异常事实。 */
    @PreAuthorize("@ss.hasPermi('system:test:query')")
    @GetMapping(value = "/{testId}/live", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public SseEmitter live(@PathVariable Long testId) { return liveService.stream(testId); }
    public SseEmitter live(@PathVariable Long testId) { return stream.stream(testId); }
}