254 lines
4.9 KiB
Go
254 lines
4.9 KiB
Go
package ports
|
|
|
|
import (
|
|
"Yimaru-Backend/internal/domain"
|
|
"context"
|
|
)
|
|
|
|
type CourseStore interface {
|
|
CreateCourseCategory(
|
|
ctx context.Context,
|
|
name string,
|
|
) (domain.CourseCategory, error)
|
|
GetCourseCategoryByID(
|
|
ctx context.Context,
|
|
id int64,
|
|
) (domain.CourseCategory, error)
|
|
GetAllCourseCategories(
|
|
ctx context.Context,
|
|
limit int32,
|
|
offset int32,
|
|
) ([]domain.CourseCategory, int64, error)
|
|
UpdateCourseCategory(
|
|
ctx context.Context,
|
|
id int64,
|
|
name *string,
|
|
isActive *bool,
|
|
) error
|
|
DeleteCourseCategory(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
CreateProgram(
|
|
ctx context.Context,
|
|
courseID int64,
|
|
title string,
|
|
description *string,
|
|
thumbnail *string,
|
|
displayOrder *int32,
|
|
) (domain.Program, error)
|
|
GetProgramByID(
|
|
ctx context.Context,
|
|
id int64,
|
|
) (domain.Program, error)
|
|
GetProgramsByCourse(
|
|
ctx context.Context,
|
|
courseID int64,
|
|
) ([]domain.Program, int64, error)
|
|
ListProgramsByCourse(
|
|
ctx context.Context,
|
|
courseID int64,
|
|
) ([]domain.Program, error)
|
|
ListActivePrograms(
|
|
ctx context.Context,
|
|
) ([]domain.Program, error)
|
|
UpdateProgramPartial(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
description *string,
|
|
thumbnail *string,
|
|
displayOrder *int32,
|
|
isActive *bool,
|
|
) error
|
|
UpdateProgramFull(
|
|
ctx context.Context,
|
|
program domain.Program,
|
|
) (domain.Program, error)
|
|
DeactivateProgram(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
DeleteProgram(
|
|
ctx context.Context,
|
|
id int64,
|
|
) (domain.Program, error)
|
|
CreateCourse(
|
|
ctx context.Context,
|
|
categoryID int64,
|
|
title string,
|
|
description *string,
|
|
) (domain.Course, error)
|
|
GetCourseByID(
|
|
ctx context.Context,
|
|
id int64,
|
|
) (domain.Course, error)
|
|
GetCoursesByCategory(
|
|
ctx context.Context,
|
|
categoryID int64,
|
|
limit int32,
|
|
offset int32,
|
|
) ([]domain.Course, int64, error)
|
|
UpdateCourse(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
description *string,
|
|
isActive *bool,
|
|
) error
|
|
DeleteCourse(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
CreateModule(
|
|
ctx context.Context,
|
|
levelID int64,
|
|
title string,
|
|
content *string,
|
|
displayOrder *int32,
|
|
) (domain.Module, error)
|
|
GetModulesByLevel(
|
|
ctx context.Context,
|
|
levelID int64,
|
|
) ([]domain.Module, int64, error)
|
|
UpdateModule(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
content *string,
|
|
displayOrder *int32,
|
|
isActive *bool,
|
|
) error
|
|
DeleteModule(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
CreateModuleVideo(
|
|
ctx context.Context,
|
|
moduleID int64,
|
|
title string,
|
|
description *string,
|
|
videoURL string,
|
|
duration int32,
|
|
resolution *string,
|
|
instructorID *string,
|
|
thumbnail *string,
|
|
visibility *string,
|
|
) (domain.ModuleVideo, error)
|
|
PublishModuleVideo(
|
|
ctx context.Context,
|
|
videoID int64,
|
|
) error
|
|
GetPublishedVideosByModule(
|
|
ctx context.Context,
|
|
moduleID int64,
|
|
) ([]domain.ModuleVideo, error)
|
|
UpdateModuleVideo(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
description *string,
|
|
videoURL *string,
|
|
duration *int32,
|
|
resolution *string,
|
|
visibility *string,
|
|
thumbnail *string,
|
|
isActive *bool,
|
|
) error
|
|
DeleteModuleVideo(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
CreatePracticeQuestion(
|
|
ctx context.Context,
|
|
practiceID int64,
|
|
question string,
|
|
questionVoicePrompt *string,
|
|
sampleAnswerVoicePrompt *string,
|
|
sampleAnswer *string,
|
|
tips *string,
|
|
qType string,
|
|
) (domain.PracticeQuestion, error)
|
|
GetQuestionsByPractice(
|
|
ctx context.Context,
|
|
practiceID int64,
|
|
) ([]domain.PracticeQuestion, error)
|
|
UpdatePracticeQuestion(
|
|
ctx context.Context,
|
|
id int64,
|
|
question *string,
|
|
sampleAnswer *string,
|
|
tips *string,
|
|
qType *string,
|
|
) error
|
|
DeletePracticeQuestion(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
CreatePractice(
|
|
ctx context.Context,
|
|
ownerType string,
|
|
ownerID int64,
|
|
title string,
|
|
description *string,
|
|
bannerImage *string,
|
|
persona *string,
|
|
isActive *bool,
|
|
) (domain.Practice, error)
|
|
GetPracticesByOwner(
|
|
ctx context.Context,
|
|
ownerType string,
|
|
ownerID int64,
|
|
) ([]domain.Practice, error)
|
|
UpdatePractice(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
description *string,
|
|
bannerImage *string,
|
|
persona *string,
|
|
isActive *bool,
|
|
) error
|
|
DeletePractice(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error
|
|
CreateLevel(
|
|
ctx context.Context,
|
|
programID int64,
|
|
title string,
|
|
description *string,
|
|
levelIndex int,
|
|
isActive *bool,
|
|
) (domain.Level, error)
|
|
GetLevelsByProgram(
|
|
ctx context.Context,
|
|
programID int64,
|
|
) ([]domain.Level, error)
|
|
UpdateLevel(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
description *string,
|
|
levelIndex *int,
|
|
isActive *bool,
|
|
) error
|
|
IncrementLevelModuleCount(
|
|
ctx context.Context,
|
|
levelID int64,
|
|
) error
|
|
IncrementLevelPracticeCount(
|
|
ctx context.Context,
|
|
levelID int64,
|
|
) error
|
|
IncrementLevelVideoCount(
|
|
ctx context.Context,
|
|
levelID int64,
|
|
) error
|
|
DeleteLevel(
|
|
ctx context.Context,
|
|
levelID int64,
|
|
) error
|
|
GetFullLearningTree(ctx context.Context) ([]domain.TreeCourse, error)
|
|
}
|