mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-11-30 11:08:38 +08:00
refactor(测试计划): 优化接口列表返回值&查询sql
This commit is contained in:
parent
12cda645a4
commit
d083774987
@ -67,4 +67,7 @@ public class TestPlanApiScenarioPageResponse implements Serializable {
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "场景用例的id")
|
||||
private String apiScenarioId;
|
||||
}
|
@ -69,7 +69,7 @@ public interface ExtTestPlanApiCaseMapper {
|
||||
|
||||
List<TestPlanApiCase> getApiCaseExecuteInfoByIds(@Param("ids") List<String> ids);
|
||||
|
||||
List<ApiTestCase> selectApiCaseByDefinitionIds(@Param("ids") List<String> ids, @Param("isRepeat") boolean isRepeat);
|
||||
List<ApiTestCase> selectApiCaseByDefinitionIds(@Param("ids") List<String> ids, @Param("isRepeat") boolean isRepeat, @Param("testPlanId") String testPlanId);
|
||||
|
||||
List<TestPlanApiCase> getSelectIdAndCollectionId(@Param("request") TestPlanApiCaseBatchRequest request);
|
||||
}
|
||||
|
@ -702,6 +702,7 @@
|
||||
api_case_id
|
||||
FROM
|
||||
test_plan_api_case
|
||||
where test_plan_api_case.test_plan_id = #{testPlanId}
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
@ -93,6 +93,7 @@
|
||||
api_scenario.project_id,
|
||||
api_scenario.create_user,
|
||||
api_scenario.status,
|
||||
api_scenario.id as apiScenarioId,
|
||||
test_plan_api_scenario.create_time,
|
||||
test_plan_api_scenario.environment_id,
|
||||
api_scenario.module_id,
|
||||
|
@ -551,7 +551,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||
if (CollectionUtils.isNotEmpty(apiCaseList)) {
|
||||
List<String> ids = apiCaseList.stream().flatMap(item -> item.getIds().stream()).toList();
|
||||
boolean isRepeat = testPlanConfigService.isRepeatCase(testPlan.getId());
|
||||
List<ApiTestCase> apiTestCaseList = extTestPlanApiCaseMapper.selectApiCaseByDefinitionIds(ids, isRepeat);
|
||||
List<ApiTestCase> apiTestCaseList = extTestPlanApiCaseMapper.selectApiCaseByDefinitionIds(ids, isRepeat, testPlan.getId());
|
||||
apiCaseList.forEach(apiCase -> {
|
||||
List<String> apiCaseIds = apiCase.getIds();
|
||||
if (CollectionUtils.isNotEmpty(apiCaseIds)) {
|
||||
@ -684,9 +684,10 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||
|
||||
/**
|
||||
* 预生成用例的执行报告
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ApiTestCaseRecord initApiReport(ApiTestCase apiTestCase, TestPlanApiCase testPlanApiCase, String reportId, ApiRunModeConfigDTO runModeConfig, String userId) {
|
||||
public ApiTestCaseRecord initApiReport(ApiTestCase apiTestCase, TestPlanApiCase testPlanApiCase, String reportId, ApiRunModeConfigDTO runModeConfig, String userId) {
|
||||
// 初始化报告
|
||||
ApiReport apiReport = apiTestCaseService.getApiReport(apiTestCase, reportId, runModeConfig.getPoolId(), userId);
|
||||
apiReport.setEnvironmentId(runModeConfig.getEnvironmentId());
|
||||
|
Loading…
Reference in New Issue
Block a user