29 lines
719 B
Go
29 lines
719 B
Go
package domain
|
|
|
|
import "time"
|
|
|
|
type Chat struct {
|
|
ID int `json:"id"`
|
|
User1ID int `json:"user1Id"`
|
|
User2ID int `json:"user2Id"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type Message struct {
|
|
ID int `json:"id"`
|
|
ChatID int `json:"chatId"`
|
|
SenderID int `json:"senderId"`
|
|
Content string `json:"content"`
|
|
Status string `json:"status"` // "sent", "delivered", "read"
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
}
|
|
|
|
type WSMessage struct {
|
|
Type string `json:"type"`
|
|
MessageID int `json:"messageId"`
|
|
ChatID int `json:"chatId"`
|
|
SenderID int `json:"senderId"`
|
|
Content string `json:"content"`
|
|
Recipient int `json:"recipient"`
|
|
}
|