56 lines
2.0 KiB
Go
56 lines
2.0 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 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"` // 平均分数
|
|
}
|