diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java index 5ac1aa7..8bddbd1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/QuManager.java @@ -84,11 +84,17 @@ public class QuManager { qu.setCreateTime(new Date()); } quService.saveOrUpdate(qu); + if(CollUtil.isEmpty(reqDTO.getAnswerList())){ + throw new ServiceException("备选项列表不能为空"); + } if(CollUtil.isNotEmpty(reqDTO.getAnswerList())){ List answerList = Convert.toList(ElQuAnswer.class, reqDTO.getAnswerList()); answerList.forEach(elQuAnswer -> elQuAnswer.setQuId(qu.getId())); quAnswerService.saveBatch(answerList); } + if(CollUtil.isEmpty(reqDTO.getRepoIds())){ + throw new ServiceException("题库列表不能为空"); + } if(CollUtil.isNotEmpty(reqDTO.getRepoIds())){ List list = new ArrayList<>(); reqDTO.getRepoIds().forEach(repoId->{