RezinaLMS-BackEnd/internal/services/user/service.go
Yared Yemane eb1d0c68e2 Speed up API paths with batch question loads, request memoization, and soft caches.
Also replace question options on update so placement grading stays consistent with admin edits, and tune the Postgres pool defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 00:06:43 -07:00

46 lines
1.2 KiB
Go

package user
import (
"Yimaru-Backend/internal/config"
"Yimaru-Backend/internal/ports"
emailtemplates "Yimaru-Backend/internal/services/emailtemplates"
"Yimaru-Backend/internal/services/messenger"
profilefieldoptions "Yimaru-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,
}
}