1
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/learning"
|
||||
)
|
||||
|
||||
type ChapterSearch struct {
|
||||
learning.Chapter
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type ChapterCreate struct {
|
||||
CourseId uint `json:"courseId" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Sort int `json:"sort"`
|
||||
Status string `json:"status"`
|
||||
Duration int `json:"duration"`
|
||||
}
|
||||
|
||||
type ChapterUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
CourseId uint `json:"courseId" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Sort int `json:"sort"`
|
||||
Status string `json:"status"`
|
||||
Duration int `json:"duration"`
|
||||
}
|
||||
|
||||
type ChaptersByCourseRequest struct {
|
||||
CourseId uint `json:"courseId" form:"courseId" binding:"required"`
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/learning"
|
||||
)
|
||||
|
||||
type CourseSearch struct {
|
||||
learning.Course
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type CourseCreate struct {
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Cover string `json:"cover"`
|
||||
Difficulty string `json:"difficulty"`
|
||||
Duration int `json:"duration"`
|
||||
Status string `json:"status"`
|
||||
Price float64 `json:"price"`
|
||||
Tags string `json:"tags"`
|
||||
Sort int `json:"sort"`
|
||||
}
|
||||
|
||||
type CourseUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
Cover string `json:"cover"`
|
||||
Difficulty string `json:"difficulty"`
|
||||
Duration int `json:"duration"`
|
||||
Status string `json:"status"`
|
||||
Price float64 `json:"price"`
|
||||
Tags string `json:"tags"`
|
||||
Sort int `json:"sort"`
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
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 ExamSearch struct {
|
||||
learning.Exam
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type ExamCreate struct {
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
CourseId uint `json:"courseId"`
|
||||
Duration int `json:"duration" binding:"required"`
|
||||
TotalScore int `json:"totalScore" binding:"required"`
|
||||
PassScore int `json:"passScore" binding:"required"`
|
||||
QuestionCount int `json:"questionCount" binding:"required"`
|
||||
StartTime time.Time `json:"startTime"`
|
||||
EndTime time.Time `json:"endTime"`
|
||||
Status string `json:"status"`
|
||||
AllowRetake bool `json:"allowRetake"`
|
||||
MaxAttempts int `json:"maxAttempts"`
|
||||
}
|
||||
|
||||
type ExamUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Description string `json:"description"`
|
||||
CourseId uint `json:"courseId"`
|
||||
Duration int `json:"duration" binding:"required"`
|
||||
TotalScore int `json:"totalScore" binding:"required"`
|
||||
PassScore int `json:"passScore" binding:"required"`
|
||||
QuestionCount int `json:"questionCount" binding:"required"`
|
||||
StartTime time.Time `json:"startTime"`
|
||||
EndTime time.Time `json:"endTime"`
|
||||
Status string `json:"status"`
|
||||
AllowRetake bool `json:"allowRetake"`
|
||||
MaxAttempts int `json:"maxAttempts"`
|
||||
}
|
||||
|
||||
type ExamStatistics struct {
|
||||
TotalExams int `json:"totalExams"` // 总考试数
|
||||
ActiveExams int `json:"activeExams"` // 进行中的考试数
|
||||
CompletedExams int `json:"completedExams"` // 已结束的考试数
|
||||
DraftExams int `json:"draftExams"` // 草稿考试数
|
||||
}
|
||||
|
||||
type PublishExamRequest struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
}
|
||||
|
||||
type ExamQuestionConfig struct {
|
||||
ExamId uint `json:"examId" binding:"required"`
|
||||
QuestionId uint `json:"questionId" binding:"required"`
|
||||
Score int `json:"score" binding:"required"`
|
||||
QuestionOrder int `json:"questionOrder"`
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/learning"
|
||||
)
|
||||
|
||||
type KnowledgePointSearch struct {
|
||||
learning.KnowledgePoint
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type KnowledgePointCreate struct {
|
||||
ChapterId uint `json:"chapterId" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Content string `json:"content"`
|
||||
VideoUrl string `json:"videoUrl"`
|
||||
Attachments string `json:"attachments"`
|
||||
Sort int `json:"sort"`
|
||||
Duration int `json:"duration"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type KnowledgePointUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
ChapterId uint `json:"chapterId" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Content string `json:"content"`
|
||||
VideoUrl string `json:"videoUrl"`
|
||||
Attachments string `json:"attachments"`
|
||||
Sort int `json:"sort"`
|
||||
Duration int `json:"duration"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type KnowledgePointsByChapterRequest struct {
|
||||
ChapterId uint `json:"chapterId" form:"chapterId" binding:"required"`
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/learning"
|
||||
)
|
||||
|
||||
type QuestionSearch struct {
|
||||
learning.Question
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type QuestionCreate struct {
|
||||
KnowledgePointId uint `json:"knowledgePointId" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Content string `json:"content"`
|
||||
Type string `json:"type" binding:"required"`
|
||||
Options string `json:"options"`
|
||||
Answer string `json:"answer" binding:"required"`
|
||||
Explanation string `json:"explanation"`
|
||||
Difficulty string `json:"difficulty"`
|
||||
Score int `json:"score"`
|
||||
}
|
||||
|
||||
type QuestionUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
KnowledgePointId uint `json:"knowledgePointId" binding:"required"`
|
||||
Title string `json:"title" binding:"required"`
|
||||
Content string `json:"content"`
|
||||
Type string `json:"type" binding:"required"`
|
||||
Options string `json:"options"`
|
||||
Answer string `json:"answer" binding:"required"`
|
||||
Explanation string `json:"explanation"`
|
||||
Difficulty string `json:"difficulty"`
|
||||
Score int `json:"score"`
|
||||
}
|
||||
|
||||
type QuestionsByKnowledgePointRequest struct {
|
||||
KnowledgePointId uint `json:"knowledgePointId" form:"knowledgePointId" binding:"required"`
|
||||
}
|
||||
|
||||
// QuestionOption 题目选项结构
|
||||
type QuestionOption struct {
|
||||
Key string `json:"key"` // 选项标识 A、B、C、D
|
||||
Value string `json:"value"` // 选项内容
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
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 UserExamSearch struct {
|
||||
learning.UserExam
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type UserExamCreate struct {
|
||||
UserId uint `json:"userId" binding:"required"`
|
||||
ExamId uint `json:"examId" binding:"required"`
|
||||
AttemptNumber int `json:"attemptNumber"`
|
||||
StartTime time.Time `json:"startTime"`
|
||||
EndTime time.Time `json:"endTime"`
|
||||
Duration int `json:"duration"`
|
||||
TotalScore int `json:"totalScore"`
|
||||
CorrectCount int `json:"correctCount"`
|
||||
WrongCount int `json:"wrongCount"`
|
||||
Status string `json:"status"`
|
||||
IsPassed bool `json:"isPassed"`
|
||||
SubmittedAt time.Time `json:"submittedAt"`
|
||||
}
|
||||
|
||||
type UserExamUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
UserId uint `json:"userId" binding:"required"`
|
||||
ExamId uint `json:"examId" binding:"required"`
|
||||
AttemptNumber int `json:"attemptNumber"`
|
||||
StartTime time.Time `json:"startTime"`
|
||||
EndTime time.Time `json:"endTime"`
|
||||
Duration int `json:"duration"`
|
||||
TotalScore int `json:"totalScore"`
|
||||
CorrectCount int `json:"correctCount"`
|
||||
WrongCount int `json:"wrongCount"`
|
||||
Status string `json:"status"`
|
||||
IsPassed bool `json:"isPassed"`
|
||||
SubmittedAt time.Time `json:"submittedAt"`
|
||||
}
|
||||
|
||||
type StartExamRequest struct {
|
||||
ExamId uint `json:"examId" binding:"required"`
|
||||
UserId uint `json:"userId" binding:"required"`
|
||||
}
|
||||
|
||||
type SubmitExamRequest struct {
|
||||
UserExamId uint `json:"userExamId" binding:"required"`
|
||||
TotalScore int `json:"totalScore"`
|
||||
CorrectCount int `json:"correctCount"`
|
||||
WrongCount int `json:"wrongCount"`
|
||||
}
|
||||
|
||||
type UserExamStatistics struct {
|
||||
TotalExams int `json:"totalExams"` // 总考试次数
|
||||
PassedExams int `json:"passedExams"` // 通过考试次数
|
||||
FailedExams int `json:"failedExams"` // 未通过考试次数
|
||||
AverageScore float64 `json:"averageScore"` // 平均分数
|
||||
HighestScore int `json:"highestScore"` // 最高分数
|
||||
TotalStudyTime int `json:"totalStudyTime"` // 总学习时间(分钟)
|
||||
PassRate float64 `json:"passRate"` // 通过率
|
||||
}
|
||||
|
||||
type ExamRankingItem struct {
|
||||
UserId uint `json:"userId"`
|
||||
UserName string `json:"userName"`
|
||||
Score int `json:"score"`
|
||||
Duration int `json:"duration"`
|
||||
Rank int `json:"rank"`
|
||||
IsPassed bool `json:"isPassed"`
|
||||
SubmittedAt time.Time `json:"submittedAt"`
|
||||
}
|
||||
|
||||
type ExamRankingResponse struct {
|
||||
ExamId uint `json:"examId"`
|
||||
ExamTitle string `json:"examTitle"`
|
||||
Rankings []ExamRankingItem `json:"rankings"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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 UserLearningSearch struct {
|
||||
learning.UserLearning
|
||||
request.PageInfo
|
||||
StartCreatedAt *string `json:"startCreatedAt" form:"startCreatedAt"`
|
||||
EndCreatedAt *string `json:"endCreatedAt" form:"endCreatedAt"`
|
||||
}
|
||||
|
||||
type UserLearningCreate struct {
|
||||
UserId uint `json:"userId" binding:"required"`
|
||||
CourseId uint `json:"courseId" binding:"required"`
|
||||
ChapterId uint `json:"chapterId"`
|
||||
KnowledgePointId uint `json:"knowledgePointId"`
|
||||
Progress int `json:"progress"`
|
||||
StudyTime int `json:"studyTime"`
|
||||
LastStudyAt time.Time `json:"lastStudyAt"`
|
||||
Status string `json:"status"`
|
||||
Score int `json:"score"`
|
||||
CompletedAt time.Time `json:"completedAt"`
|
||||
}
|
||||
|
||||
type UserLearningUpdate struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
UserId uint `json:"userId" binding:"required"`
|
||||
CourseId uint `json:"courseId" binding:"required"`
|
||||
ChapterId uint `json:"chapterId"`
|
||||
KnowledgePointId uint `json:"knowledgePointId"`
|
||||
Progress int `json:"progress"`
|
||||
StudyTime int `json:"studyTime"`
|
||||
LastStudyAt time.Time `json:"lastStudyAt"`
|
||||
Status string `json:"status"`
|
||||
Score int `json:"score"`
|
||||
CompletedAt time.Time `json:"completedAt"`
|
||||
}
|
||||
|
||||
type UserProgressRequest struct {
|
||||
UserId uint `json:"userId" form:"userId" binding:"required"`
|
||||
CourseId uint `json:"courseId" form:"courseId"`
|
||||
}
|
||||
|
||||
type LearningStatistics struct {
|
||||
TotalCourses int `json:"totalCourses"` // 总课程数
|
||||
CompletedCourses int `json:"completedCourses"` // 已完成课程数
|
||||
InProgressCourses int `json:"inProgressCourses"` // 学习中课程数
|
||||
TotalStudyTime int `json:"totalStudyTime"` // 总学习时长
|
||||
AverageScore int `json:"averageScore"` // 平均分数
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user