Compare commits

..

5 Commits

Author SHA1 Message Date
alex 3379eac5e7 update path 2024-01-19 19:38:39 +01:00
alex 611b3f641c added room state 2023-03-08 20:10:03 +01:00
alex 494ae5e1a2 added room state 2023-03-08 20:08:26 +01:00
alex ddeea128a4 added room state 2023-03-08 20:04:08 +01:00
alex 1944c40311 changed chats to rooms 2023-03-08 17:30:42 +01:00
5 changed files with 23 additions and 10 deletions

View File

@ -31,6 +31,7 @@ const (
maxFcmToken = "164"
maxAccountStatus = "4" // Indicates the maximum compatible account status. Look for reference in the API
maxDescription = "128"
maxRoomState = "2" // Look for reference in the API
accountNameRegex = "^[a-zA-Z0-9_.]+$"
)
@ -46,6 +47,7 @@ var (
"Token": "required,min=" + minFcmToken + ",max=" + maxFcmToken, // fcm token
"AccountStatus": "number,max=" + maxAccountStatus,
"Description": "max=" + maxDescription,
"RoomState": "number,max=" + maxRoomState,
}
)

View File

@ -4,7 +4,7 @@ import (
"errors"
"strings"
gocnjhelper "git.clickandjoin.umbach.dev/ClickandJoin/go-cnj-helper"
gocnjhelper "git.ex.umbach.dev/ClickandJoin/go-cnj-helper"
"github.com/go-playground/validator/v10"
"github.com/gocql/gocql"
"github.com/gofiber/fiber/v2"

View File

@ -198,16 +198,26 @@ var (
PartKey: []string{"user_id"},
})
DbMChats = table.New(table.Metadata{
Name: "chats",
DbMRooms = table.New(table.Metadata{
Name: "rooms",
Columns: []string{
"user_first_id",
"user_second_id",
"id",
"state",
"sync_count",
"last_messages",
"blocked_state",
"last_changes",
"created_at",
},
PartKey: []string{"user_first_id", "user_second_id"},
PartKey: []string{"id"},
})
DbMRoomUsers = table.New(table.Metadata{
Name: "room_users",
Columns: []string{
"room_id",
"user_id",
"role",
"joined_at",
},
PartKey: []string{"room_id"},
})
)

View File

@ -65,7 +65,8 @@ type UserSignUpProcess struct {
// TABLE rooms
type Room struct {
Id string
Id string
State uint8
// Represents the current number of message activities in a chat. This includes reactions to messages, replying to messages, deleting messages, and more
SyncCount int
// Contains number X of last changes like messages, reactions, replies

2
go.mod
View File

@ -1,4 +1,4 @@
module git.clickandjoin.umbach.dev/ClickandJoin/go-cnj-helper
module git.ex.umbach.dev/ClickandJoin/go-cnj-helper
go 1.19