From 9a6f355c0206d584971671a2872d91f8619580a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=A4=A7=E9=94=90?= <1070211640@qq.com> Date: Wed, 24 Jan 2024 11:36:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=97=A5=E5=BF=97=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=8C=E9=80=9A=E8=BF=87=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../experiment/ExperimentInsController.java | 10 ++++++---- .../platform/service/ExperimentInsService.java | 3 ++- .../service/impl/ExperimentInsServiceImpl.java | 13 +++++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/experiment/ExperimentInsController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/experiment/ExperimentInsController.java index 617719a2..3d271ef6 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/experiment/ExperimentInsController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/experiment/ExperimentInsController.java @@ -9,6 +9,7 @@ import org.springframework.data.domain.PageRequest; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.Map; /** * (ExperimentIns)表控制层 @@ -114,13 +115,14 @@ public class ExperimentInsController { /** * 查询实验实例日志 * - * @param id 主键 + * @param req Map类型的请求头 * @return 运行日志 */ - @GetMapping(("/log/{id}")) - public AjaxResult showExperimentInsLog(@PathVariable("id") Integer id){ - return AjaxResult.success(this.experimentInsService.showExperimentInsLog(id)); + @GetMapping(("/log/")) + @ApiOperation("查询实例日志") + public AjaxResult showExperimentInsLog(@RequestBody Map req){ + return AjaxResult.success(this.experimentInsService.showExperimentInsLog(req)); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java index 00e15147..cec657e7 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/ExperimentInsService.java @@ -5,6 +5,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import java.util.List; +import java.util.Map; /** * (ExperimentIns)表服务接口 @@ -82,6 +83,6 @@ public interface ExperimentInsService { * @param id 主键 * @return 运行日志 */ - String showExperimentInsLog(Integer id); + String showExperimentInsLog(Map req); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java index 0cf94143..779342ad 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ExperimentInsServiceImpl.java @@ -348,11 +348,15 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { /** * 查询实验实例日志 * - * @param id 主键 + * @param map Map格式的请求数据 * @return 运行日志 */ @Override - public String showExperimentInsLog(Integer id) { + public String showExperimentInsLog(Map map) { + //先从map中取出数据 + Integer id = (Integer) map.get("id"); + String componentId = (String) map.get("component_id"); + //先查出实验记录 ExperimentIns experimentIns = this.experimentInsDao.queryById(id); if (experimentIns == null) { @@ -366,9 +370,10 @@ public class ExperimentInsServiceImpl implements ExperimentInsService { Map requestData = new HashMap<>(); requestData.put("namespace", namespace); requestData.put("name", name); + //先写死这两个数据项 requestData.put("workflow-type","workflows"); - requestData.put("artifact-name","workflows"); - requestData.put("workflow-type","workflows"); + requestData.put("artifact-name","main-logs"); + requestData.put("component-id",componentId); // 创建发送数据map,将请求数据作为"data"键的值 Map res = new HashMap<>(); res.put("data", requestData);