2024-03-30 09:10:36 +00:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "gorm.io/datatypes"
|
|
|
|
|
|
|
|
type MessageType = uint8
|
|
|
|
|
|
|
|
const (
|
|
|
|
MessageTypeText = MessageType(iota)
|
|
|
|
MessageTypeAudio
|
|
|
|
MessageTypeFile
|
|
|
|
)
|
|
|
|
|
|
|
|
type Message struct {
|
|
|
|
BaseModel
|
|
|
|
|
2024-03-30 10:21:17 +00:00
|
|
|
Content string `json:"content"`
|
|
|
|
Metadata datatypes.JSONMap `json:"metadata"`
|
|
|
|
Type MessageType `json:"type"`
|
|
|
|
Attachments []Attachment `json:"attachments"`
|
2024-03-30 10:40:21 +00:00
|
|
|
Channel Channel `json:"channel"`
|
|
|
|
Sender Account `json:"sender"`
|
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
|
|
|
}
|