From d4808d5d65cf8a9869ffb9644f725f2c4302b3df Mon Sep 17 00:00:00 2001 From: zhouyl <583641232@qq.com> Date: Thu, 10 Oct 2024 18:01:49 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20AI=E8=AE=AD=E7=BB=83=E5=9F=BA?= =?UTF-8?q?=E5=87=86=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E5=B7=A5=E5=85=B7?= =?UTF-8?q?-=E4=B8=8A=E4=BC=A0=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/TestReportController.java | 37 +++++++++++++++++++ .../functional/domain/TestReport.java | 25 ++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/tp-admin/src/main/java/com/inscloudtech/web/controller/system/TestReportController.java b/tp-admin/src/main/java/com/inscloudtech/web/controller/system/TestReportController.java index edca100..690b8a9 100644 --- a/tp-admin/src/main/java/com/inscloudtech/web/controller/system/TestReportController.java +++ b/tp-admin/src/main/java/com/inscloudtech/web/controller/system/TestReportController.java @@ -205,6 +205,43 @@ public class TestReportController { } + /** + * AI训练基准性能测试工具-上传测试结果 + * + */ + @Log(title = "测试任务管理", businessType = BusinessType.INSERT) + @PostMapping(value = "/uploadResult4AiTraining", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) + public R upload( @RequestPart("file") MultipartFile file,@RequestPart("img1") MultipartFile img1,@RequestPart("img2") MultipartFile img2, + @RequestPart("id") String id) { + + if (id == null) { + return R.fail("测试任务id不能为空!"); + } + + TestReport testReport = new TestReport(); + testReport.setId(Long.parseLong(id)); + if(file != null ){ + SysOssVo toolVo = iSysOssService.upload(file,true); + testReport.setResultPath(toolVo.getOriginalName()); + testReport.setResultOssId(toolVo.getOssId()); + } + if(img1 != null ){ + SysOssVo toolVo = iSysOssService.upload(img1,true); + testReport.setResult2Path(toolVo.getOriginalName()); + testReport.setResult2OssId(toolVo.getOssId()); + } + if(img2 != null ){ + SysOssVo toolVo = iSysOssService.upload(img2,true); + testReport.setResult3Path(toolVo.getOriginalName()); + testReport.setResult3OssId(toolVo.getOssId()); + } + testReport.setTestStatus("测试完成"); + testReport.setUpdateTime(new Date()); + testReportService.updateById(testReport); + return R.ok("操作成功!"); + } + + /** * 前端用户-上传测试内容/测试模型 * diff --git a/tp-functional/src/main/java/com/inscloudtech/functional/domain/TestReport.java b/tp-functional/src/main/java/com/inscloudtech/functional/domain/TestReport.java index b668aef..149c73b 100644 --- a/tp-functional/src/main/java/com/inscloudtech/functional/domain/TestReport.java +++ b/tp-functional/src/main/java/com/inscloudtech/functional/domain/TestReport.java @@ -36,17 +36,38 @@ public class TestReport extends BaseEntity { */ private String testDataPath; /** - * 测试结果文件 + * 测试结果文件1 */ private String resultPath; + + /** + * 测试结果文件2 + */ + private String result2Path; + + /** + * 测试结果文件3 + */ + private String result3Path; + /** *测试内容/测试模型存储id */ private Long testDataOssId; /** - *测试结果存储id + *测试结果1存储id */ private Long resultOssId; + + /** + *测试结果2存储id + */ + private Long result2OssId; + + /** + *测试结果3存储id + */ + private Long result3OssId; /** * 任务描述/框架类型 */