madipo2611 900e0e8b48
All checks were successful
continuous-integration/drone/push Build is passing
v0.0.18.1 Текущий почти рабочий вариант messages
2025-08-13 23:59:26 +03:00

29 lines
774 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"`
UpdatedAt time.Time `json:"updatedAt"`
LastMessage *Message `json:"lastMessage"`
}
type Message struct {
ID int `json:"id"`
ChatID int `json:"chatId"`
SenderID int `json:"senderId"`
ReceiverID int `json:"receiverId"`
Content string `json:"content"`
Status string `json:"status"` // "sent", "delivered", "read"
CreatedAt time.Time `json:"createdAt"`
}
type ChatSession struct {
User *User `json:"user"`
LastMessage *Message `json:"lastMessage"`
UnreadCount int `json:"unreadCount"`
}