feat: 添加我的课程API接口
This commit is contained in:
parent
05bd8e6eff
commit
4bab884e99
15
server/api/api/mycourse/mycourse.go
Normal file
15
server/api/api/mycourse/mycourse.go
Normal 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)
|
||||||
|
}
|
36
server/api/api/mycourse/v1/mycourse.go
Normal file
36
server/api/api/mycourse/v1/mycourse.go
Normal 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:"最后学习时间"`
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user