service/dbstruct/RavenIQTest.go

88 lines
2.5 KiB
Go
Raw Normal View History

2024-07-18 19:29:11 +08:00
package dbstruct
type RavenIQTest struct {
Id *int64 `json:"id" bson:"_id"` // 瑞文智商测试表id
UserId *int64 `json:"user_id" bson:"user_id"` // 用户id
Age *int64 `json:"age" bson:"age"` // 年龄
2024-07-19 17:46:58 +08:00
TotalScore *float64 `json:"total_score" bson:"total_score"` // 总得分
2024-07-18 19:29:11 +08:00
IQ *float64 `json:"IQ" bson:"IQ"` // 智商值
AnswerList []*RavenIQTestAnswer `json:"answer_list" bson:"answer_list"` // 答案list
ClassScoreList []*RavenIQTestClassScore `json:"class_score_list" bson:"class_score_list"` // 大类得分list
Ct *int64 `json:"ct" bson:"ct"` // 创建时间
Ut *int64 `json:"ut" bson:"ut"` // 更新时间
DelFlag *int64 `json:"del_flag" bson:"del_flag"` // 删除标记
}
type RavenIQTestAnswer struct {
QuestionId *int64 `json:"question_id" bson:"question_id"` // 问题Id
SelectedOption *int64 `json:"selected_option" bson:"selected_option"` // 选择的选项
}
type RavenIQTestClassScore struct {
ClassId *int64 `json:"class_id" bson:"class_id"` // 大类id
Score *int64 `json:"score" bson:"score"` // 得分
}
func (p *RavenIQTest) GetId() int64 {
if p == nil || p.Id == nil {
return -1
}
return *p.Id
}
func (p *RavenIQTest) GetUserId() int64 {
if p == nil || p.UserId == nil {
return -1
}
return *p.UserId
}
func (p *RavenIQTest) GetAge() int64 {
if p == nil || p.UserId == nil {
return 0
}
return *p.Age
}
2024-07-19 17:46:58 +08:00
func (p *RavenIQTest) GetTotalScore() float64 {
if p == nil || p.TotalScore == nil {
2024-07-18 19:29:11 +08:00
return 0
}
2024-07-19 17:46:58 +08:00
return *p.TotalScore
2024-07-18 19:29:11 +08:00
}
func (p *RavenIQTest) GetIQ() float64 {
if p == nil || p.IQ == nil {
return 0
}
return *p.IQ
}
2024-07-19 17:46:58 +08:00
func (p *RavenIQTestAnswer) GetQuestionId() int64 {
if p == nil || p.QuestionId == nil {
return 0
}
return *p.QuestionId
}
func (p *RavenIQTestAnswer) GetSelectedOption() int64 {
if p == nil || p.SelectedOption == nil {
return 0
}
return *p.SelectedOption
}
2024-07-18 19:29:11 +08:00
func (p *RavenIQTestClassScore) GetClassId() int64 {
if p == nil || p.ClassId == nil {
return 0
}
return *p.ClassId
}
func (p *RavenIQTestClassScore) GetScore() int64 {
if p == nil || p.Score == nil {
return 0
}
return *p.Score
}