feat: attachments over S3 (grade 3)

This commit is contained in:
2026-11-20 03:55:39 +03:00
parent 083d0d80cc
commit 89e9e7b4d4
44 changed files with 1468 additions and 67 deletions
+27 -5
View File
@@ -29,11 +29,33 @@ func (c Chat) HasMember(userID uuid.UUID) bool {
}
type Message struct {
ID uuid.UUID
ChatID uuid.UUID
SenderID uuid.UUID
Text string
CreatedAt time.Time
ID uuid.UUID
ChatID uuid.UUID
SenderID uuid.UUID
Text string
AttachmentIDs []uuid.UUID
CreatedAt time.Time
}
const (
AttachmentReady = "ready"
ContentPNG = "image/png"
ContentJPEG = "image/jpeg"
)
type Attachment struct {
ID uuid.UUID
ChatID uuid.UUID
OwnerID uuid.UUID
Filename string
ContentType string
SizeBytes int64
SHA256 string
ObjectKey string
Status string
ErrorCode *string
CreatedAt time.Time
UpdatedAt time.Time
}
type Session struct {
+7 -5
View File
@@ -3,9 +3,11 @@ package domain
import "errors"
var (
ErrInvalidInput = errors.New("invalid input")
ErrUnauthorized = errors.New("unauthorized")
ErrNotFound = errors.New("not found")
ErrConflict = errors.New("conflict")
ErrUnavailable = errors.New("dependency unavailable")
ErrInvalidInput = errors.New("invalid input")
ErrUnauthorized = errors.New("unauthorized")
ErrNotFound = errors.New("not found")
ErrConflict = errors.New("conflict")
ErrUnavailable = errors.New("dependency unavailable")
ErrTooLarge = errors.New("payload too large")
ErrUnsupportedMedia = errors.New("unsupported media type")
)