refactor(测试计划): 优化接口列表返回值&查询sql
This commit is contained in:
parent
12cda645a4
commit
d083774987
|
@ -67,4 +67,7 @@ public class TestPlanApiScenarioPageResponse implements Serializable {
|
||||||
|
|
||||||
@Schema(description = "状态")
|
@Schema(description = "状态")
|
||||||
private String status;
|
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<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);
|
List<TestPlanApiCase> getSelectIdAndCollectionId(@Param("request") TestPlanApiCaseBatchRequest request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -702,6 +702,7 @@
|
||||||
api_case_id
|
api_case_id
|
||||||
FROM
|
FROM
|
||||||
test_plan_api_case
|
test_plan_api_case
|
||||||
|
where test_plan_api_case.test_plan_id = #{testPlanId}
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -93,6 +93,7 @@
|
||||||
api_scenario.project_id,
|
api_scenario.project_id,
|
||||||
api_scenario.create_user,
|
api_scenario.create_user,
|
||||||
api_scenario.status,
|
api_scenario.status,
|
||||||
|
api_scenario.id as apiScenarioId,
|
||||||
test_plan_api_scenario.create_time,
|
test_plan_api_scenario.create_time,
|
||||||
test_plan_api_scenario.environment_id,
|
test_plan_api_scenario.environment_id,
|
||||||
api_scenario.module_id,
|
api_scenario.module_id,
|
||||||
|
|
|
@ -551,7 +551,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
if (CollectionUtils.isNotEmpty(apiCaseList)) {
|
if (CollectionUtils.isNotEmpty(apiCaseList)) {
|
||||||
List<String> ids = apiCaseList.stream().flatMap(item -> item.getIds().stream()).toList();
|
List<String> ids = apiCaseList.stream().flatMap(item -> item.getIds().stream()).toList();
|
||||||
boolean isRepeat = testPlanConfigService.isRepeatCase(testPlan.getId());
|
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 -> {
|
apiCaseList.forEach(apiCase -> {
|
||||||
List<String> apiCaseIds = apiCase.getIds();
|
List<String> apiCaseIds = apiCase.getIds();
|
||||||
if (CollectionUtils.isNotEmpty(apiCaseIds)) {
|
if (CollectionUtils.isNotEmpty(apiCaseIds)) {
|
||||||
|
@ -684,6 +684,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预生成用例的执行报告
|
* 预生成用例的执行报告
|
||||||
|
*
|
||||||
* @return
|
* @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) {
|
||||||
|
|
Loading…
Reference in New Issue