Fleshing out some routes from notifications and messages

This commit is contained in:
2025-10-29 10:43:48 +00:00
parent 34918d770f
commit b6b5207d43
5 changed files with 280 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ package routes
import (
accountHandlers "synlotto-website/internal/handlers/account"
accountMessageHandlers "synlotto-website/internal/handlers/account/messages"
accountNotificationHandlers "synlotto-website/internal/handlers/account/notifications"
accountTicketHandlers "synlotto-website/internal/handlers/account/tickets"
"synlotto-website/internal/http/middleware"
@@ -49,6 +51,25 @@ func RegisterAccountRoutes(app *bootstrap.App) {
accAuth.GET("/logout", accountHandlers.Logout) // optional
}
// Messages (auth-required)
messages := r.Group("/account/messages")
messages.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
{
messages.GET("/", accountMessageHandlers.List)
messages.GET("/add", accountMessageHandlers.AddGet)
messages.POST("/add", accountMessageHandlers.AddPost)
messages.GET("/archived", accountMessageHandlers.ArchivedList) // renders archived.html
messages.GET("/:id", accountMessageHandlers.ReadGet) // renders read.html
}
// Notifications (auth-required)
notifications := r.Group("/account/notifications")
notifications.Use(middleware.AuthMiddleware(), middleware.RequireAuth())
{
notifications.GET("/", accountNotificationHandlers.List)
notifications.GET("/:id", accountNotificationHandlers.ReadGet) // renders read.html
}
// Tickets (auth-required)
tickets := r.Group("/account/tickets")
tickets.Use(middleware.AuthMiddleware(), middleware.RequireAuth())