From 593c3ce879dba1042b8db01958e641dd7667eec2 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Mon, 31 Mar 2025 15:35:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E6=B0=B4=E7=BA=BF?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=BA=E6=9C=80=E5=A4=A7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E8=83=BD=E5=A4=8D=E5=88=B6=E6=88=90=E5=8A=9F?= =?UTF-8?q?=EF=BC=8C=E7=BC=96=E8=BE=91=E6=B5=81=E6=B0=B4=E7=BA=BF=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E8=B6=85=E8=BF=87=E6=9C=80=E5=A4=A7=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/platform/service/impl/WorkflowServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/WorkflowServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/WorkflowServiceImpl.java index 48068af6..2535c1e0 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/WorkflowServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/WorkflowServiceImpl.java @@ -2,7 +2,6 @@ package com.ruoyi.platform.service.impl; import com.ruoyi.common.security.utils.SecurityUtils; import com.ruoyi.platform.annotations.CheckDuplicate; -import com.ruoyi.system.api.constant.Constant; import com.ruoyi.platform.domain.AssetWorkflow; import com.ruoyi.platform.domain.Experiment; import com.ruoyi.platform.domain.ImageVersion; @@ -15,6 +14,7 @@ import com.ruoyi.platform.service.WorkflowService; import com.ruoyi.platform.utils.HttpUtils; import com.ruoyi.platform.utils.JsonUtils; import com.ruoyi.platform.utils.MinioUtil; +import com.ruoyi.system.api.constant.Constant; import com.ruoyi.system.api.model.LoginUser; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Value; @@ -180,6 +180,10 @@ public class WorkflowServiceImpl implements WorkflowService { Workflow workflow = this.queryById(id); if (workflow != null) { try { + if (workflow.getName().length() >= 64) { + throw new RuntimeException("流水线名称大于最大长度"); + } + Workflow duplicateWorkflow = new Workflow(); duplicateWorkflow.setName(workflow.getName() + "-copy-" + UUID.randomUUID().toString().substring(0, 6)); String oldDag = workflow.getDag(); @@ -205,7 +209,6 @@ public class WorkflowServiceImpl implements WorkflowService { return this.insert(duplicateWorkflow); } catch (Exception e) { throw new RuntimeException("复制流水线失败: " + e.getMessage(), e); - } } return null;