feat:lab1-catchup

This commit is contained in:
Оля Мороз
2026-10-01 10:55:28 +03:00
parent 65003b6119
commit 9febc0bbe4
12 changed files with 672 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
package domain
import "time"
// User — пользователь системы.
type User struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
}
// Chat — чат с участниками.
type Chat struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
// Message — сообщение в чате.
type Message 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"`
}
// MessagePage — страница истории сообщений.
type MessagePage struct {
Items []Message `json:"items"`
NextCursor *string `json:"next_cursor"`
}
// ChatPage — страница списка чатов.
type ChatPage struct {
Items []Chat `json:"items"`
NextCursor *string `json:"next_cursor"`
}
// ErrorBody — тело ошибки в формате контракта.
type ErrorBody struct {
Error ErrorDetail `json:"error"`
}
// ErrorDetail — детали ошибки.
type ErrorDetail struct {
Code string `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}