lab2 done
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Khakimov Dmitrij
2026-10-06 22:38:28 +03:00
parent 47a3cd582d
commit 300ef7714e
74 changed files with 2785 additions and 112 deletions
+5 -2
View File
@@ -14,8 +14,8 @@ type Chat struct {
cursor cursorCodec
}
func NewChat(useCase UseCase) *Chat {
return &Chat{useCase: useCase, cursor: newCursorCodec()}
func NewChat(useCase UseCase, cursorKey [32]byte) *Chat {
return &Chat{useCase: useCase, cursor: cursorCodec{secret: cursorKey}}
}
func (h *Chat) Router() *echo.Echo {
@@ -60,8 +60,11 @@ func (h *Chat) Router() *echo.Echo {
e.GET("/swagger/*", swaggerUI)
e.POST("/api/v1/users", h.createUser)
e.POST("/api/v1/auth/sessions", h.createSession)
api := e.Group("/api/v1", h.authenticate)
api.GET("/users/me", h.currentUser)
api.DELETE("/auth/sessions/current", h.deleteSession)
api.POST("/chats", h.createChat)
api.GET("/chats", h.listChats)
api.GET("/chats/:chat_id", h.getChat)