diff --git a/main.go b/main.go index 90bdd3a..4e62766 100644 --- a/main.go +++ b/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) diff --git a/modules/scylladb/models.go b/modules/scylladb/models.go deleted file mode 100644 index c3dd2c1..0000000 --- a/modules/scylladb/models.go +++ /dev/null @@ -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"}, - }) -) diff --git a/modules/structs/user.go b/modules/structs/user.go deleted file mode 100644 index 43c2ddc..0000000 --- a/modules/structs/user.go +++ /dev/null @@ -1,11 +0,0 @@ -package structs - -// TABLE ws_sessions -type UserWebSocketSession struct { - Id string - UserId string - UserAgent string - Ip string - LastUsed int64 - CreatedAt int64 -}