154 lines
6.0 KiB
Go
154 lines
6.0 KiB
Go
// Package sysin
|
|
// @Link https://github.com/bufanyun/hotgo
|
|
// @Copyright Copyright (c) 2025 HotGo CLI
|
|
// @Author Ms <133814250@qq.com>
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
// @AutoGenerate Version 2.17.8
|
|
package sysin
|
|
|
|
import (
|
|
"context"
|
|
"hotgo/internal/model/entity"
|
|
"hotgo/internal/model/input/form"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
// LessonUpdateFields 修改课程管理字段过滤
|
|
type LessonUpdateFields struct {
|
|
Name string `json:"name" dc:"课程名"`
|
|
Cover string `json:"cover" dc:"封面图"`
|
|
CategoryId int64 `json:"categoryId" dc:"所属分类"`
|
|
Video string `json:"video" dc:"介绍视频"`
|
|
School string `json:"school" dc:"所属学校"`
|
|
Description string `json:"description" dc:"课程概述"`
|
|
Target string `json:"target" dc:"授课目标"`
|
|
Outline string `json:"outline" dc:"课程大纲"`
|
|
Prerequisite string `json:"prerequisite" dc:"预备知识"`
|
|
Reference string `json:"reference" dc:"参考资料"`
|
|
Arrangement string `json:"arrangement" dc:"学时安排"`
|
|
StartTime *gtime.Time `json:"startTime" dc:"开课时间"`
|
|
EndTime *gtime.Time `json:"endTime" dc:"结课时间"`
|
|
Question string `json:"question" dc:"常见问题"`
|
|
UpdatedBy int64 `json:"updatedBy" dc:"更新人"`
|
|
Difficulty int `json:"difficulty" dc:"课程难度"`
|
|
Subject string `json:"subject" dc:"所属专题"`
|
|
}
|
|
|
|
// LessonInsertFields 新增课程管理字段过滤
|
|
type LessonInsertFields struct {
|
|
Name string `json:"name" dc:"课程名"`
|
|
Cover string `json:"cover" dc:"封面图"`
|
|
CategoryId int64 `json:"categoryId" dc:"所属分类"`
|
|
Video string `json:"video" dc:"介绍视频"`
|
|
School string `json:"school" dc:"所属学校"`
|
|
Description string `json:"description" dc:"课程概述"`
|
|
Target string `json:"target" dc:"授课目标"`
|
|
Outline string `json:"outline" dc:"课程大纲"`
|
|
Prerequisite string `json:"prerequisite" dc:"预备知识"`
|
|
Reference string `json:"reference" dc:"参考资料"`
|
|
Arrangement string `json:"arrangement" dc:"学时安排"`
|
|
StartTime *gtime.Time `json:"startTime" dc:"开课时间"`
|
|
EndTime *gtime.Time `json:"endTime" dc:"结课时间"`
|
|
Question string `json:"question" dc:"常见问题"`
|
|
CreatedBy int64 `json:"createdBy" dc:"创建人"`
|
|
Difficulty int `json:"difficulty" dc:"课程难度"`
|
|
Subject string `json:"subject" dc:"所属专题"`
|
|
}
|
|
|
|
// LessonEditInp 修改/新增课程管理
|
|
type LessonEditInp struct {
|
|
entity.Lesson
|
|
}
|
|
|
|
func (in *LessonEditInp) Filter(ctx context.Context) (err error) {
|
|
// 验证课程名
|
|
if err := g.Validator().Rules("required").Data(in.Name).Messages("课程名不能为空").Run(ctx); err != nil {
|
|
return err.Current()
|
|
}
|
|
|
|
// 验证封面图
|
|
if err := g.Validator().Rules("required").Data(in.Cover).Messages("封面图不能为空").Run(ctx); err != nil {
|
|
return err.Current()
|
|
}
|
|
|
|
// 验证所属分类
|
|
if err := g.Validator().Rules("required").Data(in.CategoryId).Messages("所属分类不能为空").Run(ctx); err != nil {
|
|
return err.Current()
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
type LessonEditModel struct{}
|
|
|
|
// LessonDeleteInp 删除课程管理
|
|
type LessonDeleteInp struct {
|
|
Id interface{} `json:"id" v:"required#id不能为空" dc:"id"`
|
|
}
|
|
|
|
func (in *LessonDeleteInp) Filter(ctx context.Context) (err error) {
|
|
return
|
|
}
|
|
|
|
type LessonDeleteModel struct{}
|
|
|
|
// LessonViewInp 获取指定课程管理信息
|
|
type LessonViewInp struct {
|
|
Id int64 `json:"id" v:"required#id不能为空" dc:"id"`
|
|
}
|
|
|
|
func (in *LessonViewInp) Filter(ctx context.Context) (err error) {
|
|
return
|
|
}
|
|
|
|
type LessonViewModel struct {
|
|
entity.Lesson
|
|
}
|
|
|
|
// LessonListInp 获取课程管理列表
|
|
type LessonListInp struct {
|
|
form.PageReq
|
|
Id int64 `json:"id" dc:"id"`
|
|
Name string `json:"name" dc:"课程名"`
|
|
School string `json:"school" dc:"所属学校"`
|
|
}
|
|
|
|
func (in *LessonListInp) Filter(ctx context.Context) (err error) {
|
|
return
|
|
}
|
|
|
|
type LessonListModel struct {
|
|
Id int64 `json:"id" dc:"id"`
|
|
Name string `json:"name" dc:"课程名"`
|
|
Cover string `json:"cover" dc:"封面图"`
|
|
CategoryId int64 `json:"categoryId" dc:"所属分类"`
|
|
Video string `json:"video" dc:"介绍视频"`
|
|
School string `json:"school" dc:"所属学校"`
|
|
StartTime *gtime.Time `json:"startTime" dc:"开课时间"`
|
|
EndTime *gtime.Time `json:"endTime" dc:"结课时间"`
|
|
Difficulty int `json:"difficulty" dc:"课程难度"`
|
|
Subject string `json:"subject" dc:"所属专题"`
|
|
}
|
|
|
|
// LessonExportModel 导出课程管理
|
|
type LessonExportModel struct {
|
|
Id int64 `json:"id" dc:"id"`
|
|
Name string `json:"name" dc:"课程名"`
|
|
Cover string `json:"cover" dc:"封面图"`
|
|
CategoryId int64 `json:"categoryId" dc:"所属分类"`
|
|
Video string `json:"video" dc:"介绍视频"`
|
|
School string `json:"school" dc:"所属学校"`
|
|
Description string `json:"description" dc:"课程概述"`
|
|
Target string `json:"target" dc:"授课目标"`
|
|
Outline string `json:"outline" dc:"课程大纲"`
|
|
Prerequisite string `json:"prerequisite" dc:"预备知识"`
|
|
Reference string `json:"reference" dc:"参考资料"`
|
|
Arrangement string `json:"arrangement" dc:"学时安排"`
|
|
StartTime *gtime.Time `json:"startTime" dc:"开课时间"`
|
|
EndTime *gtime.Time `json:"endTime" dc:"结课时间"`
|
|
Question string `json:"question" dc:"常见问题"`
|
|
Difficulty int `json:"difficulty" dc:"课程难度"`
|
|
Subject string `json:"subject" dc:"所属专题"`
|
|
} |