diff --git a/server/api/api/mycourse/mycourse.go b/server/api/api/mycourse/mycourse.go new file mode 100644 index 0000000..62883d0 --- /dev/null +++ b/server/api/api/mycourse/mycourse.go @@ -0,0 +1,15 @@ +// ================================================================================= +// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT. +// ================================================================================= + +package mycourse + +import ( + "context" + + "hotgo/api/api/mycourse/v1" +) + +type IMyCourseV1 interface { + MyCourseList(ctx context.Context, req *v1.MyCourseListReq) (res *v1.MyCourseListRes, err error) +} diff --git a/server/api/api/mycourse/v1/mycourse.go b/server/api/api/mycourse/v1/mycourse.go new file mode 100644 index 0000000..6511382 --- /dev/null +++ b/server/api/api/mycourse/v1/mycourse.go @@ -0,0 +1,36 @@ +package v1 + +import ( + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gtime" +) + +// MyCourseListReq 获取我的课程列表请求 +type MyCourseListReq struct { + g.Meta `path:"/mycourse/list" method:"get" tags:"我的课程" summary:"获取我的课程列表"` + Status string `json:"status" dc:"学习状态筛选:learning-学习中,completed-已完成,空值-全部"` + Page int `json:"page" d:"1" dc:"页码,从1开始"` + PageSize int `json:"pageSize" d:"10" dc:"每页数量,默认10条"` +} + +// MyCourseListRes 获取我的课程列表响应 +type MyCourseListRes struct { + List []*MyCourseItem `json:"list" dc:"课程列表"` + Total int `json:"total" dc:"总记录数"` + Page int `json:"page" dc:"当前页码"` + PageSize int `json:"pageSize" dc:"每页数量"` +} + +// MyCourseItem 我的课程项目 +type MyCourseItem struct { + Id int64 `json:"id" dc:"课程ID"` + Title string `json:"title" dc:"课程标题"` + Description string `json:"description" dc:"课程描述"` + Cover string `json:"cover" dc:"课程封面图片URL"` + Instructor string `json:"instructor" dc:"讲师姓名"` + Duration int `json:"duration" dc:"课程时长(秒)"` + Progress int `json:"progress" dc:"学习进度(0-100)"` + Status string `json:"status" dc:"学习状态:learning-学习中,completed-已完成"` + EnrollTime *gtime.Time `json:"enrollTime" dc:"报名时间"` + LastStudyTime *gtime.Time `json:"lastStudyTime" dc:"最后学习时间"` +}