增加了题库不允许重复的业务逻辑13
This commit is contained in:
parent
d56b6ce9df
commit
6e662c0cb0
@ -266,7 +266,11 @@ func (r *QuestionQaService) AddQuestionQa(req requests.AddQuestionQa) (bool, err
|
|||||||
|
|
||||||
if len(questions) < item.Quantity {
|
if len(questions) < item.Quantity {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return false, errors.New(utils.QuestionType(item.QuestionType) + "数量不足")
|
if len(notQuestionIds) > 0 {
|
||||||
|
return false, errors.New("因不允许重复" + utils.QuestionType(item.QuestionType) + "数量不足")
|
||||||
|
} else {
|
||||||
|
return false, errors.New(utils.QuestionType(item.QuestionType) + "数量不足")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增明细题目
|
// 新增明细题目
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user