changed db structs to gocnjhelper dbstructs
parent
fd8852da8a
commit
54c86a7d9f
6
main.go
6
main.go
|
@ -8,10 +8,10 @@ import (
|
|||
"clickandjoin.app/websocketserver/modules/rabbitmq"
|
||||
"clickandjoin.app/websocketserver/modules/redis"
|
||||
"clickandjoin.app/websocketserver/modules/scylladb"
|
||||
"clickandjoin.app/websocketserver/modules/structs"
|
||||
"clickandjoin.app/websocketserver/modules/utils"
|
||||
"clickandjoin.app/websocketserver/socketserver"
|
||||
gocnjhelper "git.clickandjoin.umbach.dev/ClickandJoin/go-cnj-helper"
|
||||
"git.clickandjoin.umbach.dev/ClickandJoin/go-cnj-helper/dbstructs"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/websocket/v2"
|
||||
|
@ -49,9 +49,9 @@ func main() {
|
|||
|
||||
// validate ws session
|
||||
|
||||
foundWsSession := structs.UserWebSocketSession{Id: wsSessionId}
|
||||
foundWsSession := dbstructs.UserWebSocketSession{Id: wsSessionId}
|
||||
|
||||
q := scylladb.Session.Query(scylladb.WebSocketSessions.Get("id", "user_id")).BindStruct(foundWsSession)
|
||||
q := scylladb.Session.Query(gocnjhelper.DbMWebSocketSessions.Get("id", "user_id")).BindStruct(foundWsSession)
|
||||
|
||||
if err := q.GetRelease(&foundWsSession); err != nil {
|
||||
gocnjhelper.LogDebugf("Failed to find ws session: %s, err: %s", wsSessionId, err)
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
package scylladb
|
||||
|
||||
import (
|
||||
"github.com/scylladb/gocqlx/v2/table"
|
||||
)
|
||||
|
||||
var (
|
||||
WebSocketSessions = table.New(table.Metadata{
|
||||
Name: "ws_sessions",
|
||||
Columns: []string{
|
||||
"id",
|
||||
"user_id",
|
||||
"user_agent",
|
||||
"ip",
|
||||
"last_used",
|
||||
"created_at"},
|
||||
PartKey: []string{"id"},
|
||||
})
|
||||
)
|
|
@ -1,11 +0,0 @@
|
|||
package structs
|
||||
|
||||
// TABLE ws_sessions
|
||||
type UserWebSocketSession struct {
|
||||
Id string
|
||||
UserId string
|
||||
UserAgent string
|
||||
Ip string
|
||||
LastUsed int64
|
||||
CreatedAt int64
|
||||
}
|
Loading…
Reference in New Issue