app-cloudep-notification-se.../internal/svc/service_context.go

27 lines
693 B
Go

package svc
import (
"app-cloudep-notification-service/internal/config"
domainUC "app-cloudep-notification-service/internal/domain/usecase"
"app-cloudep-notification-service/internal/usecase"
v "code.30cm.net/digimon/library-go/validator"
)
type ServiceContext struct {
Config config.Config
Validate v.Validate
MailSender domainUC.MailClientUseCase
SMSSender domainUC.SMSClientUseCase
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
MailSender: usecase.MustMailgunUseCase(usecase.MailUseCaseParam{Conf: c}),
SMSSender: usecase.MustMitakeUseCase(usecase.SMSUseCaseParam{Conf: c}),
Validate: v.MustValidator(),
}
}