INNER CODE UNIT · Go
NewHandler
sy-vendor/Gobi · internal/handlers/handlers.go:37
func NewHandler(db *gorm.DB) *Handler {
// Create infrastructure services
cacheService := infrastructure.NewCacheService(config.AppConfig)
validationService := infrastructure.NewValidationService()
encryptionService := infrastructure.NewEncryptionService()
authService := infrastructure.NewAuthService()
// Create user repository for permission service
userRepo := repositories.NewUserRepository(db)
permissionService := infrastructure.NewPermissionService(userRepo)
sqlExecutionService := infrastructure.NewSQLExecutionService()
reportGeneratorService := infrastructure.NewReportGeneratorService()
webhookTriggerService := infrastructure.NewWebhookTriggerService()
// Create API key repository
apiKeyRepo := repositories.NewAPIKeyRepository(db)