Files
relay-server/model/model.go
2025-02-08 16:13:53 +01:00

50 lines
1.3 KiB
Go

package model
import (
"github.com/golang-jwt/jwt/v5"
"github.com/google/uuid"
"time"
)
type UserClaims struct {
Username string `json:"username"`
UserID string `json:"user_id"`
jwt.RegisteredClaims
}
type Contact struct {
ID int `json:"contact_id"`
ConversationID uuid.UUID `json:"conversation_id"`
UserID uuid.UUID `json:"user_id"`
Username string `json:"username"`
LastActive *time.Time `json:"last_active"`
Type string `json:"type"`
LastReadMessageID *int `json:"last_read_message_id"`
LastMessageID *int `json:"last_message_id"`
LastMessage *time.Time `json:"last_message"`
LastMessageTime *string `json:"last_message_time"`
LastMessageSender *string `json:"last_message_sender"`
}
type ContactSuggestion struct {
Username string `json:"username"`
}
type Message struct {
MessageID int `json:"message_id"`
Message string `json:"message"`
SentAt time.Time `json:"sent_at"`
Sender string `json:"sender"`
AttachmentUrl *string `json:"attachment_url"`
}
type CreateGroupResponse struct {
GroupID uuid.UUID `json:"group_id"`
}
type Member struct {
UserID uuid.UUID `json:"user_id"`
Username string `json:"username"`
IsAdmin bool `json:"is_admin"`
IsOwner bool `json:"is_owner"`
}