Browse Source

优化新增实验校验实验名称长度

pull/225/head
chenzhihang 9 months ago
parent
commit
d1eb14e3ed
4 changed files with 16 additions and 0 deletions
  1. +4
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java
  2. +2
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlInsServiceImpl.java
  3. +5
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlServiceImpl.java
  4. +5
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java

+ 4
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ActiveLearnServiceImpl.java View File

@@ -64,6 +64,10 @@ public class ActiveLearnServiceImpl implements ActiveLearnService {
if (activeLearnByName != null) { if (activeLearnByName != null) {
throw new RuntimeException("实验名称已存在"); throw new RuntimeException("实验名称已存在");
} }
if (activeLearnVo.getName().length() >= 64) {
throw new RuntimeException("实验名称大于最大长度");
}

ActiveLearn activeLearn = new ActiveLearn(); ActiveLearn activeLearn = new ActiveLearn();
BeanUtils.copyProperties(activeLearnVo, activeLearn); BeanUtils.copyProperties(activeLearnVo, activeLearn);
String username = SecurityUtils.getLoginUser().getUsername(); String username = SecurityUtils.getLoginUser().getUsername();


+ 2
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlInsServiceImpl.java View File

@@ -15,6 +15,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
@@ -72,6 +73,7 @@ public class AutoMlInsServiceImpl implements AutoMlInsService {
} }


@Override @Override
@Transactional
public String batchDelete(List<Long> ids) { public String batchDelete(List<Long> ids) {
for (Long id : ids) { for (Long id : ids) {
String result = removeById(id); String result = removeById(id);


+ 5
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/AutoMlServiceImpl.java View File

@@ -70,6 +70,11 @@ public class AutoMlServiceImpl implements AutoMlService {
if (autoMlByName != null) { if (autoMlByName != null) {
throw new RuntimeException("实验名称已存在"); throw new RuntimeException("实验名称已存在");
} }

if (autoMlVo.getMlName().length() >= 64) {
throw new RuntimeException("实验名称大于最大长度");
}

AutoMl autoMl = new AutoMl(); AutoMl autoMl = new AutoMl();
BeanUtils.copyProperties(autoMlVo, autoMl); BeanUtils.copyProperties(autoMlVo, autoMl);
String username = SecurityUtils.getLoginUser().getUsername(); String username = SecurityUtils.getLoginUser().getUsername();


+ 5
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/RayServiceImpl.java View File

@@ -67,6 +67,11 @@ public class RayServiceImpl implements RayService {
if (rayByName != null) { if (rayByName != null) {
throw new RuntimeException("实验名称已存在"); throw new RuntimeException("实验名称已存在");
} }

if (rayVo.getName().length() >= 64) {
throw new RuntimeException("实验名称大于最大长度");
}

Ray ray = new Ray(); Ray ray = new Ray();
BeanUtils.copyProperties(rayVo, ray); BeanUtils.copyProperties(rayVo, ray);
String username = SecurityUtils.getLoginUser().getUsername(); String username = SecurityUtils.getLoginUser().getUsername();


Loading…
Cancel
Save