35 lines
886 B
Go
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"`
|
|
}
|