Files
mtusi2026lab2/src/internal/model/model.go
T
Rakshasa2 84a40ae7ac
Skeleton contracts / contracts (pull_request) Canceled after 0s
lab2 - оценка 4
2026-10-15 12:52:25 +03:00

35 lines
886 B
Go

package model
import "time"
type User struct {
ID string `json:"id"`
Username string `json:"username"`
DisplayName string `json:"display_name"`
CreatedAt time.Time `json:"created_at"`
PasswordHash string `json:"-"` // Никогда не отдаём в JSON
}
type Chat struct {
ID string `json:"id"`
Title string `json:"title"`
MemberIDs []string `json:"member_ids"`
CreatedAt time.Time `json:"created_at"`
}
type Message struct {
ID string `json:"id"`
ChatID string `json:"chat_id"`
SenderID string `json:"sender_id"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
}
type Session struct {
ID string `json:"-"`
UserID string `json:"-"`
TokenHash string `json:"-"`
ExpiresAt time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
}