Yimaru-BackEnd/internal/services/course_management/service.go

52 lines
1.3 KiB
Go

package course_management
import (
"Yimaru-Backend/internal/config"
"Yimaru-Backend/internal/ports"
cloudconvertservice "Yimaru-Backend/internal/services/cloudconvert"
notificationservice "Yimaru-Backend/internal/services/notification"
vimeoservice "Yimaru-Backend/internal/services/vimeo"
)
type Service struct {
userStore ports.UserStore
courseStore ports.CourseStore
progressionStore ports.ProgressionStore
notificationSvc *notificationservice.Service
vimeoSvc *vimeoservice.Service
cloudConvertSvc *cloudconvertservice.Service
config *config.Config
}
func NewService(
userStore ports.UserStore,
courseStore ports.CourseStore,
progressionStore ports.ProgressionStore,
notificationSvc *notificationservice.Service,
cfg *config.Config,
) *Service {
return &Service{
userStore: userStore,
courseStore: courseStore,
progressionStore: progressionStore,
notificationSvc: notificationSvc,
config: cfg,
}
}
func (s *Service) SetVimeoService(vimeoSvc *vimeoservice.Service) {
s.vimeoSvc = vimeoSvc
}
func (s *Service) HasVimeoService() bool {
return s.vimeoSvc != nil
}
func (s *Service) SetCloudConvertService(ccSvc *cloudconvertservice.Service) {
s.cloudConvertSvc = ccSvc
}
func (s *Service) HasCloudConvertService() bool {
return s.cloudConvertSvc != nil
}