feat(message): store messages in Postgres

This commit is contained in:
kk10
2026-10-05 13:26:21 +03:00
parent 04f7c046b6
commit 385a8c0312
6 changed files with 82 additions and 36 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ func (h *MessageHandler) Create(w http.ResponseWriter, r *http.Request) {
return
}
message, err := h.service.Create(userID, chatID, req.Text)
message, err := h.service.Create(r.Context(), userID, chatID, req.Text)
switch {
case errors.Is(err, service.ErrMessageChatNotFound):
httpx.WriteError(
@@ -93,7 +93,7 @@ func (h *MessageHandler) List(w http.ResponseWriter, r *http.Request) {
return
}
messages, nextCursor, err := h.service.List(userID, chatID, limit, cursor)
messages, nextCursor, err := h.service.List(r.Context(), userID, chatID, limit, cursor)
switch {
case errors.Is(err, service.ErrMessageChatNotFound):
httpx.WriteError(