
- 新增我的课程列表API接口 - 支持按学习状态筛选(全部/学习中/已完结) - 支持分页查询 - 包含课程基本信息、学习进度等数据 - 添加Apifox接口文档配置指南 文件变更: - server/api/admin/mycourse/mycourse.go - API接口定义 - server/internal/controller/admin/mycourse/mycourse.go - 控制器层 - server/internal/service/mycourse.go - 服务层(模拟数据) - server/internal/router/admin.go - 路由配置 - docs/apifox_config.md - 接口文档
56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
// Package sys
|
|
// @Link https://github.com/bufanyun/hotgo
|
|
// @Copyright Copyright (c) 2023 HotGo CLI
|
|
// @Author Ms <133814250@qq.com>
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
package sys
|
|
|
|
import (
|
|
"context"
|
|
"hotgo/api/admin/attachment"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
var (
|
|
Attachment = cAttachment{}
|
|
)
|
|
|
|
type cAttachment struct{}
|
|
|
|
// Delete 删除附件
|
|
func (c *cAttachment) Delete(ctx context.Context, req *attachment.DeleteReq) (res *attachment.DeleteRes, err error) {
|
|
err = service.SysAttachment().Delete(ctx, &req.AttachmentDeleteInp)
|
|
return
|
|
}
|
|
|
|
// View 获取指定附件信息
|
|
func (c *cAttachment) View(ctx context.Context, req *attachment.ViewReq) (res *attachment.ViewRes, err error) {
|
|
data, err := service.SysAttachment().View(ctx, &req.AttachmentViewInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
res = new(attachment.ViewRes)
|
|
res.AttachmentViewModel = data
|
|
return
|
|
}
|
|
|
|
// List 查看附件列表
|
|
func (c *cAttachment) List(ctx context.Context, req *attachment.ListReq) (res *attachment.ListRes, err error) {
|
|
list, totalCount, err := service.SysAttachment().List(ctx, &req.AttachmentListInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
res = new(attachment.ListRes)
|
|
res.List = list
|
|
res.PageRes.Pack(req, totalCount)
|
|
return
|
|
}
|
|
|
|
// ClearKind 清空上传类型
|
|
func (c *cAttachment) ClearKind(ctx context.Context, req *attachment.ClearKindReq) (res *attachment.ClearKindRes, err error) {
|
|
err = service.SysAttachment().ClearKind(ctx, &req.AttachmentClearKindInp)
|
|
return
|
|
}
|