Refactor and remove sqlite and replace with MySQL
This commit is contained in:
28
internal/http/routes/accountroutes.go
Normal file
28
internal/http/routes/accountroutes.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"net/http"
|
||||
|
||||
accountHandlers "synlotto-website/handlers/account"
|
||||
lotteryDrawHandlers "synlotto-website/handlers/lottery/tickets"
|
||||
|
||||
"synlotto-website/handlers"
|
||||
"synlotto-website/middleware"
|
||||
)
|
||||
|
||||
func SetupAccountRoutes(mux *http.ServeMux, db *sql.DB) {
|
||||
mux.HandleFunc("/account/login", accountHandlers.Login(db))
|
||||
mux.HandleFunc("/account/logout", middleware.Protected(accountHandlers.Logout))
|
||||
mux.HandleFunc("/account/signup", accountHandlers.Signup)
|
||||
mux.HandleFunc("/account/tickets/add_ticket", lotteryDrawHandlers.AddTicket(db))
|
||||
mux.HandleFunc("/account/tickets/my_tickets", lotteryDrawHandlers.GetMyTickets(db))
|
||||
mux.HandleFunc("/account/messages", middleware.Protected(handlers.MessagesInboxHandler(db)))
|
||||
mux.HandleFunc("/account/messages/read", middleware.Protected(handlers.ReadMessageHandler(db)))
|
||||
mux.HandleFunc("/account/messages/archive", middleware.Protected(handlers.ArchiveMessageHandler(db)))
|
||||
mux.HandleFunc("/account/messages/archived", middleware.Protected(handlers.ArchivedMessagesHandler(db)))
|
||||
mux.HandleFunc("/account/messages/restore", middleware.Protected(handlers.RestoreMessageHandler(db)))
|
||||
mux.HandleFunc("/account/messages/send", middleware.Protected(handlers.SendMessageHandler(db)))
|
||||
mux.HandleFunc("/account/notifications", middleware.Protected(handlers.NotificationsHandler(db)))
|
||||
mux.HandleFunc("/account/notifications/read", middleware.Protected(handlers.MarkNotificationReadHandler(db)))
|
||||
}
|
||||
Reference in New Issue
Block a user