Перенести актуальную lab2 как базу lab3

This commit is contained in:
Vladislav Agapov
2026-10-16 11:42:02 +03:00
parent 0ab3a341aa
commit a57cbcf329
150 changed files with 10826 additions and 71 deletions
+22
View File
@@ -0,0 +1,22 @@
package fiber
// initRoutes registers health endpoints and authenticated application routes.
func (ctrl *Controller) initRoutes() {
ctrl.server.Get("/health/live", ctrl.handleLive)
ctrl.server.Get("/health/ready", ctrl.handleReady)
ctrl.server.Use(ctrl.admit)
ctrl.server.Post("/api/v1/users", ctrl.HandleUsersCreate)
ctrl.server.Post("/api/v1/auth/sessions", ctrl.HandleLogin)
api := ctrl.server.Group("/api/v1", ctrl.requireIdentity)
api.Delete("/auth/sessions/current", ctrl.HandleLogout)
api.Get("/users/me", ctrl.HandleUsersGetMe)
api.Post("/chats", ctrl.HandleChatsCreate)
api.Get("/chats", ctrl.HandleChatsGetPage)
api.Get("/chats/:chat_id", ctrl.HandleChatsGetByID)
api.Post("/chats/:chat_id/messages", ctrl.HandleMessagesCreate)
api.Get("/chats/:chat_id/messages", ctrl.HandleMessagesGetPage)
ctrl.server.Use(ctrl.handleNotFound)
}