增加了题库不允许重复的业务逻辑13

This commit is contained in:
wucongxing8150 2025-07-29 17:26:28 +08:00
parent d56b6ce9df
commit 6e662c0cb0

View File

@ -266,8 +266,12 @@ func (r *QuestionQaService) AddQuestionQa(req requests.AddQuestionQa) (bool, err
if len(questions) < item.Quantity {
tx.Rollback()
if len(notQuestionIds) > 0 {
return false, errors.New("因不允许重复" + utils.QuestionType(item.QuestionType) + "数量不足")
} else {
return false, errors.New(utils.QuestionType(item.QuestionType) + "数量不足")
}
}
// 新增明细题目
for _, question := range questions {