dao

package
v0.0.0-...-23f538b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Id     string
	Name   string
	Parent string
	Sort   int32
}

func (Category) TableName

func (Category) TableName() string

type CategoryDao

type CategoryDao struct {
}

func (*CategoryDao) All

All: 获取所有分类

func (*CategoryDao) Delete

func (c *CategoryDao) Delete(ids []string) *public.BusinessException

Delete 删除分类

func (*CategoryDao) GetParent

func (c *CategoryDao) GetParent(id string) []string

GetParent: 返回传入分类 id 及其父级 id

func (*CategoryDao) List

func (*CategoryDao) PrimaryCategory

func (c *CategoryDao) PrimaryCategory() ([]*dto.CategoryDto, *public.BusinessException)

PrimaryCategory: 获取所有一级分类

func (*CategoryDao) Save

type Chapter

type Chapter struct {
	Id       string
	CourseId string
	Name     string
	Sort     int32
	// 创建时间
	CreateTime time.Time
	// 修改时间
	UpdateTime time.Time
	Creator    string
	Updater    string
}

func (Chapter) TableName

func (Chapter) TableName() string

type ChapterDao

type ChapterDao struct {
}

func (*ChapterDao) All

func (c *ChapterDao) All(courseId string) ([]*dto.ChapterDto, *public.BusinessException)

All: 获取一门课程的所有大章

func (*ChapterDao) Delete

func (c *ChapterDao) Delete(ids []string) *public.BusinessException

Delete 删除大章

func (*ChapterDao) List

List : get Chapter page

func (*ChapterDao) Save

Save: 保存/更新大章

func (*ChapterDao) SelectByProperty

func (c *ChapterDao) SelectByProperty(property, value string) ([]*dto.ChapterDto, *public.BusinessException)

type Course

type Course struct {
	Id        string
	Name      string
	Summary   string
	Time      int32
	Price     float64
	Image     string
	Level     string //级别
	Charge    string //收费
	Status    string
	Enroll    int32 //报名人数
	Sort      int32 //排序
	TeacherId string
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (Course) TableName

func (Course) TableName() string

type CourseCategory

type CourseCategory struct {
	Id         string
	CourseId   string
	CategoryId string
}

func (CourseCategory) TableName

func (CourseCategory) TableName() string

type CourseCategoryDao

type CourseCategoryDao struct {
}

func (*CourseCategoryDao) BatchInsert

func (r *CourseCategoryDao) BatchInsert(courseId string, categoryIds []string) *public.BusinessException

BatchInsert: 批量插入

func (*CourseCategoryDao) CountByCategories

func (r *CourseCategoryDao) CountByCategories(categories []string) int64

CountByCategories: 分类是否被课程关联

func (*CourseCategoryDao) SelectByCourseId

func (r *CourseCategoryDao) SelectByCourseId(courseId string) ([]string, *public.BusinessException)

SelectByCourseId: 查询课程关联的所有分类记录

func (*CourseCategoryDao) SelectCourseIds

func (r *CourseCategoryDao) SelectCourseIds(categories ...string) []string

SelectCourseIds: 通过分类 id 获取课程 id

type CourseContent

type CourseContent struct {
	Id      string
	Content string
}

func (CourseContent) TableName

func (CourseContent) TableName() string

type CourseContentDao

type CourseContentDao struct {
}

func (*CourseContentDao) SaveContent

SaveContent: 插入/更新

func (*CourseContentDao) SelectById

type CourseDao

type CourseDao struct {
}

func (*CourseDao) CarouselCourse

func (c *CourseDao) CarouselCourse() ([]*dto.CourseDto, *public.BusinessException)

CarouselCourse: 轮播图课程

func (*CourseDao) Delete

func (c *CourseDao) Delete(ids []string) *public.BusinessException

Delete 删除课程

func (*CourseDao) FindContent

func (c *CourseDao) FindContent(id string) (*dto.CourseContentDto, *public.BusinessException)

FindContent: 获取课程内容

func (*CourseDao) List

List : get course page

func (*CourseDao) MoveSortsBackward

func (c *CourseDao) MoveSortsBackward(tx *gorm.DB, sortDto *dto.SortDto) *public.BusinessException

MoveSortsForward: 将顺序在oldSort之前newSort之后的记录往后一个位置

func (*CourseDao) MoveSortsForward

func (c *CourseDao) MoveSortsForward(tx *gorm.DB, sortDto *dto.SortDto) *public.BusinessException

MoveSortsForward: 将顺序在oldSort~newSort之间的记录往前一个位置

func (*CourseDao) NewPublish

func (c *CourseDao) NewPublish() ([]*dto.CourseDto, *public.BusinessException)

NewPublish: 新上好课

func (*CourseDao) Save

Save: 保存/更新

func (*CourseDao) SaveContent

func (c *CourseDao) SaveContent(ccd *dto.CourseContentDto) *public.BusinessException

SaveContent: 保存课程内容

func (*CourseDao) SelectByProperty

func (c *CourseDao) SelectByProperty(property, value string) *Course

SelectByProperty: 查询课程

func (*CourseDao) SelectCourseByIds

func (c *CourseDao) SelectCourseByIds(ids []string, all bool) ([]*dto.CourseDto, *public.BusinessException)

SelectCourseByIds: 批量获取课程 all-当ids为空时是否返回所有course

func (*CourseDao) UpdateCourseDuration

func (c *CourseDao) UpdateCourseDuration(id string) *public.BusinessException

UpdateCourseDuration: 更新课程时长

func (*CourseDao) UpdateEnroll

func (c *CourseDao) UpdateEnroll(id string)

UpdateEnrollL: 更新课程报名人数

func (*CourseDao) UpdateSort

func (c *CourseDao) UpdateSort(tx *gorm.DB, sortDto *dto.SortDto) *public.BusinessException

UpdateSort: 更新课程排序

type CourseFile

type CourseFile struct {
	Id       string
	CourseId string
	Name     string
	Url      string
	Size     int32
}

func (CourseFile) TableName

func (CourseFile) TableName() string

type CourseFileDao

type CourseFileDao struct {
}

func (*CourseFileDao) Delete

Delete 删除小节

func (*CourseFileDao) List

func (c *CourseFileDao) List(courseId string) ([]*dto.CourseFileDto, *public.BusinessException)

List : get CourseFile list

func (*CourseFileDao) Save

Save: 保存/更新小节

type MemberCourse

type MemberCourse struct {
	Id        uint32
	MemberId  string
	CourseId  string
	LastLearn string // 上次学习到 格式为 1 1 1280 第一章第一节第1280秒
	CreateAt  time.Time
	UpdateAt  time.Time
}

func (MemberCourse) TableName

func (m MemberCourse) TableName() string

type MemberCourseDao

type MemberCourseDao struct {
}

func (*MemberCourseDao) AddToMyCourse

func (m *MemberCourseDao) AddToMyCourse(data *MemberCourse) *public.BusinessException

func (*MemberCourseDao) CourseInfo

func (m *MemberCourseDao) CourseInfo(memberId, courseId string) (string, *public.BusinessException)

func (*MemberCourseDao) MyCourse

func (m *MemberCourseDao) MyCourse(str string) ([]*dto.CourseDto, *public.BusinessException)

func (*MemberCourseDao) SaveLearnInfo

func (m *MemberCourseDao) SaveLearnInfo(rows []string) *public.BusinessException

type Section

type Section struct {
	// id
	Id string
	// 标题
	Title string
	// 课程|course.id
	CourseId string
	// 大章|chapter.id
	ChapterId string
	// 视频
	Video string
	// 时长|单位秒
	Time int32
	// 收费|枚举[SectionChargeEnum]:CHARGE("C", "收费"),FREE("F", "免费")
	Charge string
	// 顺序
	Sort int32
	// 创建时间
	CreatedTime time.Time
	// 修改时间
	UpdatedTime time.Time
}

func (Section) TableName

func (Section) TableName() string

type SectionDao

type SectionDao struct {
}

func (*SectionDao) Delete

func (c *SectionDao) Delete(ids []string) *public.BusinessException

Delete 删除小节

func (*SectionDao) List

List : get Section page

func (*SectionDao) Save

Save: 保存/更新小节

func (*SectionDao) SelectByProperty

func (c *SectionDao) SelectByProperty(property, value string) ([]*dto.SectionDto, *public.BusinessException)

type Teacher

type Teacher struct {
	Id       string
	Name     string
	Image    string
	Position string
	Intro    string
}

func (Teacher) TableName

func (Teacher) TableName() string

type TeacherDao

type TeacherDao struct {
}

func (*TeacherDao) All

All: 获取全部讲师

func (*TeacherDao) Delete

func (c *TeacherDao) Delete(ids []string) *public.BusinessException

Delete: 删除讲师

func (*TeacherDao) List

List : get Teacher page

func (*TeacherDao) Save

Save: 保存/更新讲师

func (*TeacherDao) SearchByProperty

func (c *TeacherDao) SearchByProperty(property, value string) ([]*dto.TeacherDto, *public.BusinessException)

SearchByProperty: 模糊查询

func (*TeacherDao) SelectByProperty

func (c *TeacherDao) SelectByProperty(property, value string) (*dto.TeacherDto, *public.BusinessException)

SelectByProperty: 精确查询

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL