yeg
2026-09-01 0fcd0642efdff8d4e0584fa991aaea2178bc932b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.ruoyi.system.service.impl;
 
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.system.mapper.TTestMapper;
import com.ruoyi.system.service.ITTestService;
import com.ruoyi.system.service.ITestDataQueryService;
 
/** 测试数据查询模块;实现不访问设备或模拟器历史。 */
@Service
public class TestDataQueryServiceImpl implements ITestDataQueryService
{
    private final TTestMapper mapper;
    private final ITTestService tests;
 
    public TestDataQueryServiceImpl(TTestMapper mapper, ITTestService tests)
    {
        this.mapper = mapper;
        this.tests = tests;
    }
 
    @Override public List<Map<String, Object>> records(Long testId)
    {
        requireTest(testId);
        return mapper.selectPersistedRecords(testId);
    }
 
    @Override public List<Map<String, Object>> steps(Long testId)
    {
        requireTest(testId);
        return mapper.selectPersistedSteps(testId);
    }
 
    @Override public List<Map<String, Object>> cycles(Long testId)
    {
        requireTest(testId);
        return mapper.selectPersistedCycles(testId);
    }
 
    private void requireTest(Long testId)
    {
        if (testId == null || tests.selectTestById(testId) == null)
            throw new ServiceException("测试不存在");
    }
}