diff options
| author | Bobby <[email protected]> | 2025-12-23 18:36:26 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-12-23 18:36:26 +0530 |
| commit | 17b250cd4722ba281343b35b85fb645ffefedcf8 (patch) | |
| tree | 7345787eaeba82799ac9f50562a377ed953e2c2a /models/email.go | |
| parent | 5f691c04754ffd459b2ba0e434dc17585ba7c66c (diff) | |
| download | lain-17b250cd4722ba281343b35b85fb645ffefedcf8.tar.xz lain-17b250cd4722ba281343b35b85fb645ffefedcf8.zip | |
email model and syncing and showing emails
Diffstat (limited to 'models/email.go')
| -rw-r--r-- | models/email.go | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/models/email.go b/models/email.go new file mode 100644 index 0000000..84474b7 --- /dev/null +++ b/models/email.go @@ -0,0 +1,53 @@ +package models + +import ( + "time" + + "gorm.io/gorm" +) + +type Email struct { + gorm.Model + UserEmail string + FolderID uint + Folder Folder `gorm:"foreignKey:FolderID"` + + UID uint32 `gorm:"index"` + MessageID string `gorm:"index"` + + From string + FromName string + To string + CC string + BCC string + ReplyTo string + + Subject string + Date time.Time `gorm:"index"` + + BodyText string `gorm:"type:text"` + BodyHTML string `gorm:"type:text"` + Snippet string + + IsRead bool `gorm:"default:false;index"` + IsFlagged bool `gorm:"default:false;index"` + IsAnswered bool `gorm:"default:false"` + IsDraft bool `gorm:"default:false"` + HasAttachment bool `gorm:"default:false;index"` + + Size int64 + InReplyTo string + References string +} + +type Attachment struct { + gorm.Model + EmailID uint + Email Email `gorm:"foreignKey:EmailID"` + + Filename string + ContentType string + Size int64 + ContentID string + MinIOPath string `gorm:"index"` +} |
