From b9e79cec6e195ce77cd9094c82d70e6c9f145d76 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Fri, 13 Nov 2020 16:37:56 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E4=BF=9D=E5=AD=98jtl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/performance/service/ReportService.java | 4 ++++ backend/src/main/resources/i18n/messages_en_US.properties | 1 + backend/src/main/resources/i18n/messages_zh_CN.properties | 1 + backend/src/main/resources/i18n/messages_zh_TW.properties | 1 + 4 files changed, 7 insertions(+) diff --git a/backend/src/main/java/io/metersphere/performance/service/ReportService.java b/backend/src/main/java/io/metersphere/performance/service/ReportService.java index 95ae5c3736..c92f68298e 100644 --- a/backend/src/main/java/io/metersphere/performance/service/ReportService.java +++ b/backend/src/main/java/io/metersphere/performance/service/ReportService.java @@ -13,6 +13,7 @@ import io.metersphere.commons.utils.ServiceUtils; import io.metersphere.controller.request.OrderRequest; import io.metersphere.dto.LogDetailDTO; import io.metersphere.dto.ReportDTO; +import io.metersphere.i18n.Translator; import io.metersphere.performance.base.*; import io.metersphere.performance.controller.request.DeleteReportRequest; import io.metersphere.performance.controller.request.ReportRequest; @@ -277,6 +278,9 @@ public class ReportService { public byte[] downloadJtl(String reportId) { LoadTestReportWithBLOBs report = getReport(reportId); + if (StringUtils.isBlank(report.getFileId())) { + MSException.throwException(Translator.get("load_test_report_file_not_exist")); + } return fileService.loadFileAsBytes(report.getFileId()); } } diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index ea9fe501cc..604cf385c7 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -48,6 +48,7 @@ related_case_del_fail_prefix=Connected to related_case_del_fail_suffix=TestCase, please disassociate first jmx_content_valid=JMX content is invalid container_delete_fail=The container failed to stop, please try again +load_test_report_file_not_exist=There is no JTL file in the current report, please execute it again to get it #workspace workspace_name_is_null=Workspace name cannot be null workspace_name_already_exists=The workspace name already exists diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 7745c3acd2..72ae06238d 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -48,6 +48,7 @@ related_case_del_fail_prefix=已关联到 related_case_del_fail_suffix=测试用例,请先解除关联 jmx_content_valid=JMX 内容无效,请检查 container_delete_fail=容器由于网络原因停止失败,请重试 +load_test_report_file_not_exist=当前报告没有JTL文件,请重新执行以便获取 #workspace workspace_name_is_null=工作空间名不能为空 workspace_name_already_exists=工作空间名已存在 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 32411f615d..1d6e4d8889 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -48,6 +48,7 @@ related_case_del_fail_prefix=已關聯到 related_case_del_fail_suffix=測試用例,請先解除關聯 jmx_content_valid=JMX 內容無效,請檢查 container_delete_fail=容器由於網絡原因停止失敗,請重試 +load_test_report_file_not_exist=當前報告沒有JTL文件,請重新執行以便獲取 #workspace workspace_name_is_null=工作空間名不能為空 workspace_name_already_exists=工作空間名已存在