Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
|
3379eac5e7 | |
|
611b3f641c | |
|
494ae5e1a2 | |
|
ddeea128a4 | |
|
1944c40311 |
|
@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
24
dbmodels.go
24
dbmodels.go
|
@ -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"},
|
||||
})
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue