51 lines
1.4 KiB
Go
51 lines
1.4 KiB
Go
package model
|
|
|
|
import (
|
|
"github.com/golang-jwt/jwt/v5"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
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 *string `json:"last_active"`
|
|
Type string `json:"type"`
|
|
LastReadMessageID *int `json:"last_read_message_id"`
|
|
LastMessageID *int `json:"last_message_id"`
|
|
LastMessage *string `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 {
|
|
ID int `json:"message_id"`
|
|
Message string `json:"message"`
|
|
SentAt string `json:"sent_at"`
|
|
Sender string `json:"sender"`
|
|
SenderID uuid.UUID `json:"sender_id"`
|
|
AttachmentUrl *string `json:"attachment_url"`
|
|
ConversationID uuid.UUID `json:"conversation_id"`
|
|
}
|
|
|
|
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"`
|
|
}
|