58 lines
1.3 KiB
Go
58 lines
1.3 KiB
Go
package course_management
|
|
|
|
import (
|
|
"Yimaru-Backend/internal/domain"
|
|
"context"
|
|
)
|
|
|
|
func (s *Service) 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) {
|
|
return s.courseStore.CreateModuleVideo(ctx, moduleID, title, description, videoURL, duration, resolution, instructorID, thumbnail, visibility)
|
|
}
|
|
|
|
func (s *Service) PublishModuleVideo(
|
|
ctx context.Context,
|
|
videoID int64,
|
|
) error {
|
|
return s.courseStore.PublishModuleVideo(ctx, videoID)
|
|
}
|
|
|
|
func (s *Service) GetPublishedVideosByModule(
|
|
ctx context.Context,
|
|
moduleID int64,
|
|
) ([]domain.ModuleVideo, error) {
|
|
return s.courseStore.GetPublishedVideosByModule(ctx, moduleID)
|
|
}
|
|
|
|
func (s *Service) UpdateModuleVideo(
|
|
ctx context.Context,
|
|
id int64,
|
|
title *string,
|
|
description *string,
|
|
videoURL *string,
|
|
duration *int32,
|
|
resolution *string,
|
|
visibility *string,
|
|
thumbnail *string,
|
|
isActive *bool,
|
|
) error {
|
|
return s.courseStore.UpdateModuleVideo(ctx, id, title, description, videoURL, duration, resolution, visibility, thumbnail, isActive)
|
|
}
|
|
|
|
func (s *Service) DeleteModuleVideo(
|
|
ctx context.Context,
|
|
id int64,
|
|
) error {
|
|
return s.courseStore.DeleteModuleVideo(ctx, id)
|
|
}
|