fix(接口测试): 修复引用场景显示问题

--bug=1010071 --user=赵勇 【接口测试】场景,引用其他场景后,显示原始用例已删除 https://www.tapd.cn/55049933/s/1102416
This commit is contained in:
fit2-zhao 2022-02-09 18:18:51 +08:00 committed by fit2-zhao
parent a7d0475891
commit fe7d3b1d48
2 changed files with 12 additions and 1 deletions

View File

@ -192,7 +192,7 @@ public class ApiAutomationController {
@PostMapping("/getApiScenarios")
public List<ApiScenarioDTO> getApiScenarios(@RequestBody List<String> ids) {
return apiAutomationService.getApiScenarios(ids);
return apiAutomationService.getNewApiScenarios(ids);
}
@PostMapping(value = "/run/debug")

View File

@ -728,6 +728,17 @@ public class ApiAutomationService {
return new ArrayList<>();
}
public List<ApiScenarioDTO> getNewApiScenarios(List<String> ids) {
List<ApiScenarioDTO> list = new LinkedList<>();
if (CollectionUtils.isNotEmpty(ids)) {
ids.forEach(item -> {
ApiScenarioDTO dto = this.getNewApiScenario(item);
list.add(dto);
});
}
return list;
}
public byte[] loadFileAsBytes(FileOperationRequest fileOperationRequest) {
if (fileOperationRequest.getId().contains("/") || fileOperationRequest.getName().contains("/"))
MSException.throwException(Translator.get("invalid_parameter"));