forked from mtusi2026/mtusi2026lab4
feat(attachments): add upload, metadata and content endpoints
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type ContentType string
|
||||
|
||||
const (
|
||||
ContentTypePNG ContentType = "image/png"
|
||||
ContentTypeJPEG ContentType = "image/jpeg"
|
||||
)
|
||||
|
||||
type AttachmentStatus string
|
||||
|
||||
const (
|
||||
AttachmentStatusReady AttachmentStatus = "ready"
|
||||
)
|
||||
|
||||
type Attachment struct {
|
||||
ID uuid.UUID
|
||||
ChatID uuid.UUID
|
||||
OwnerID uuid.UUID
|
||||
Filename string
|
||||
ContentType ContentType
|
||||
SizeBytes int
|
||||
Sha256 string
|
||||
Status AttachmentStatus
|
||||
ErrorCode *string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
Reference in New Issue
Block a user