修改标签
This commit is contained in:
+18
-2
@@ -807,10 +807,26 @@ func (r *QuestionService) GetQuestion(questionId int64) (g *dto.QuestionDto, err
|
||||
g = dto.GetQuestionDto(question)
|
||||
|
||||
// 加载一级标签
|
||||
g.LoadFirstLabel(question.FirstLabel)
|
||||
if question.FirstLabelId != nil {
|
||||
labelDao := dao.LabelDao{}
|
||||
firstLabel, err := labelDao.GetLabelFirstById(*question.FirstLabelId)
|
||||
if err != nil {
|
||||
return nil, errors.New("题目标签存在错误")
|
||||
}
|
||||
|
||||
g.LoadFirstLabel(firstLabel)
|
||||
}
|
||||
|
||||
// 加载二级标签
|
||||
g.LoadSecondLabel(question.SecondLabel)
|
||||
if question.SecondLabelId != nil {
|
||||
labelDao := dao.LabelDao{}
|
||||
secondLabel, err := labelDao.GetLabelFirstById(*question.SecondLabelId)
|
||||
if err != nil {
|
||||
return nil, errors.New("题目标签存在错误")
|
||||
}
|
||||
|
||||
g.LoadSecondLabel(secondLabel)
|
||||
}
|
||||
|
||||
// 加载选项
|
||||
g.LoadQuestionOption(question.QuestionOption)
|
||||
|
||||
Reference in New Issue
Block a user