Messaging/pkg/models/messages.go

19 lines
594 B
Go
Raw Normal View History

2024-03-30 09:10:36 +00:00
package models
import "gorm.io/datatypes"
type Message struct {
BaseModel
2024-05-10 13:50:11 +00:00
Content []byte `json:"content"`
2024-03-30 10:21:17 +00:00
Metadata datatypes.JSONMap `json:"metadata"`
2024-05-10 13:50:11 +00:00
Type string `json:"type"`
2024-03-30 10:21:17 +00:00
Attachments []Attachment `json:"attachments"`
2024-03-30 10:40:21 +00:00
Channel Channel `json:"channel"`
2024-03-30 14:33:20 +00:00
Sender ChannelMember `json:"sender"`
2024-03-31 13:19:51 +00:00
ReplyID *uint `json:"reply_id"`
ReplyTo *Message `json:"reply_to" gorm:"foreignKey:ReplyID"`
2024-03-30 10:21:17 +00:00
ChannelID uint `json:"channel_id"`
SenderID uint `json:"sender_id"`
2024-03-30 09:10:36 +00:00
}