This commit is contained in:
2025-11-02 01:25:30 +01:00
commit ed18be9fbd
17 changed files with 598 additions and 0 deletions

19
models/attachment.go Normal file
View File

@@ -0,0 +1,19 @@
package models
import (
"time"
"github.com/google/uuid"
)
type Attachment struct {
ID uuid.UUID `gorm:"primaryKey" json:"id"`
MessageID uuid.UUID `gorm:"index;not null" json:"message_id"`
Filename string `gorm:"not null" json:"filename"`
FileSize int64 `gorm:"not null" json:"file_size"`
MimeType string `gorm:"not null" json:"mime_type"`
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
// Relation optionnelle vers le message
Message *Message `gorm:"foreignKey:MessageID" json:"message,omitempty"`
}