Study/server/model/learning/request/wrong_question.go

51 lines
1.7 KiB
Go

package request
import (
"time"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/learning"
)
type WrongQuestionSearch struct {
learning.WrongQuestion
request.PageInfo
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
}
type WrongQuestionCreate struct {
UserId uint `json:"userId" binding:"required"`
QuestionId uint `json:"questionId" binding:"required"`
WrongAnswer string `json:"wrongAnswer"`
WrongCount int `json:"wrongCount"`
LastWrongAt time.Time `json:"lastWrongAt"`
IsMastered bool `json:"isMastered"`
MasteredAt time.Time `json:"masteredAt"`
Notes string `json:"notes"`
}
type WrongQuestionUpdate struct {
ID uint `json:"id" binding:"required"`
UserId uint `json:"userId" binding:"required"`
QuestionId uint `json:"questionId" binding:"required"`
WrongAnswer string `json:"wrongAnswer"`
WrongCount int `json:"wrongCount"`
LastWrongAt time.Time `json:"lastWrongAt"`
IsMastered bool `json:"isMastered"`
MasteredAt time.Time `json:"masteredAt"`
Notes string `json:"notes"`
}
type WrongQuestionStatistics struct {
TotalWrongQuestions int `json:"totalWrongQuestions"` // 总错题数
MasteredQuestions int `json:"masteredQuestions"` // 已掌握题目数
UnmasteredQuestions int `json:"unmasteredQuestions"` // 未掌握题目数
AverageWrongCount int `json:"averageWrongCount"` // 平均错误次数
}
type MarkMasteredRequest struct {
ID uint `json:"id" binding:"required"`
UserId uint `json:"userId" binding:"required"`
}