♻️ Refactored message service

This commit is contained in:
2024-05-10 21:50:11 +08:00
parent 7e4ea47c61
commit 13fcc64f79
2 changed files with 35 additions and 15 deletions

View File

@@ -2,19 +2,12 @@ package models
import "gorm.io/datatypes"
type MessageType = uint8
const (
MessageTypeText = MessageType(iota)
MessageTypeAudio
)
type Message struct {
BaseModel
Content string `json:"content"`
Content []byte `json:"content"`
Metadata datatypes.JSONMap `json:"metadata"`
Type MessageType `json:"type"`
Type string `json:"type"`
Attachments []Attachment `json:"attachments"`
Channel Channel `json:"channel"`
Sender ChannelMember `json:"sender"`