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();