add db function for user connections

This commit is contained in:
2026-04-04 12:55:35 +02:00
parent 91220c37ca
commit fc14987d6d
5 changed files with 100 additions and 20 deletions
+14 -6
View File
@@ -14,9 +14,17 @@ type User struct {
WsConn *websocket.Conn
Id uint32
Groups map[uint32]struct{}
Connections map[uint32]*Connection
Color [3]uint8
}
type Connection struct {
CreatedAt time.Time
With uint32
IsFromUser bool
IsAccepted bool
}
type Group struct {
Name string
CreatedAt time.Time
@@ -29,11 +37,11 @@ type Group struct {
}
type GroupNoMembers struct {
Name string `json:"name"`
CreatedAt time.Time `json:"createdAt"`
Id uint32 `json:"id"`
CreatorId uint32 `json:"creatorId"`
OwnerId uint32 `json:"ownerId"`
Color [3]uint8 `json:"color"`
Name string `json:"name"`
CreatedAt time.Time `json:"createdAt"`
Id uint32 `json:"id"`
CreatorId uint32 `json:"creatorId"`
OwnerId uint32 `json:"ownerId"`
Color [3]uint8 `json:"color"`
EnableUsersColors bool `json:"enableUsersColors"`
}