ЛР 2: PostgreSQL, сессии в Valkey, кэш истории (трек 1)

This commit is contained in:
Нурлыгаянова Екатерина
2026-10-29 11:29:38 +03:00
parent 65003b6119
commit 1503b5db81
132 changed files with 15114 additions and 20 deletions
+20
View File
@@ -0,0 +1,20 @@
package dto
import "time"
type CreateChatRequest struct {
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
}
type ChatResponse struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
type ChatsPageResponse struct {
Items []ChatResponse `json:"items"`
NextCursor *string `json:"next_cursor"`
}
+20
View File
@@ -0,0 +1,20 @@
package dto
import "time"
type CreateMessageRequest struct {
Text string `json:"text"`
}
type MessageResponse struct {
ID string `json:"id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
}
type MessagesPageResponse struct {
Items []MessageResponse `json:"items"`
NextCursor *string `json:"next_cursor"`
}
+23
View File
@@ -0,0 +1,23 @@
package dto
import "time"
type CreateUserRequest struct {
Username string `json:"username"`
DisplayName string `json:"display_name"`
Password string `json:"password"`
}
type UserResponse struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
}
type SessionResponse struct {
Token string `json:"token"`
TokenType string `json:"token_type"`
ExpiresAt time.Time `json:"expires_at"`
User UserResponse `json:"user"`
}