From b08015c71131852d953dd284ed1417dac7ff07f0 Mon Sep 17 00:00:00 2001 From: John Bro <42930107+john1298308460@users.noreply.github.com> Date: Tue, 21 Jun 2022 15:18:33 +0800 Subject: [PATCH] Update ApiScenarioReportService.java MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 格式化代码 --- .../api/service/ApiScenarioReportService.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index bb56c88886..e3cef9eb96 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -997,13 +997,18 @@ public class ApiScenarioReportService { return apiScenarioReportStructureService.selectReportContent(stepId); } - public void cleanUpUiReportImg(List ids){ - if(ids != null && CollectionUtils.isNotEmpty(ids)){ - for(String id : ids){ - if(FileUtil.deleteDir(new File(FileUtils.UI_IMAGE_DIR + "/" + id))){ - LogUtil.info("删除 UI 报告截图成功,报告 ID 为 :" + id); + public void cleanUpUiReportImg(List ids) { + try { + if (ids != null && CollectionUtils.isNotEmpty(ids)) { + for (String id : ids) { + if (FileUtil.deleteDir(new File(FileUtils.UI_IMAGE_DIR + "/" + id))) { + LogUtil.info("删除 UI 报告截图成功,报告 ID 为 :" + id); + } } } + } catch (Exception e) { + LogUtil.error(e.getMessage(), e); + MSException.throwException(e.getMessage()); } } }