Merge branch 'dev' of bin.github.com:fit2cloudrd/metersphere-server into dev

This commit is contained in:
Captain.B 2020-02-20 12:56:22 +08:00
commit 61715c2d52
2 changed files with 5 additions and 3 deletions

View File

@ -33,11 +33,11 @@ public class LoadTestController {
} }
@PostMapping(value = "/save", consumes = {"multipart/form-data"}) @PostMapping(value = "/save", consumes = {"multipart/form-data"})
public void save( public String save(
@RequestPart("request") SaveTestPlanRequest request, @RequestPart("request") SaveTestPlanRequest request,
@RequestPart(value = "file") MultipartFile file @RequestPart(value = "file") MultipartFile file
) { ) {
loadTestService.save(request, file); return loadTestService.save(request, file);
} }
@PostMapping(value = "/edit", consumes = {"multipart/form-data"}) @PostMapping(value = "/edit", consumes = {"multipart/form-data"})

View File

@ -71,7 +71,7 @@ public class LoadTestService {
fileService.deleteFileByTestId(request.getId()); fileService.deleteFileByTestId(request.getId());
} }
public void save(SaveTestPlanRequest request, MultipartFile file) { public String save(SaveTestPlanRequest request, MultipartFile file) {
if (file == null) { if (file == null) {
throw new IllegalArgumentException("文件不能为空!"); throw new IllegalArgumentException("文件不能为空!");
} }
@ -84,6 +84,8 @@ public class LoadTestService {
loadTestFile.setTestId(loadTest.getId()); loadTestFile.setTestId(loadTest.getId());
loadTestFile.setFileId(fileMetadata.getId()); loadTestFile.setFileId(fileMetadata.getId());
loadTestFileMapper.insert(loadTestFile); loadTestFileMapper.insert(loadTestFile);
return loadTest.getId();
} }
private LoadTestWithBLOBs saveLoadTest(SaveTestPlanRequest request) { private LoadTestWithBLOBs saveLoadTest(SaveTestPlanRequest request) {