feat: 添加我的课程API接口

This commit is contained in:
yl 2025-07-28 19:39:39 +08:00
parent 05bd8e6eff
commit 4bab884e99
2 changed files with 51 additions and 0 deletions

View File

@ -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)
}

View File

@ -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:"最后学习时间"`
}