| | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.system.service.ITestLiveService; |
| | | import com.ruoyi.system.service.ITestIntegrityService; |
| | | |
| | | /** 测试控制台实时 REST/SSE 入口,仅负责鉴权和协议转发。 */ |
| | | @RestController |
| | |
| | | public class TTestLiveController extends BaseController |
| | | { |
| | | private final ITestLiveService liveService; |
| | | private final ITestIntegrityService integrityService; |
| | | public TTestLiveController(ITestLiveService liveService, ITestIntegrityService integrityService) |
| | | { this.liveService = liveService; this.integrityService = integrityService; } |
| | | public TTestLiveController(ITestLiveService liveService) |
| | | { this.liveService = liveService; } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:test:query')") |
| | | @GetMapping("/{testId}/live-state") |
| | | public AjaxResult liveState(@PathVariable Long testId) { return success(liveService.current(testId)); } |
| | | |
| | | /** 查询测试完整性问题和可追溯的历史异常事实。 */ |
| | | @PreAuthorize("@ss.hasPermi('system:test:query')") |
| | | @GetMapping("/{testId}/integrity") |
| | | public AjaxResult integrity(@PathVariable Long testId) { return success(integrityService.selectIssues(testId)); } |
| | | |
| | | @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); } |