Messaging/pkg/models/messages.go
2024-05-10 21:50:11 +08:00

19 lines
594 B
Go

package models
import "gorm.io/datatypes"
type Message struct {
BaseModel
Content []byte `json:"content"`
Metadata datatypes.JSONMap `json:"metadata"`
Type string `json:"type"`
Attachments []Attachment `json:"attachments"`
Channel Channel `json:"channel"`
Sender ChannelMember `json:"sender"`
ReplyID *uint `json:"reply_id"`
ReplyTo *Message `json:"reply_to" gorm:"foreignKey:ReplyID"`
ChannelID uint `json:"channel_id"`
SenderID uint `json:"sender_id"`
}