增加了题库不允许重复的业务逻辑13
This commit is contained in:
parent
d56b6ce9df
commit
6e662c0cb0
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user