From 7c968eda3526599175aef881df9476a0b4c5e401 Mon Sep 17 00:00:00 2001 From: haifeng414 Date: Thu, 20 Feb 2020 12:43:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=E7=9B=B4=E6=8E=A5=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=B9=B6=E8=BF=90=E8=A1=8C=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/controller/LoadTestController.java | 4 ++-- .../src/main/java/io/metersphere/service/LoadTestService.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/LoadTestController.java b/backend/src/main/java/io/metersphere/controller/LoadTestController.java index b626437a22..9e99fcb198 100644 --- a/backend/src/main/java/io/metersphere/controller/LoadTestController.java +++ b/backend/src/main/java/io/metersphere/controller/LoadTestController.java @@ -33,11 +33,11 @@ public class LoadTestController { } @PostMapping(value = "/save", consumes = {"multipart/form-data"}) - public void save( + public String save( @RequestPart("request") SaveTestPlanRequest request, @RequestPart(value = "file") MultipartFile file ) { - loadTestService.save(request, file); + return loadTestService.save(request, file); } @PostMapping(value = "/edit", consumes = {"multipart/form-data"}) diff --git a/backend/src/main/java/io/metersphere/service/LoadTestService.java b/backend/src/main/java/io/metersphere/service/LoadTestService.java index 43e99a3f0d..50e7abeb61 100644 --- a/backend/src/main/java/io/metersphere/service/LoadTestService.java +++ b/backend/src/main/java/io/metersphere/service/LoadTestService.java @@ -73,7 +73,7 @@ public class LoadTestService { fileService.deleteFileByTestId(request.getId()); } - public void save(SaveTestPlanRequest request, MultipartFile file) { + public String save(SaveTestPlanRequest request, MultipartFile file) { if (file == null) { throw new IllegalArgumentException("文件不能为空!"); } @@ -86,6 +86,8 @@ public class LoadTestService { loadTestFile.setTestId(loadTest.getId()); loadTestFile.setFileId(fileMetadata.getId()); loadTestFileMapper.insert(loadTestFile); + + return loadTest.getId(); } private LoadTestWithBLOBs saveLoadTest(SaveTestPlanRequest request) {