
- 新增我的课程列表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 - 接口文档
54 lines
1.5 KiB
Go
54 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/config"
|
|
"hotgo/internal/consts"
|
|
"hotgo/internal/model/input/form"
|
|
"hotgo/internal/model/input/sysin"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
var (
|
|
Config = cConfig{}
|
|
)
|
|
|
|
type cConfig struct{}
|
|
|
|
// GetConfig 获取指定分组的配置
|
|
func (c *cConfig) GetConfig(ctx context.Context, req *config.GetReq) (res *config.GetRes, err error) {
|
|
res = new(config.GetRes)
|
|
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, &req.GetConfigInp)
|
|
return
|
|
}
|
|
|
|
// UpdateConfig 更新指定分组的配置
|
|
func (c *cConfig) UpdateConfig(ctx context.Context, req *config.UpdateReq) (res *config.UpdateRes, err error) {
|
|
err = service.SysConfig().UpdateConfigByGroup(ctx, &req.UpdateConfigInp)
|
|
return
|
|
}
|
|
|
|
// TypeSelect 数据类型选项
|
|
func (c *cConfig) TypeSelect(_ context.Context, _ *config.TypeSelectReq) (res config.TypeSelectRes, err error) {
|
|
for _, v := range consts.ConfigTypes {
|
|
res = append(res, form.Select{
|
|
Value: v,
|
|
Name: v,
|
|
Label: v,
|
|
})
|
|
}
|
|
return
|
|
}
|
|
|
|
// GetCash 获取提现的配置
|
|
func (c *cConfig) GetCash(ctx context.Context, _ *config.GetCashReq) (res *config.GetCashRes, err error) {
|
|
res = new(config.GetCashRes)
|
|
res.GetConfigModel, err = service.SysConfig().GetConfigByGroup(ctx, &sysin.GetConfigInp{Group: "cash"})
|
|
return
|
|
}
|