Continued work on messages and notifications.
This commit is contained in:
@@ -58,8 +58,12 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
domainMsgs "synlotto-website/internal/domain/messages"
|
||||
domainNotifs "synlotto-website/internal/domain/notifications"
|
||||
weberr "synlotto-website/internal/http/error"
|
||||
databasePlatform "synlotto-website/internal/platform/database"
|
||||
messagesvc "synlotto-website/internal/platform/services/messages"
|
||||
notifysvc "synlotto-website/internal/platform/services/notifications"
|
||||
|
||||
"synlotto-website/internal/platform/config"
|
||||
"synlotto-website/internal/platform/csrf"
|
||||
@@ -78,6 +82,11 @@ type App struct {
|
||||
Router *gin.Engine
|
||||
Handler http.Handler
|
||||
Server *http.Server
|
||||
|
||||
Services struct {
|
||||
Messages domainMsgs.MessageService
|
||||
Notifications domainNotifs.NotificationService
|
||||
}
|
||||
}
|
||||
|
||||
func Load(configPath string) (*App, error) {
|
||||
@@ -119,6 +128,9 @@ func Load(configPath string) (*App, error) {
|
||||
Router: router,
|
||||
}
|
||||
|
||||
app.Services.Messages = messagesvc.New(db)
|
||||
app.Services.Notifications = notifysvc.New(db)
|
||||
|
||||
// Inject *App into Gin context for handler access
|
||||
router.Use(func(c *gin.Context) {
|
||||
c.Set("app", app)
|
||||
|
||||
Reference in New Issue
Block a user