This commit is contained in:
2024-10-09 16:40:59 +08:00
parent f862bd28e1
commit a8e0d18794
3 changed files with 12 additions and 18 deletions
-6
View File
@@ -19,8 +19,6 @@ type QuestionDto struct {
QuestionAnswer []string `json:"question_answer"` // 答案
QuestionAnalysis string `json:"question_analysis"` // 解析
Difficulty int `json:"difficulty"` // 难度(0:未知 1:低 2:中 3:高)
FirstLabelId string `json:"first_label_id"` // 一级标签id
SecondLabelId string `json:"second_label_id"` // 二级标签id
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
FirstLabel *LabelDto `json:"first_label"` // 一级标签
@@ -41,8 +39,6 @@ func GetQuestionDto(m *model.Question) *QuestionDto {
QuestionAnswer: []string{},
QuestionAnalysis: m.QuestionAnalysis,
Difficulty: m.Difficulty,
FirstLabelId: fmt.Sprintf("%d", *m.FirstLabelId),
SecondLabelId: fmt.Sprintf("%d", *m.SecondLabelId),
CreatedAt: m.CreatedAt,
UpdatedAt: m.UpdatedAt,
}
@@ -66,8 +62,6 @@ func GetQuestionListDto(m []*model.Question) []*QuestionDto {
QuestionAnswer: []string{},
QuestionAnalysis: v.QuestionAnalysis,
Difficulty: v.Difficulty,
FirstLabelId: fmt.Sprintf("%d", *v.FirstLabelId),
SecondLabelId: fmt.Sprintf("%d", *v.SecondLabelId),
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
}