RezinaLMS-BackEnd/internal/services/user/service.go
2026-10-19 17:59:34 +03:00

46 lines
1.2 KiB
Go

package user
import (
"Rezina-Backend/internal/config"
"Rezina-Backend/internal/ports"
emailtemplates "Rezina-Backend/internal/services/emailtemplates"
"Rezina-Backend/internal/services/messenger"
profilefieldoptions "Rezina-Backend/internal/services/profilefieldoptions"
"time"
)
const (
OtpExpiry = 5 * time.Minute
)
type Service struct {
tokenStore ports.TokenStore
userStore ports.UserStore
otpStore ports.OtpStore
messengerSvc *messenger.Service
emailTemplateSvc *emailtemplates.Service
profileFieldOptionSvc *profilefieldoptions.Service
config *config.Config
authStatusCache authStatusCache
}
func NewService(
tokenStore ports.TokenStore,
userStore ports.UserStore,
otpStore ports.OtpStore,
messengerSvc *messenger.Service,
emailTemplateSvc *emailtemplates.Service,
profileFieldOptionSvc *profilefieldoptions.Service,
cfg *config.Config,
) *Service {
return &Service{
tokenStore: tokenStore,
userStore: userStore,
otpStore: otpStore,
messengerSvc: messengerSvc,
emailTemplateSvc: emailTemplateSvc,
profileFieldOptionSvc: profileFieldOptionSvc,
config: cfg,
}
}