From 4bab884e99492d10790d34b6cd1eeff0a364de35 Mon Sep 17 00:00:00 2001 From: yl Date: Mon, 28 Jul 2025 19:39:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=88=91=E7=9A=84?= =?UTF-8?q?=E8=AF=BE=E7=A8=8BAPI=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/api/mycourse/mycourse.go | 15 +++++++++++ server/api/api/mycourse/v1/mycourse.go | 36 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 server/api/api/mycourse/mycourse.go create mode 100644 server/api/api/mycourse/v1/mycourse.go 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:"最后学习时间"` +}