新增题目时,增加来源验重12
This commit is contained in:
parent
b094d026af
commit
50e685bcf3
@ -110,6 +110,7 @@ func (r *QuestionService) AddQuestion(req requests.AddQuestion) (bool, error) {
|
||||
|
||||
maps := make(map[string]interface{})
|
||||
maps["question_name"] = req.QuestionName
|
||||
maps["question_source"] = req.QuestionSource
|
||||
question, _ := questionDao.GetQuestion(maps)
|
||||
if question != nil {
|
||||
return false, errors.New("题目名称重复")
|
||||
@ -554,6 +555,7 @@ func (r *QuestionService) PutQuestion(questionId int64, req requests.PutQuestion
|
||||
if req.QuestionName != question.QuestionName {
|
||||
maps := make(map[string]interface{})
|
||||
maps["question_name"] = req.QuestionName
|
||||
maps["question_source"] = question.QuestionSource
|
||||
res, _ := questionDao.GetQuestion(maps)
|
||||
if res != nil {
|
||||
tx.Rollback()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user