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

This commit is contained in:
wucongxing8150 2025-07-29 16:08:55 +08:00
parent 4a9760019f
commit ecc7c52314

View File

@ -484,8 +484,12 @@ func (r *QuestionQaService) PutQuestionQa(qaId int64, req requests.PutQuestionQa
if len(questions) < item.Quantity {
tx.Rollback()
if len(notQuestionIds) > 0 {
return false, errors.New("因不允许重复选题超出现有题目数量")
} else {
return false, errors.New("选题超出现有题目数量")
}
}
for _, question := range questions {
questionQaItem := &model.QuestionQaItem{