feat:level4

This commit is contained in:
Оля Мороз
2026-11-02 19:16:40 +03:00
parent 185f092f7a
commit ad9c28329c
19 changed files with 841 additions and 57 deletions
+33 -5
View File
@@ -20,11 +20,12 @@ type Chat struct {
}
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"`
ID string `json:"id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
AttachmentIDs []string `json:"attachment_ids"`
}
type MessagePage struct {
@@ -54,6 +55,30 @@ type ErrorDetail struct {
RequestID string `json:"request_id"`
}
type Variant struct {
Name string `json:"name"`
ContentType string `json:"content_type"`
SizeBytes int64 `json:"size_bytes"`
Width int `json:"width"`
Height int `json:"height"`
SHA256 string `json:"sha256"`
}
type Attachment struct {
ID string `json:"id"`
ChatID string `json:"chat_id"`
OwnerID string `json:"owner_id"`
Filename string `json:"filename"`
ContentType string `json:"content_type"`
SizeBytes int64 `json:"size_bytes"`
SHA256 string `json:"sha256"`
Status string `json:"status"`
Variants []Variant `json:"variants"`
ErrorCode *string `json:"error_code"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
var (
ErrNotFound = errors.New("not found")
ErrConflict = errors.New("conflict")
@@ -61,4 +86,7 @@ var (
ErrUnauthorized = errors.New("unauthorized")
ErrTimeout = errors.New("timeout")
ErrUnavailable = errors.New("unavailable")
ErrTooLarge = errors.New("payload too large")
ErrUnsupported = errors.New("unsupported media type")
ErrNotImage = errors.New("not a valid image")
)