yeg
2026-08-30 86f3b4c6f15987ed9599c8a110534dfed2d9fdfd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.ruoyi.system.service;
 
import java.time.Instant;
import java.util.List;
import java.util.Map;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
 
/** 提供测试控制台的双状态实时事实与鉴权 SSE。 */
public interface ITestLiveService
{
    /** 返回指定测试及其绑定来源的最新设备、接收和测试状态。 */
    LiveState current(Long testId);
 
    /** 打开实时 SSE;连接初次发送当前事实,后续只推送最新快照。 */
    SseEmitter stream(Long testId);
    record LiveState(Long testId, String testStatus, String receptionStatus, Instant updatedAt,
            List<LiveSource> sources, List<Map<String, Object>> exceptions) { }
    record LiveSource(String sourceType, Long sourceId, String batteryNo, String deviceStatus,
            Map<String, Object> latestSnapshot) { }
}