22 lines
480 B
Go
22 lines
480 B
Go
package handlers
|
|
|
|
import (
|
|
"go-rest-api/internal/repository"
|
|
"go-rest-api/internal/service"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Handler struct {
|
|
healthHandler *HealthHandler
|
|
authHandler *AuthHandler
|
|
}
|
|
|
|
func NewHandler(db *gorm.DB) *Handler {
|
|
userRepo := repository.NewUserRepository(db)
|
|
authService := service.NewAuthService(userRepo)
|
|
|
|
return &Handler{
|
|
healthHandler: NewHealthHandler(),
|
|
authHandler: NewAuthHandler(authService),
|
|
}
|
|
} |