From d1eb14e3ed497b568fbc6e7d83155dd2bfd43c10 Mon Sep 17 00:00:00 2001 From: chenzhihang <709011834@qq.com> Date: Tue, 22 Apr 2025 09:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E5=A2=9E=E5=AE=9E?= =?UTF-8?q?=E9=AA=8C=E6=A0=A1=E9=AA=8C=E5=AE=9E=E9=AA=8C=E5=90=8D=E7=A7=B0?= =?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/ActiveLearnServiceImpl.java | 4 ++++ .../ruoyi/platform/service/impl/AutoMlInsServiceImpl.java | 2 ++ .../com/ruoyi/platform/service/impl/AutoMlServiceImpl.java | 5 +++++ .../java/com/ruoyi/platform/service/impl/RayServiceImpl.java | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java index 9f861a3e..a1f2f93b 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java @@ -64,6 +64,10 @@ public class ActiveLearnServiceImpl implements ActiveLearnService { if (activeLearnByName != null) { throw new RuntimeException("实验名称已存在"); } + if (activeLearnVo.getName().length() >= 64) { + throw new RuntimeException("实验名称大于最大长度"); + } + ActiveLearn activeLearn = new ActiveLearn(); BeanUtils.copyProperties(activeLearnVo, activeLearn); String username = SecurityUtils.getLoginUser().getUsername(); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlInsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlInsServiceImpl.java index 2f122a81..e9100e57 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlInsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlInsServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageRequest; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.io.IOException; @@ -72,6 +73,7 @@ public class AutoMlInsServiceImpl implements AutoMlInsService { } @Override + @Transactional public String batchDelete(List ids) { for (Long id : ids) { String result = removeById(id); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlServiceImpl.java index d2cb6a17..bff62c3c 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlServiceImpl.java @@ -70,6 +70,11 @@ public class AutoMlServiceImpl implements AutoMlService { if (autoMlByName != null) { throw new RuntimeException("实验名称已存在"); } + + if (autoMlVo.getMlName().length() >= 64) { + throw new RuntimeException("实验名称大于最大长度"); + } + AutoMl autoMl = new AutoMl(); BeanUtils.copyProperties(autoMlVo, autoMl); String username = SecurityUtils.getLoginUser().getUsername(); diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java index b844711e..f2021a88 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java @@ -67,6 +67,11 @@ public class RayServiceImpl implements RayService { if (rayByName != null) { throw new RuntimeException("实验名称已存在"); } + + if (rayVo.getName().length() >= 64) { + throw new RuntimeException("实验名称大于最大长度"); + } + Ray ray = new Ray(); BeanUtils.copyProperties(rayVo, ray); String username = SecurityUtils.getLoginUser().getUsername();