ЛР4 - БВТ2303 - Голиков- на 4 #13

Closed
Maximillan_Mercer wants to merge 64 commits from Maximillan_Mercer/mtusi2026lab4-fork:solution/BVT2303-Golikov into main
Showing only changes of commit 0a72eab1da - Show all commits
+12 -5
View File
@@ -8,11 +8,12 @@ import (
)
type Handlers struct {
Health *handler.HealthHandler
User *handler.UserHandler
Chat *handler.ChatHandler
Message *handler.MessageHandler
Auth *handler.AuthHandler
Health *handler.HealthHandler
User *handler.UserHandler
Chat *handler.ChatHandler
Message *handler.MessageHandler
Auth *handler.AuthHandler
Attachment *handler.AttachmentHandler
}
func NewRouter(h Handlers, auth gin.HandlerFunc) *gin.Engine {
@@ -44,6 +45,12 @@ func NewRouter(h Handlers, auth gin.HandlerFunc) *gin.Engine {
protected.GET("/chats/:chat_id", h.Chat.Get)
protected.POST("/chats/:chat_id/messages", h.Message.Create)
protected.GET("/chats/:chat_id/messages", h.Message.List)
if h.Attachment != nil {
protected.POST("/chats/:chat_id/attachments", h.Attachment.Upload)
protected.GET("/attachments/:attachment_id", h.Attachment.Get)
protected.GET("/attachments/:attachment_id/content", h.Attachment.Content)
}
}
return r