diff --git a/cmd/openim-api/main.go b/cmd/openim-api/main.go index 3690cfc991..04a2b04e9a 100644 --- a/cmd/openim-api/main.go +++ b/cmd/openim-api/main.go @@ -15,9 +15,11 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" - "github.com/openimsdk/tools/system/program" _ "net/http/pprof" + + "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-cmdutils/main.go b/cmd/openim-cmdutils/main.go index 433eefb325..3b497d0290 100644 --- a/cmd/openim-cmdutils/main.go +++ b/cmd/openim-cmdutils/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-crontask/main.go b/cmd/openim-crontask/main.go index 6745065187..b1ed57cd23 100644 --- a/cmd/openim-crontask/main.go +++ b/cmd/openim-crontask/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-msggateway/main.go b/cmd/openim-msggateway/main.go index 6e3eda6bf6..b4444fd7bd 100644 --- a/cmd/openim-msggateway/main.go +++ b/cmd/openim-msggateway/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-msgtransfer/main.go b/cmd/openim-msgtransfer/main.go index 23b629d69a..0ce7205c06 100644 --- a/cmd/openim-msgtransfer/main.go +++ b/cmd/openim-msgtransfer/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-push/main.go b/cmd/openim-push/main.go index cd5106d173..e06fe61186 100644 --- a/cmd/openim-push/main.go +++ b/cmd/openim-push/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-auth/main.go b/cmd/openim-rpc/openim-rpc-auth/main.go index 158b1f4647..853ee27d5b 100644 --- a/cmd/openim-rpc/openim-rpc-auth/main.go +++ b/cmd/openim-rpc/openim-rpc-auth/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-conversation/main.go b/cmd/openim-rpc/openim-rpc-conversation/main.go index 5b2e66c954..63c486498a 100644 --- a/cmd/openim-rpc/openim-rpc-conversation/main.go +++ b/cmd/openim-rpc/openim-rpc-conversation/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-friend/main.go b/cmd/openim-rpc/openim-rpc-friend/main.go index 745c405532..38ec1bc599 100644 --- a/cmd/openim-rpc/openim-rpc-friend/main.go +++ b/cmd/openim-rpc/openim-rpc-friend/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-group/main.go b/cmd/openim-rpc/openim-rpc-group/main.go index 5badf934e9..aa1a576668 100644 --- a/cmd/openim-rpc/openim-rpc-group/main.go +++ b/cmd/openim-rpc/openim-rpc-group/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-msg/main.go b/cmd/openim-rpc/openim-rpc-msg/main.go index 37f6cf237a..3238bad8e9 100644 --- a/cmd/openim-rpc/openim-rpc-msg/main.go +++ b/cmd/openim-rpc/openim-rpc-msg/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-third/main.go b/cmd/openim-rpc/openim-rpc-third/main.go index fcead5f897..187642d8c3 100644 --- a/cmd/openim-rpc/openim-rpc-third/main.go +++ b/cmd/openim-rpc/openim-rpc-third/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/cmd/openim-rpc/openim-rpc-user/main.go b/cmd/openim-rpc/openim-rpc-user/main.go index 75ab902914..208eb71ebd 100644 --- a/cmd/openim-rpc/openim-rpc-user/main.go +++ b/cmd/openim-rpc/openim-rpc-user/main.go @@ -15,8 +15,9 @@ package main import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" ) func main() { diff --git a/internal/api/auth.go b/internal/api/auth.go index f41b530bf1..e508f55ee6 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -16,9 +16,10 @@ package api import ( "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/auth" "github.com/openimsdk/tools/a2r" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type AuthApi rpcclient.Auth diff --git a/internal/api/conversation.go b/internal/api/conversation.go index 8e3a3ca82d..66d3f2dd13 100644 --- a/internal/api/conversation.go +++ b/internal/api/conversation.go @@ -16,9 +16,10 @@ package api import ( "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/tools/a2r" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ConversationApi rpcclient.Conversation diff --git a/internal/api/friend.go b/internal/api/friend.go index d000cccddb..9177748f6a 100644 --- a/internal/api/friend.go +++ b/internal/api/friend.go @@ -16,10 +16,10 @@ package api import ( "github.com/gin-gonic/gin" - - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/relation" "github.com/openimsdk/tools/a2r" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type FriendApi rpcclient.Friend diff --git a/internal/api/group.go b/internal/api/group.go index 9c35da7081..16ac6b03a2 100644 --- a/internal/api/group.go +++ b/internal/api/group.go @@ -16,9 +16,10 @@ package api import ( "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/group" "github.com/openimsdk/tools/a2r" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type GroupApi rpcclient.Group diff --git a/internal/api/init.go b/internal/api/init.go index e83dfc2ea5..6c24d55acd 100644 --- a/internal/api/init.go +++ b/internal/api/init.go @@ -17,9 +17,6 @@ package api import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/tools/utils/datautil" - "github.com/openimsdk/tools/utils/network" "net" "net/http" "os" @@ -28,12 +25,16 @@ import ( "syscall" "time" - kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/system/program" + "github.com/openimsdk/tools/utils/datautil" + "github.com/openimsdk/tools/utils/network" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" ) type Config struct { diff --git a/internal/api/jssdk/jssdk.go b/internal/api/jssdk/jssdk.go index 2fcbf5ec66..70e7e7d83c 100644 --- a/internal/api/jssdk/jssdk.go +++ b/internal/api/jssdk/jssdk.go @@ -2,6 +2,8 @@ package jssdk import ( "context" + "sort" + "github.com/gin-gonic/gin" "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/protocol/group" @@ -12,7 +14,6 @@ import ( "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" - "sort" ) const ( diff --git a/internal/api/jssdk/tools.go b/internal/api/jssdk/tools.go index c19d8970b6..037a8be4a8 100644 --- a/internal/api/jssdk/tools.go +++ b/internal/api/jssdk/tools.go @@ -2,6 +2,9 @@ package jssdk import ( "context" + "io" + "strings" + "github.com/gin-gonic/gin" "github.com/openimsdk/tools/a2r" "github.com/openimsdk/tools/apiresp" @@ -9,8 +12,6 @@ import ( "github.com/openimsdk/tools/errs" "google.golang.org/grpc" "google.golang.org/protobuf/proto" - "io" - "strings" ) func field[A, B, C any](ctx context.Context, fn func(ctx context.Context, req *A, opts ...grpc.CallOption) (*B, error), req *A, get func(*B) C) (C, error) { diff --git a/internal/api/msg.go b/internal/api/msg.go index ce94b5f4fd..6488e0197d 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -18,10 +18,6 @@ import ( "github.com/gin-gonic/gin" "github.com/go-playground/validator/v10" "github.com/mitchellh/mapstructure" - "github.com/openimsdk/open-im-server/v3/pkg/apistruct" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" @@ -34,6 +30,11 @@ import ( "github.com/openimsdk/tools/utils/idutil" "github.com/openimsdk/tools/utils/jsonutil" "github.com/openimsdk/tools/utils/timeutil" + + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type MessageApi struct { diff --git a/internal/api/router.go b/internal/api/router.go index 8e4d17ef1a..0a376e0dea 100644 --- a/internal/api/router.go +++ b/internal/api/router.go @@ -2,28 +2,25 @@ package api import ( "fmt" - - "github.com/openimsdk/open-im-server/v3/internal/api/jssdk" + "net/http" + "strings" "github.com/gin-contrib/gzip" - "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/go-playground/validator/v10" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/apiresp" + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mw" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "net/http" - "strings" - + "github.com/openimsdk/open-im-server/v3/internal/api/jssdk" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/tools/apiresp" - "github.com/openimsdk/tools/discovery" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/mw" ) const ( diff --git a/internal/api/statistics.go b/internal/api/statistics.go index f5ee99f733..515bfccfb2 100644 --- a/internal/api/statistics.go +++ b/internal/api/statistics.go @@ -16,9 +16,10 @@ package api import ( "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/a2r" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type StatisticsApi rpcclient.User diff --git a/internal/api/third.go b/internal/api/third.go index 6baa70ee5d..aeae0cf795 100644 --- a/internal/api/third.go +++ b/internal/api/third.go @@ -16,7 +16,6 @@ package api import ( "context" - "google.golang.org/grpc" "math/rand" "net/http" "net/url" @@ -24,11 +23,13 @@ import ( "strings" "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/third" "github.com/openimsdk/tools/a2r" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/mcontext" + "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ThirdApi rpcclient.Third diff --git a/internal/api/user.go b/internal/api/user.go index b499f71dc2..da1da68ef5 100644 --- a/internal/api/user.go +++ b/internal/api/user.go @@ -16,7 +16,6 @@ package api import ( "github.com/gin-gonic/gin" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msggateway" "github.com/openimsdk/protocol/user" @@ -24,6 +23,8 @@ import ( "github.com/openimsdk/tools/apiresp" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type UserApi rpcclient.User diff --git a/internal/msggateway/callback.go b/internal/msggateway/callback.go index 1750f779bf..79a5f9b1f8 100644 --- a/internal/msggateway/callback.go +++ b/internal/msggateway/callback.go @@ -18,10 +18,11 @@ import ( "context" "time" - cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/mcontext" + + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func (ws *WsServer) webhookAfterUserOnline(ctx context.Context, after *config.AfterConfig, userID string, platformID int, isAppBackground bool, connID string) { diff --git a/internal/msggateway/client.go b/internal/msggateway/client.go index 0da7d72208..7734eee142 100644 --- a/internal/msggateway/client.go +++ b/internal/msggateway/client.go @@ -18,22 +18,22 @@ import ( "context" "encoding/json" "fmt" - "github.com/openimsdk/tools/mw" "runtime/debug" "sync" "sync/atomic" "time" - "google.golang.org/protobuf/proto" - - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/apiresp" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" + "github.com/openimsdk/tools/mw" "github.com/openimsdk/tools/utils/stringutil" + "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) var ( diff --git a/internal/msggateway/compressor_test.go b/internal/msggateway/compressor_test.go index 952bd4d95b..4f3332524a 100644 --- a/internal/msggateway/compressor_test.go +++ b/internal/msggateway/compressor_test.go @@ -16,10 +16,11 @@ package msggateway import ( "crypto/rand" - "github.com/stretchr/testify/assert" "sync" "testing" "unsafe" + + "github.com/stretchr/testify/assert" ) func mockRandom() []byte { diff --git a/internal/msggateway/context.go b/internal/msggateway/context.go index d73a96df4c..9c7c941043 100644 --- a/internal/msggateway/context.go +++ b/internal/msggateway/context.go @@ -15,7 +15,6 @@ package msggateway import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "net/http" "net/url" "strconv" @@ -25,6 +24,8 @@ import ( "github.com/openimsdk/tools/utils/encrypt" "github.com/openimsdk/tools/utils/stringutil" "github.com/openimsdk/tools/utils/timeutil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) type UserConnContext struct { diff --git a/internal/msggateway/hub_server.go b/internal/msggateway/hub_server.go index 23d9150133..35f7b022ee 100644 --- a/internal/msggateway/hub_server.go +++ b/internal/msggateway/hub_server.go @@ -18,10 +18,6 @@ import ( "context" "sync/atomic" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msggateway" "github.com/openimsdk/protocol/sdkws" @@ -32,6 +28,11 @@ import ( "github.com/openimsdk/tools/mq/memamq" "github.com/openimsdk/tools/utils/datautil" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) func (s *Server) InitServer(ctx context.Context, config *Config, disCov discovery.SvcDiscoveryRegistry, server *grpc.Server) error { diff --git a/internal/msggateway/init.go b/internal/msggateway/init.go index 50da060976..a3033481f2 100644 --- a/internal/msggateway/init.go +++ b/internal/msggateway/init.go @@ -16,13 +16,14 @@ package msggateway import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/rpccache" - "github.com/openimsdk/tools/db/redisutil" - "github.com/openimsdk/tools/utils/datautil" "time" + "github.com/openimsdk/tools/db/redisutil" "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/rpccache" ) type Config struct { diff --git a/internal/msggateway/long_conn.go b/internal/msggateway/long_conn.go index c1b3e27c93..ad3c2c9380 100644 --- a/internal/msggateway/long_conn.go +++ b/internal/msggateway/long_conn.go @@ -19,9 +19,8 @@ import ( "net/http" "time" - "github.com/openimsdk/tools/apiresp" - "github.com/gorilla/websocket" + "github.com/openimsdk/tools/apiresp" "github.com/openimsdk/tools/errs" ) diff --git a/internal/msggateway/message_handler.go b/internal/msggateway/message_handler.go index 5407ba90cb..73e3d02a2c 100644 --- a/internal/msggateway/message_handler.go +++ b/internal/msggateway/message_handler.go @@ -20,16 +20,16 @@ import ( "sync" "github.com/go-playground/validator/v10" - "google.golang.org/protobuf/proto" - - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/push" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/utils/jsonutil" + "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) const ( diff --git a/internal/msggateway/online.go b/internal/msggateway/online.go index f29869b6e5..d8ed398278 100644 --- a/internal/msggateway/online.go +++ b/internal/msggateway/online.go @@ -5,16 +5,18 @@ import ( "crypto/md5" "encoding/binary" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - pbuser "github.com/openimsdk/protocol/user" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/mcontext" - "github.com/openimsdk/tools/utils/datautil" "math/rand" "os" "strconv" "sync/atomic" "time" + + pbuser "github.com/openimsdk/protocol/user" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mcontext" + "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" ) func (ws *WsServer) ChangeOnlineStatus(concurrent int) { diff --git a/internal/msggateway/subscription.go b/internal/msggateway/subscription.go index 9bb41e0dfd..6ab38d2b73 100644 --- a/internal/msggateway/subscription.go +++ b/internal/msggateway/subscription.go @@ -2,11 +2,12 @@ package msggateway import ( "context" + "sync" + "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "google.golang.org/protobuf/proto" - "sync" ) func (ws *WsServer) subscriberUserOnlineStatusChanges(ctx context.Context, userID string, platformIDs []int32) { diff --git a/internal/msggateway/user_map.go b/internal/msggateway/user_map.go index 5baa4f9012..6828a7e7c7 100644 --- a/internal/msggateway/user_map.go +++ b/internal/msggateway/user_map.go @@ -1,9 +1,10 @@ package msggateway import ( - "github.com/openimsdk/tools/utils/datautil" "sync" "time" + + "github.com/openimsdk/tools/utils/datautil" ) type UserMap interface { diff --git a/internal/msggateway/ws_server.go b/internal/msggateway/ws_server.go index e6b4f3fa47..bc2271f28b 100644 --- a/internal/msggateway/ws_server.go +++ b/internal/msggateway/ws_server.go @@ -3,26 +3,27 @@ package msggateway import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - "github.com/openimsdk/open-im-server/v3/pkg/rpccache" - pbAuth "github.com/openimsdk/protocol/auth" - "github.com/openimsdk/tools/mcontext" "net/http" "sync" "sync/atomic" "time" "github.com/go-playground/validator/v10" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + pbAuth "github.com/openimsdk/protocol/auth" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msggateway" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/stringutil" "golang.org/x/sync/errgroup" + + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/open-im-server/v3/pkg/rpccache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type LongConnServer interface { diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go index 92053931ce..cc50debda7 100644 --- a/internal/msgtransfer/init.go +++ b/internal/msgtransfer/init.go @@ -23,23 +23,23 @@ import ( "os/signal" "syscall" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/redisutil" - "github.com/openimsdk/tools/utils/datautil" - - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - discRegister "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mw" "github.com/openimsdk/tools/system/program" + "github.com/openimsdk/tools/utils/datautil" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + discRegister "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type MsgTransfer struct { diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go index 4a5d5ba89e..e0e4fd3cda 100644 --- a/internal/msgtransfer/online_history_msg_handler.go +++ b/internal/msgtransfer/online_history_msg_handler.go @@ -18,8 +18,6 @@ import ( "context" "encoding/json" "errors" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/tools/mw" "strconv" "strings" "sync" @@ -27,19 +25,22 @@ import ( "github.com/IBM/sarama" "github.com/go-redis/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/open-im-server/v3/pkg/tools/batcher" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/mq/kafka" + "github.com/openimsdk/tools/mw" "github.com/openimsdk/tools/utils/stringutil" "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/tools/batcher" ) const ( diff --git a/internal/msgtransfer/online_msg_to_mongo_handler.go b/internal/msgtransfer/online_msg_to_mongo_handler.go index 82002c26b9..4d1e7158bc 100644 --- a/internal/msgtransfer/online_msg_to_mongo_handler.go +++ b/internal/msgtransfer/online_msg_to_mongo_handler.go @@ -18,13 +18,14 @@ import ( "context" "github.com/IBM/sarama" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" pbmsg "github.com/openimsdk/protocol/msg" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mq/kafka" "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" ) type OnlineHistoryMongoConsumerHandler struct { diff --git a/internal/push/callback.go b/internal/push/callback.go index f8e17bb8c0..8960634a2a 100644 --- a/internal/push/callback.go +++ b/internal/push/callback.go @@ -17,13 +17,14 @@ package push import ( "context" "encoding/json" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/mcontext" + + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" ) func (c *ConsumerHandler) webhookBeforeOfflinePush(ctx context.Context, before *config.BeforeConfig, userIDs []string, msg *sdkws.MsgData, offlinePushUserIDs *[]string) error { diff --git a/internal/push/offlinepush/dummy/push.go b/internal/push/offlinepush/dummy/push.go index 0bccaf4a40..8e4a58b108 100644 --- a/internal/push/offlinepush/dummy/push.go +++ b/internal/push/offlinepush/dummy/push.go @@ -16,8 +16,10 @@ package dummy import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" + "github.com/openimsdk/tools/log" + + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" ) func NewClient() *Dummy { diff --git a/internal/push/offlinepush/fcm/push.go b/internal/push/offlinepush/fcm/push.go index 6e8355af39..6c7572ee3d 100644 --- a/internal/push/offlinepush/fcm/push.go +++ b/internal/push/offlinepush/fcm/push.go @@ -17,19 +17,20 @@ package fcm import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" - "github.com/openimsdk/tools/utils/httputil" "path/filepath" "strings" firebase "firebase.google.com/go/v4" "firebase.google.com/go/v4/messaging" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/httputil" "github.com/redis/go-redis/v9" "google.golang.org/api/option" + + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" ) const SinglePushCountLimit = 400 diff --git a/internal/push/offlinepush/getui/push.go b/internal/push/offlinepush/getui/push.go index e266f9c464..b0a3e4d4fc 100644 --- a/internal/push/offlinepush/getui/push.go +++ b/internal/push/offlinepush/getui/push.go @@ -22,15 +22,16 @@ import ( "sync" "time" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/httputil" "github.com/openimsdk/tools/utils/splitter" "github.com/redis/go-redis/v9" + + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" ) var ( diff --git a/internal/push/offlinepush/jpush/body/platform.go b/internal/push/offlinepush/jpush/body/platform.go index 5654165fa4..0eb042d3be 100644 --- a/internal/push/offlinepush/jpush/body/platform.go +++ b/internal/push/offlinepush/jpush/body/platform.go @@ -15,9 +15,8 @@ package body import ( - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/errs" ) const ( diff --git a/internal/push/offlinepush/jpush/push.go b/internal/push/offlinepush/jpush/push.go index 2694902f20..b5d7c8a72e 100644 --- a/internal/push/offlinepush/jpush/push.go +++ b/internal/push/offlinepush/jpush/push.go @@ -19,10 +19,11 @@ import ( "encoding/base64" "fmt" + "github.com/openimsdk/tools/utils/httputil" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/jpush/body" "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/tools/utils/httputil" ) type JPush struct { diff --git a/internal/push/offlinepush/offlinepusher.go b/internal/push/offlinepush/offlinepusher.go index 17d5d7071b..7e98c3f934 100644 --- a/internal/push/offlinepush/offlinepusher.go +++ b/internal/push/offlinepush/offlinepusher.go @@ -16,6 +16,8 @@ package offlinepush import ( "context" + "strings" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/dummy" "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/fcm" "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/getui" @@ -23,7 +25,6 @@ import ( "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "strings" ) const ( diff --git a/internal/push/offlinepush_handler.go b/internal/push/offlinepush_handler.go index 5c69da0054..c970278db7 100644 --- a/internal/push/offlinepush_handler.go +++ b/internal/push/offlinepush_handler.go @@ -4,9 +4,6 @@ import ( "context" "github.com/IBM/sarama" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/protocol/constant" pbpush "github.com/openimsdk/protocol/push" "github.com/openimsdk/protocol/sdkws" @@ -15,6 +12,10 @@ import ( "github.com/openimsdk/tools/mq/kafka" "github.com/openimsdk/tools/utils/jsonutil" "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" ) type OfflinePushConsumerHandler struct { diff --git a/internal/push/onlinepusher.go b/internal/push/onlinepusher.go index 9521a84a07..5178adf720 100644 --- a/internal/push/onlinepusher.go +++ b/internal/push/onlinepusher.go @@ -2,6 +2,8 @@ package push import ( "context" + "sync" + "github.com/openimsdk/protocol/msggateway" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/discovery" @@ -9,7 +11,6 @@ import ( "github.com/openimsdk/tools/utils/datautil" "golang.org/x/sync/errgroup" "google.golang.org/grpc" - "sync" ) type OnlinePusher interface { diff --git a/internal/push/push.go b/internal/push/push.go index 850f91d22e..fa2c1bd115 100644 --- a/internal/push/push.go +++ b/internal/push/push.go @@ -3,14 +3,15 @@ package push import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" pbpush "github.com/openimsdk/protocol/push" "github.com/openimsdk/tools/db/redisutil" "github.com/openimsdk/tools/discovery" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" ) type pushServer struct { diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go index b5bbed3ed5..ab23caf8fb 100644 --- a/internal/push/push_handler.go +++ b/internal/push/push_handler.go @@ -3,21 +3,11 @@ package push import ( "context" "encoding/json" - "math/rand" "strconv" "time" "github.com/IBM/sarama" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" - "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/open-im-server/v3/pkg/rpccache" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/open-im-server/v3/pkg/util/conversationutil" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msggateway" pbpush "github.com/openimsdk/protocol/push" @@ -31,6 +21,16 @@ import ( "github.com/openimsdk/tools/utils/timeutil" "github.com/redis/go-redis/v9" "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/rpccache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/util/conversationutil" ) type ConsumerHandler struct { diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index a1acfd9313..0ab29443ee 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -18,25 +18,25 @@ import ( "context" "errors" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - redis2 "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + pbauth "github.com/openimsdk/protocol/auth" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/msggateway" "github.com/openimsdk/tools/db/redisutil" + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/tokenverify" "github.com/openimsdk/tools/utils/datautil" "github.com/redis/go-redis/v9" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + redis2 "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - pbauth "github.com/openimsdk/protocol/auth" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/protocol/msggateway" - "github.com/openimsdk/tools/discovery" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/tokenverify" - "google.golang.org/grpc" ) type authServer struct { diff --git a/internal/rpc/conversation/conversation.go b/internal/rpc/conversation/conversation.go index 0c8a6fd857..fe9fa1f4eb 100644 --- a/internal/rpc/conversation/conversation.go +++ b/internal/rpc/conversation/conversation.go @@ -19,27 +19,27 @@ import ( "sort" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - dbModel "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" - "github.com/openimsdk/tools/db/redisutil" - - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" pbconversation "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/redisutil" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + dbModel "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type conversationServer struct { diff --git a/internal/rpc/conversation/notification.go b/internal/rpc/conversation/notification.go index 994e1d57ae..329588a0d9 100644 --- a/internal/rpc/conversation/notification.go +++ b/internal/rpc/conversation/notification.go @@ -17,10 +17,11 @@ package conversation import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type ConversationNotificationSender struct { diff --git a/internal/rpc/conversation/sync.go b/internal/rpc/conversation/sync.go index ad88b2bbd5..b471a96e65 100644 --- a/internal/rpc/conversation/sync.go +++ b/internal/rpc/conversation/sync.go @@ -3,10 +3,11 @@ package conversation import ( "context" + "github.com/openimsdk/protocol/conversation" + "github.com/openimsdk/open-im-server/v3/internal/rpc/incrversion" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/open-im-server/v3/pkg/util/hashutil" - "github.com/openimsdk/protocol/conversation" ) func (c *conversationServer) GetFullOwnerConversationIDs(ctx context.Context, req *conversation.GetFullOwnerConversationIDsReq) (*conversation.GetFullOwnerConversationIDsResp, error) { diff --git a/internal/rpc/group/cache.go b/internal/rpc/group/cache.go index 022a0f4ef6..dfe2192129 100644 --- a/internal/rpc/group/cache.go +++ b/internal/rpc/group/cache.go @@ -17,8 +17,9 @@ package group import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" pbgroup "github.com/openimsdk/protocol/group" + + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" ) // GetGroupInfoCache get group info from cache. diff --git a/internal/rpc/group/callback.go b/internal/rpc/group/callback.go index 559d64ff47..ae68c755ed 100644 --- a/internal/rpc/group/callback.go +++ b/internal/rpc/group/callback.go @@ -18,17 +18,18 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/apistruct" - "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/group" "github.com/openimsdk/protocol/wrapperspb" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" ) // CallbackBeforeCreateGroup callback before create group. diff --git a/internal/rpc/group/convert.go b/internal/rpc/group/convert.go index 8026430c30..a9e5fde55b 100644 --- a/internal/rpc/group/convert.go +++ b/internal/rpc/group/convert.go @@ -15,8 +15,9 @@ package group import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func (s *groupServer) groupDB2PB(group *model.Group, ownerUserID string, memberCount uint32) *sdkws.GroupInfo { diff --git a/internal/rpc/group/fill.go b/internal/rpc/group/fill.go index 1c86481df8..4c3ad1043d 100644 --- a/internal/rpc/group/fill.go +++ b/internal/rpc/group/fill.go @@ -16,6 +16,7 @@ package group import ( "context" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index b5ab1b2097..0fa740215f 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -23,22 +23,6 @@ import ( "strings" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/common" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/grouphash" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" "github.com/openimsdk/protocol/constant" pbconversation "github.com/openimsdk/protocol/conversation" pbgroup "github.com/openimsdk/protocol/group" @@ -54,6 +38,22 @@ import ( "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/encrypt" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/common" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/grouphash" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) type groupServer struct { diff --git a/internal/rpc/group/notification.go b/internal/rpc/group/notification.go index 54a6146f54..211c74860e 100644 --- a/internal/rpc/group/notification.go +++ b/internal/rpc/group/notification.go @@ -18,16 +18,8 @@ import ( "context" "errors" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" + "time" + "github.com/openimsdk/protocol/constant" pbgroup "github.com/openimsdk/protocol/group" "github.com/openimsdk/protocol/msg" @@ -38,7 +30,17 @@ import ( "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/stringutil" "go.mongodb.org/mongo-driver/mongo" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) // GroupApplicationReceiver diff --git a/internal/rpc/group/sync.go b/internal/rpc/group/sync.go index 0592aa811c..dcf59706dd 100644 --- a/internal/rpc/group/sync.go +++ b/internal/rpc/group/sync.go @@ -3,16 +3,17 @@ package group import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/rpc/incrversion" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/util/hashutil" "github.com/openimsdk/protocol/constant" pbgroup "github.com/openimsdk/protocol/group" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + + "github.com/openimsdk/open-im-server/v3/internal/rpc/incrversion" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/util/hashutil" ) func (s *groupServer) GetFullGroupMemberUserIDs(ctx context.Context, req *pbgroup.GetFullGroupMemberUserIDsReq) (*pbgroup.GetFullGroupMemberUserIDsResp, error) { diff --git a/internal/rpc/incrversion/batch_option.go b/internal/rpc/incrversion/batch_option.go index 34d1b25066..af8f33badb 100644 --- a/internal/rpc/incrversion/batch_option.go +++ b/internal/rpc/incrversion/batch_option.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson/primitive" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type BatchOption[A, B any] struct { diff --git a/internal/rpc/incrversion/option.go b/internal/rpc/incrversion/option.go index af1200d5c0..94171379bf 100644 --- a/internal/rpc/incrversion/option.go +++ b/internal/rpc/incrversion/option.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson/primitive" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) //func Limit(maxSync int, version uint64) int { diff --git a/internal/rpc/msg/as_read.go b/internal/rpc/msg/as_read.go index c9610969dd..608647f9c1 100644 --- a/internal/rpc/msg/as_read.go +++ b/internal/rpc/msg/as_read.go @@ -18,7 +18,6 @@ import ( "context" "errors" - cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" @@ -26,6 +25,8 @@ import ( "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "github.com/redis/go-redis/v9" + + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" ) func (m *msgServer) GetConversationsHasReadAndMaxSeq(ctx context.Context, req *msg.GetConversationsHasReadAndMaxSeqReq) (*msg.GetConversationsHasReadAndMaxSeqResp, error) { diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index c66dd6ca91..2759cc6d97 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -16,16 +16,17 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/protocol/constant" pbchat "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" "google.golang.org/protobuf/proto" + + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" ) func toCommonCallback(ctx context.Context, msg *pbchat.SendMsgReq, command string) cbapi.CommonCallbackReq { diff --git a/internal/rpc/msg/clear.go b/internal/rpc/msg/clear.go index c5bd36b445..14bdd21a66 100644 --- a/internal/rpc/msg/clear.go +++ b/internal/rpc/msg/clear.go @@ -4,8 +4,6 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" pbconversation "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/wrapperspb" @@ -15,6 +13,9 @@ import ( "github.com/openimsdk/tools/utils/idutil" "github.com/openimsdk/tools/utils/stringutil" "golang.org/x/sync/errgroup" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" ) // hard delete in Database. diff --git a/internal/rpc/msg/delete.go b/internal/rpc/msg/delete.go index e19bba867e..7a8d99825e 100644 --- a/internal/rpc/msg/delete.go +++ b/internal/rpc/msg/delete.go @@ -17,13 +17,14 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/timeutil" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" ) func (m *msgServer) getMinSeqs(maxSeqs map[string]int64) map[string]int64 { diff --git a/internal/rpc/msg/filter.go b/internal/rpc/msg/filter.go index ed1a488f12..b3ead97c98 100644 --- a/internal/rpc/msg/filter.go +++ b/internal/rpc/msg/filter.go @@ -1,11 +1,13 @@ package msg import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - pbchat "github.com/openimsdk/protocol/msg" - "github.com/openimsdk/tools/utils/datautil" "strconv" "strings" + + pbchat "github.com/openimsdk/protocol/msg" + "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) const ( diff --git a/internal/rpc/msg/notification.go b/internal/rpc/msg/notification.go index 26e3c7f46a..4200b81af3 100644 --- a/internal/rpc/msg/notification.go +++ b/internal/rpc/msg/notification.go @@ -17,9 +17,10 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type MsgNotificationSender struct { diff --git a/internal/rpc/msg/revoke.go b/internal/rpc/msg/revoke.go index b7cc7df62e..f5281373d2 100644 --- a/internal/rpc/msg/revoke.go +++ b/internal/rpc/msg/revoke.go @@ -17,11 +17,8 @@ package msg import ( "context" "encoding/json" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" @@ -29,6 +26,10 @@ import ( "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func (m *msgServer) RevokeMsg(ctx context.Context, req *msg.RevokeMsgReq) (*msg.RevokeMsgResp, error) { diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go index 2cbbcd1fc2..95cb11f12a 100644 --- a/internal/rpc/msg/send.go +++ b/internal/rpc/msg/send.go @@ -16,11 +16,7 @@ package msg import ( "context" - "github.com/openimsdk/tools/mw" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/open-im-server/v3/pkg/util/conversationutil" "github.com/openimsdk/protocol/constant" pbconversation "github.com/openimsdk/protocol/conversation" pbmsg "github.com/openimsdk/protocol/msg" @@ -29,7 +25,12 @@ import ( "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" + "github.com/openimsdk/tools/mw" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/util/conversationutil" ) func (m *msgServer) SendMsg(ctx context.Context, req *pbmsg.SendMsgReq) (*pbmsg.SendMsgResp, error) { diff --git a/internal/rpc/msg/seq.go b/internal/rpc/msg/seq.go index 7f5fa1adb4..5b9d92974e 100644 --- a/internal/rpc/msg/seq.go +++ b/internal/rpc/msg/seq.go @@ -17,9 +17,10 @@ package msg import ( "context" "errors" + "sort" + pbmsg "github.com/openimsdk/protocol/msg" "github.com/redis/go-redis/v9" - "sort" ) func (m *msgServer) GetConversationMaxSeq(ctx context.Context, req *pbmsg.GetConversationMaxSeqReq) (*pbmsg.GetConversationMaxSeqResp, error) { diff --git a/internal/rpc/msg/server.go b/internal/rpc/msg/server.go index bf8781747b..60bc21c525 100644 --- a/internal/rpc/msg/server.go +++ b/internal/rpc/msg/server.go @@ -17,22 +17,22 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/conversation" + "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/redisutil" + "github.com/openimsdk/tools/discovery" + "google.golang.org/grpc" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" "github.com/openimsdk/open-im-server/v3/pkg/rpccache" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/protocol/conversation" - "github.com/openimsdk/protocol/msg" - "github.com/openimsdk/tools/discovery" - "google.golang.org/grpc" ) type MessageInterceptorFunc func(ctx context.Context, globalConfig *Config, req *msg.SendMsgReq) (*sdkws.MsgData, error) diff --git a/internal/rpc/msg/statistics.go b/internal/rpc/msg/statistics.go index 01c0f1c46c..b280cd431f 100644 --- a/internal/rpc/msg/statistics.go +++ b/internal/rpc/msg/statistics.go @@ -16,12 +16,13 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func (m *msgServer) GetActiveUser(ctx context.Context, req *msg.GetActiveUserReq) (*msg.GetActiveUserResp, error) { diff --git a/internal/rpc/msg/stream_msg.go b/internal/rpc/msg/stream_msg.go index 5db2aad48e..30ee8e1391 100644 --- a/internal/rpc/msg/stream_msg.go +++ b/internal/rpc/msg/stream_msg.go @@ -3,13 +3,15 @@ package msg import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "time" + "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) const StreamDeadlineTime = time.Second * 60 * 10 diff --git a/internal/rpc/msg/sync_msg.go b/internal/rpc/msg/sync_msg.go index 2f77881673..f07fbaaac7 100644 --- a/internal/rpc/msg/sync_msg.go +++ b/internal/rpc/msg/sync_msg.go @@ -17,15 +17,16 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/open-im-server/v3/pkg/util/conversationutil" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/timeutil" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "github.com/openimsdk/open-im-server/v3/pkg/util/conversationutil" ) func (m *msgServer) PullMessageBySeqs(ctx context.Context, req *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) { diff --git a/internal/rpc/msg/verify.go b/internal/rpc/msg/verify.go index f6c3147ba0..f3d120d63b 100644 --- a/internal/rpc/msg/verify.go +++ b/internal/rpc/msg/verify.go @@ -16,10 +16,6 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/tools/utils/datautil" - "github.com/openimsdk/tools/utils/encrypt" - "github.com/openimsdk/tools/utils/timeutil" "math/rand" "strconv" "time" @@ -28,6 +24,11 @@ import ( "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/datautil" + "github.com/openimsdk/tools/utils/encrypt" + "github.com/openimsdk/tools/utils/timeutil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) var ExcludeContentType = []int{constant.HasReadReceipt} diff --git a/internal/rpc/relation/black.go b/internal/rpc/relation/black.go index d8d457dacc..4524a591ed 100644 --- a/internal/rpc/relation/black.go +++ b/internal/rpc/relation/black.go @@ -18,15 +18,15 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" "github.com/openimsdk/protocol/relation" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func (s *friendServer) GetPaginationBlacks(ctx context.Context, req *relation.GetPaginationBlacksReq) (resp *relation.GetPaginationBlacksResp, err error) { diff --git a/internal/rpc/relation/callback.go b/internal/rpc/relation/callback.go index 09debdea18..a6986056b6 100644 --- a/internal/rpc/relation/callback.go +++ b/internal/rpc/relation/callback.go @@ -17,11 +17,11 @@ package relation import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/protocol/relation" cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/protocol/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" ) func (s *friendServer) webhookAfterDeleteFriend(ctx context.Context, after *config.AfterConfig, req *relation.DeleteFriendReq) { diff --git a/internal/rpc/relation/friend.go b/internal/rpc/relation/friend.go index 2f4843a8ef..8692ce6972 100644 --- a/internal/rpc/relation/friend.go +++ b/internal/rpc/relation/friend.go @@ -17,29 +17,28 @@ package relation import ( "context" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/relation" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/redisutil" + "github.com/openimsdk/tools/discovery" + "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/mq/memamq" + "github.com/openimsdk/tools/utils/datautil" + "google.golang.org/grpc" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" "github.com/openimsdk/open-im-server/v3/pkg/localcache" - "github.com/openimsdk/tools/db/redisutil" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/protocol/relation" - "github.com/openimsdk/protocol/sdkws" - "github.com/openimsdk/tools/db/mongoutil" - "github.com/openimsdk/tools/discovery" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/utils/datautil" - "google.golang.org/grpc" ) type friendServer struct { diff --git a/internal/rpc/relation/notification.go b/internal/rpc/relation/notification.go index 83c5d2ca9d..411e61bcee 100644 --- a/internal/rpc/relation/notification.go +++ b/internal/rpc/relation/notification.go @@ -16,20 +16,20 @@ package relation import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/relation" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/convert" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/protocol/relation" - "github.com/openimsdk/protocol/sdkws" - "github.com/openimsdk/tools/mcontext" ) type FriendNotificationSender struct { diff --git a/internal/rpc/relation/sync.go b/internal/rpc/relation/sync.go index 0ad94fe825..ff696b32e2 100644 --- a/internal/rpc/relation/sync.go +++ b/internal/rpc/relation/sync.go @@ -2,15 +2,16 @@ package relation import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/util/hashutil" + "slices" + + "github.com/openimsdk/protocol/relation" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/log" - "slices" "github.com/openimsdk/open-im-server/v3/internal/rpc/incrversion" "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/protocol/relation" + "github.com/openimsdk/open-im-server/v3/pkg/util/hashutil" ) func (s *friendServer) NotificationUserInfoUpdate(ctx context.Context, req *relation.NotificationUserInfoUpdateReq) (*relation.NotificationUserInfoUpdateResp, error) { diff --git a/internal/rpc/third/log.go b/internal/rpc/third/log.go index 657ea16893..b75bff9097 100644 --- a/internal/rpc/third/log.go +++ b/internal/rpc/third/log.go @@ -19,14 +19,14 @@ import ( "crypto/rand" "time" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/third" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func genLogID() string { diff --git a/internal/rpc/third/s3.go b/internal/rpc/third/s3.go index fb6a1157e1..6ffc386146 100644 --- a/internal/rpc/third/s3.go +++ b/internal/rpc/third/s3.go @@ -23,12 +23,7 @@ import ( "strconv" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "go.mongodb.org/mongo-driver/mongo" - "github.com/google/uuid" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/protocol/third" "github.com/openimsdk/tools/errs" @@ -37,6 +32,11 @@ import ( "github.com/openimsdk/tools/s3" "github.com/openimsdk/tools/s3/cont" "github.com/openimsdk/tools/utils/datautil" + "go.mongodb.org/mongo-driver/mongo" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func (t *thirdServer) PartLimit(ctx context.Context, req *third.PartLimitReq) (*third.PartLimitResp, error) { diff --git a/internal/rpc/third/third.go b/internal/rpc/third/third.go index d37689b313..b04d24fb9c 100644 --- a/internal/rpc/third/third.go +++ b/internal/rpc/third/third.go @@ -17,14 +17,8 @@ package third import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/third" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/redisutil" @@ -35,6 +29,13 @@ import ( "github.com/openimsdk/tools/s3/minio" "github.com/openimsdk/tools/s3/oss" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type thirdServer struct { diff --git a/internal/rpc/third/tool.go b/internal/rpc/third/tool.go index 4e22ffbf97..a5598855e8 100644 --- a/internal/rpc/third/tool.go +++ b/internal/rpc/third/tool.go @@ -20,10 +20,11 @@ import ( "strings" "unicode/utf8" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/protocol/third" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/mcontext" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" ) func toPbMapArray(m map[string][]string) []*third.KeyValues { diff --git a/internal/rpc/user/callback.go b/internal/rpc/user/callback.go index b58053c5ac..f9f8c10175 100644 --- a/internal/rpc/user/callback.go +++ b/internal/rpc/user/callback.go @@ -17,12 +17,12 @@ package user import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + pbuser "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/utils/datautil" cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" "github.com/openimsdk/open-im-server/v3/pkg/common/config" - pbuser "github.com/openimsdk/protocol/user" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" ) func (s *userServer) webhookBeforeUpdateUserInfo(ctx context.Context, before *config.BeforeConfig, req *pbuser.UpdateUserInfoReq) error { diff --git a/internal/rpc/user/notification.go b/internal/rpc/user/notification.go index b992c9d123..b994db84ed 100644 --- a/internal/rpc/user/notification.go +++ b/internal/rpc/user/notification.go @@ -16,13 +16,14 @@ package user import ( "context" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) type UserNotificationSender struct { diff --git a/internal/rpc/user/online.go b/internal/rpc/user/online.go index 0e5365ed93..9316bc9493 100644 --- a/internal/rpc/user/online.go +++ b/internal/rpc/user/online.go @@ -3,10 +3,9 @@ package user import ( "context" - "github.com/openimsdk/tools/utils/datautil" - "github.com/openimsdk/protocol/constant" pbuser "github.com/openimsdk/protocol/user" + "github.com/openimsdk/tools/utils/datautil" ) func (s *userServer) getUserOnlineStatus(ctx context.Context, userID string) (*pbuser.OnlineStatus, error) { diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index b47c516d97..98db1ebc4e 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -22,33 +22,33 @@ import ( "sync" "time" - "github.com/openimsdk/open-im-server/v3/internal/rpc/relation" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/group" friendpb "github.com/openimsdk/protocol/relation" - "github.com/openimsdk/tools/db/redisutil" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" pbuser "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/tools/db/redisutil" registry "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/utils/datautil" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/internal/rpc/relation" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/common/webhook" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) type userServer struct { diff --git a/internal/tools/cron_task.go b/internal/tools/cron_task.go index dbb4e34f61..80a07a99d8 100644 --- a/internal/tools/cron_task.go +++ b/internal/tools/cron_task.go @@ -20,19 +20,18 @@ import ( "os" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" pbconversation "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/protocol/msg" - + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/mw" + "github.com/robfig/cron/v3" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/log" - "github.com/robfig/cron/v3" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" ) type CronTaskConfig struct { diff --git a/pkg/authverify/token.go b/pkg/authverify/token.go index f1b377bad7..5bf1e26990 100644 --- a/pkg/authverify/token.go +++ b/pkg/authverify/token.go @@ -19,9 +19,10 @@ import ( "fmt" "github.com/golang-jwt/jwt/v4" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) func Secret(secret string) jwt.Keyfunc { diff --git a/pkg/callbackstruct/common.go b/pkg/callbackstruct/common.go index 9d6a325a8d..c0c100fc57 100644 --- a/pkg/callbackstruct/common.go +++ b/pkg/callbackstruct/common.go @@ -15,8 +15,9 @@ package callbackstruct import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/tools/errs" + + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) const ( diff --git a/pkg/callbackstruct/group.go b/pkg/callbackstruct/group.go index 1f9b848cf9..92f3a7f66d 100644 --- a/pkg/callbackstruct/group.go +++ b/pkg/callbackstruct/group.go @@ -15,9 +15,10 @@ package callbackstruct import ( - "github.com/openimsdk/open-im-server/v3/pkg/apistruct" common "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/protocol/wrapperspb" + + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" ) type CallbackCommand string diff --git a/pkg/common/cmd/api.go b/pkg/common/cmd/api.go index 4088ecd09d..1216d87488 100644 --- a/pkg/common/cmd/api.go +++ b/pkg/common/cmd/api.go @@ -17,10 +17,11 @@ package cmd import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/api" - "github.com/openimsdk/open-im-server/v3/version" "github.com/openimsdk/tools/system/program" "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/v3/internal/api" + "github.com/openimsdk/open-im-server/v3/version" ) type ApiCmd struct { diff --git a/pkg/common/cmd/auth.go b/pkg/common/cmd/auth.go index b35a95f395..06072b57bf 100644 --- a/pkg/common/cmd/auth.go +++ b/pkg/common/cmd/auth.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/auth" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type AuthRpcCmd struct { diff --git a/pkg/common/cmd/conversation.go b/pkg/common/cmd/conversation.go index bdb4447f48..150ec98888 100644 --- a/pkg/common/cmd/conversation.go +++ b/pkg/common/cmd/conversation.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/conversation" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type ConversationRpcCmd struct { diff --git a/pkg/common/cmd/cron_task.go b/pkg/common/cmd/cron_task.go index d6c5e472e1..4ca1822e50 100644 --- a/pkg/common/cmd/cron_task.go +++ b/pkg/common/cmd/cron_task.go @@ -17,10 +17,11 @@ package cmd import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/tools" - "github.com/openimsdk/open-im-server/v3/version" "github.com/openimsdk/tools/system/program" "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/v3/internal/tools" + "github.com/openimsdk/open-im-server/v3/version" ) type CronTaskCmd struct { diff --git a/pkg/common/cmd/friend.go b/pkg/common/cmd/friend.go index a564facd06..581f65f99a 100644 --- a/pkg/common/cmd/friend.go +++ b/pkg/common/cmd/friend.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/relation" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type FriendRpcCmd struct { diff --git a/pkg/common/cmd/group.go b/pkg/common/cmd/group.go index 9b0fbf8de3..22f3a9e77f 100644 --- a/pkg/common/cmd/group.go +++ b/pkg/common/cmd/group.go @@ -17,12 +17,13 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/group" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type GroupRpcCmd struct { diff --git a/pkg/common/cmd/msg.go b/pkg/common/cmd/msg.go index bfd29398ef..c0e81bce7f 100644 --- a/pkg/common/cmd/msg.go +++ b/pkg/common/cmd/msg.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/msg" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type MsgRpcCmd struct { diff --git a/pkg/common/cmd/msg_gateway.go b/pkg/common/cmd/msg_gateway.go index 6363bfbf9e..32efd1c703 100644 --- a/pkg/common/cmd/msg_gateway.go +++ b/pkg/common/cmd/msg_gateway.go @@ -17,11 +17,11 @@ package cmd import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/msggateway" - "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/v3/internal/msggateway" + "github.com/openimsdk/open-im-server/v3/version" ) type MsgGatewayCmd struct { diff --git a/pkg/common/cmd/msg_transfer.go b/pkg/common/cmd/msg_transfer.go index 3643934135..ee960b60a7 100644 --- a/pkg/common/cmd/msg_transfer.go +++ b/pkg/common/cmd/msg_transfer.go @@ -17,10 +17,11 @@ package cmd import ( "context" - "github.com/openimsdk/open-im-server/v3/internal/msgtransfer" - "github.com/openimsdk/open-im-server/v3/version" "github.com/openimsdk/tools/system/program" "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/v3/internal/msgtransfer" + "github.com/openimsdk/open-im-server/v3/version" ) type MsgTransferCmd struct { diff --git a/pkg/common/cmd/push.go b/pkg/common/cmd/push.go index ca22a697d2..623cc10b85 100644 --- a/pkg/common/cmd/push.go +++ b/pkg/common/cmd/push.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/push" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type PushRpcCmd struct { diff --git a/pkg/common/cmd/root.go b/pkg/common/cmd/root.go index 5edea43773..a7c94ee567 100644 --- a/pkg/common/cmd/root.go +++ b/pkg/common/cmd/root.go @@ -18,11 +18,12 @@ import ( "fmt" "path/filepath" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/version" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/spf13/cobra" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/version" ) type RootCmd struct { diff --git a/pkg/common/cmd/third.go b/pkg/common/cmd/third.go index a301b738fa..d8e30cb64f 100644 --- a/pkg/common/cmd/third.go +++ b/pkg/common/cmd/third.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/third" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type ThirdRpcCmd struct { diff --git a/pkg/common/cmd/user.go b/pkg/common/cmd/user.go index 9a614afcab..336af44596 100644 --- a/pkg/common/cmd/user.go +++ b/pkg/common/cmd/user.go @@ -17,11 +17,12 @@ package cmd import ( "context" + "github.com/openimsdk/tools/system/program" + "github.com/spf13/cobra" + "github.com/openimsdk/open-im-server/v3/internal/rpc/user" "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" "github.com/openimsdk/open-im-server/v3/version" - "github.com/openimsdk/tools/system/program" - "github.com/spf13/cobra" ) type UserRpcCmd struct { diff --git a/pkg/common/config/load_config.go b/pkg/common/config/load_config.go index 9272896b45..66af7d2bf1 100644 --- a/pkg/common/config/load_config.go +++ b/pkg/common/config/load_config.go @@ -1,10 +1,11 @@ package config import ( + "strings" + "github.com/mitchellh/mapstructure" "github.com/openimsdk/tools/errs" "github.com/spf13/viper" - "strings" ) func LoadConfig(path string, envPrefix string, config any) error { diff --git a/pkg/common/config/load_config_test.go b/pkg/common/config/load_config_test.go index a0345fc7a5..9fc8ab8afb 100644 --- a/pkg/common/config/load_config_test.go +++ b/pkg/common/config/load_config_test.go @@ -1,8 +1,9 @@ package config import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestLoadLogConfig(t *testing.T) { diff --git a/pkg/common/config/parse.go b/pkg/common/config/parse.go index 08f82ac7d3..c0f50ddf71 100644 --- a/pkg/common/config/parse.go +++ b/pkg/common/config/parse.go @@ -18,11 +18,12 @@ import ( "os" "path/filepath" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/field" "gopkg.in/yaml.v3" + + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) const ( diff --git a/pkg/common/convert/black.go b/pkg/common/convert/black.go index 6c24051fdb..ec2f86bf3a 100644 --- a/pkg/common/convert/black.go +++ b/pkg/common/convert/black.go @@ -16,10 +16,11 @@ package convert import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/protocol/sdkws" sdk "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func BlackDB2Pb(ctx context.Context, blackDBs []*model.Black, f func(ctx context.Context, userIDs []string) (map[string]*sdkws.UserInfo, error)) (blackPbs []*sdk.BlackInfo, err error) { diff --git a/pkg/common/convert/conversation.go b/pkg/common/convert/conversation.go index 9389b02524..6e2f877ac6 100644 --- a/pkg/common/convert/conversation.go +++ b/pkg/common/convert/conversation.go @@ -15,9 +15,10 @@ package convert import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func ConversationDB2Pb(conversationDB *model.Conversation) *conversation.Conversation { diff --git a/pkg/common/convert/friend.go b/pkg/common/convert/friend.go index 6d346b0f4a..dda5c048fb 100644 --- a/pkg/common/convert/friend.go +++ b/pkg/common/convert/friend.go @@ -17,12 +17,13 @@ package convert import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/protocol/relation" + "github.com/openimsdk/protocol/relation" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/timeutil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func FriendPb2DB(friend *sdkws.FriendInfo) *model.Friend { diff --git a/pkg/common/convert/group.go b/pkg/common/convert/group.go index bc2b2f9985..fa7359af8c 100644 --- a/pkg/common/convert/group.go +++ b/pkg/common/convert/group.go @@ -15,11 +15,12 @@ package convert import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" pbgroup "github.com/openimsdk/protocol/group" sdkws "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func Db2PbGroupInfo(m *model.Group, ownerUserID string, memberCount uint32) *sdkws.GroupInfo { diff --git a/pkg/common/convert/msg.go b/pkg/common/convert/msg.go index 41f6b41f6b..28e3210e92 100644 --- a/pkg/common/convert/msg.go +++ b/pkg/common/convert/msg.go @@ -15,9 +15,10 @@ package convert import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/sdkws" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func MsgPb2DB(msg *sdkws.MsgData) *model.MsgDataModel { diff --git a/pkg/common/convert/user.go b/pkg/common/convert/user.go index d824fa68e0..53a678a398 100644 --- a/pkg/common/convert/user.go +++ b/pkg/common/convert/user.go @@ -15,11 +15,12 @@ package convert import ( - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/utils/datautil" "time" "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/tools/utils/datautil" + + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func UserDB2Pb(user *relationtb.User) *sdkws.UserInfo { diff --git a/pkg/common/convert/user_test.go b/pkg/common/convert/user_test.go index be8137265e..4feba2ce35 100644 --- a/pkg/common/convert/user_test.go +++ b/pkg/common/convert/user_test.go @@ -15,11 +15,12 @@ package convert import ( - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "reflect" "testing" "github.com/openimsdk/protocol/sdkws" + + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func TestUsersDB2Pb(t *testing.T) { diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 559c937c10..9ead58b381 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -15,13 +15,15 @@ package discoveryregister import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes" + "time" + "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/discovery/etcd" "github.com/openimsdk/tools/discovery/zookeeper" "github.com/openimsdk/tools/errs" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes" ) // NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type. diff --git a/pkg/common/prommetrics/api.go b/pkg/common/prommetrics/api.go index 95b5c06b68..700ba2aebd 100644 --- a/pkg/common/prommetrics/api.go +++ b/pkg/common/prommetrics/api.go @@ -1,9 +1,10 @@ package prommetrics import ( + "strconv" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - "strconv" ) var ( diff --git a/pkg/common/prommetrics/prommetrics.go b/pkg/common/prommetrics/prommetrics.go index 02e408d63b..89a375ec04 100644 --- a/pkg/common/prommetrics/prommetrics.go +++ b/pkg/common/prommetrics/prommetrics.go @@ -16,9 +16,10 @@ package prommetrics import ( "fmt" + "net/http" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" - "net/http" ) const commonPath = "/metrics" diff --git a/pkg/common/prommetrics/rpc.go b/pkg/common/prommetrics/rpc.go index 7162fa7e80..be2621bbb7 100644 --- a/pkg/common/prommetrics/rpc.go +++ b/pkg/common/prommetrics/rpc.go @@ -1,11 +1,13 @@ package prommetrics import ( + "strconv" + gp "github.com/grpc-ecosystem/go-grpc-prometheus" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - "strconv" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) const rpcPath = commonPath diff --git a/pkg/common/startrpc/start.go b/pkg/common/startrpc/start.go index fb8782d304..fb64d5d264 100644 --- a/pkg/common/startrpc/start.go +++ b/pkg/common/startrpc/start.go @@ -17,9 +17,6 @@ package startrpc import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/tools/utils/datautil" - "google.golang.org/grpc/status" "net" "net/http" "os" @@ -28,15 +25,19 @@ import ( "syscall" "time" - kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mw" + "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/network" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/status" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" ) // Start rpc server. diff --git a/pkg/common/storage/cache/cachekey/msg.go b/pkg/common/storage/cache/cachekey/msg.go index 8e05b64f1f..90219612e4 100644 --- a/pkg/common/storage/cache/cachekey/msg.go +++ b/pkg/common/storage/cache/cachekey/msg.go @@ -15,8 +15,9 @@ package cachekey import ( - "github.com/openimsdk/protocol/constant" "strconv" + + "github.com/openimsdk/protocol/constant" ) const ( diff --git a/pkg/common/storage/cache/cachekey/token.go b/pkg/common/storage/cache/cachekey/token.go index 83ba2f2111..964d0a2459 100644 --- a/pkg/common/storage/cache/cachekey/token.go +++ b/pkg/common/storage/cache/cachekey/token.go @@ -1,8 +1,9 @@ package cachekey import ( - "github.com/openimsdk/protocol/constant" "strings" + + "github.com/openimsdk/protocol/constant" ) const ( diff --git a/pkg/common/storage/cache/conversation.go b/pkg/common/storage/cache/conversation.go index ac3011107c..3db562fb2b 100644 --- a/pkg/common/storage/cache/conversation.go +++ b/pkg/common/storage/cache/conversation.go @@ -16,6 +16,7 @@ package cache import ( "context" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) diff --git a/pkg/common/storage/cache/friend.go b/pkg/common/storage/cache/friend.go index b451d36757..9ceb345ace 100644 --- a/pkg/common/storage/cache/friend.go +++ b/pkg/common/storage/cache/friend.go @@ -16,6 +16,7 @@ package cache import ( "context" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) diff --git a/pkg/common/storage/cache/redis/batch.go b/pkg/common/storage/cache/redis/batch.go index 1810ac9939..6c52d9f573 100644 --- a/pkg/common/storage/cache/redis/batch.go +++ b/pkg/common/storage/cache/redis/batch.go @@ -3,13 +3,14 @@ package redis import ( "context" "encoding/json" + "time" + "unsafe" + "github.com/dtm-labs/rockscache" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/redis/go-redis/v9" "golang.org/x/sync/singleflight" - "time" - "unsafe" ) func getRocksCacheRedisClient(cli *rockscache.Client) redis.UniversalClient { diff --git a/pkg/common/storage/cache/redis/batch_handler.go b/pkg/common/storage/cache/redis/batch_handler.go index 420ebdf777..83b35c3fb4 100644 --- a/pkg/common/storage/cache/redis/batch_handler.go +++ b/pkg/common/storage/cache/redis/batch_handler.go @@ -18,14 +18,16 @@ import ( "context" "encoding/json" "fmt" + "time" + "github.com/dtm-labs/rockscache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "github.com/redis/go-redis/v9" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" ) const ( diff --git a/pkg/common/storage/cache/redis/batch_test.go b/pkg/common/storage/cache/redis/batch_test.go index bbb6d76f15..7ebf051e60 100644 --- a/pkg/common/storage/cache/redis/batch_test.go +++ b/pkg/common/storage/cache/redis/batch_test.go @@ -2,11 +2,13 @@ package redis import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "testing" + "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/redisutil" - "testing" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" ) func TestName(t *testing.T) { diff --git a/pkg/common/storage/cache/redis/black.go b/pkg/common/storage/cache/redis/black.go index fac6dbe6fb..ad9f9f51d5 100644 --- a/pkg/common/storage/cache/redis/black.go +++ b/pkg/common/storage/cache/redis/black.go @@ -16,14 +16,16 @@ package redis import ( "context" + "time" + "github.com/dtm-labs/rockscache" + "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/tools/log" - "github.com/redis/go-redis/v9" - "time" ) const ( diff --git a/pkg/common/storage/cache/redis/conversation.go b/pkg/common/storage/cache/redis/conversation.go index 91d8ed69de..66b6fc6ccd 100644 --- a/pkg/common/storage/cache/redis/conversation.go +++ b/pkg/common/storage/cache/redis/conversation.go @@ -16,19 +16,21 @@ package redis import ( "context" + "math/big" + "strings" + "time" + "github.com/dtm-labs/rockscache" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/utils/datautil" + "github.com/openimsdk/tools/utils/encrypt" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/utils/datautil" - "github.com/openimsdk/tools/utils/encrypt" - "github.com/redis/go-redis/v9" - "math/big" - "strings" - "time" ) const ( diff --git a/pkg/common/storage/cache/redis/friend.go b/pkg/common/storage/cache/redis/friend.go index be4687794f..fccf7d3d60 100644 --- a/pkg/common/storage/cache/redis/friend.go +++ b/pkg/common/storage/cache/redis/friend.go @@ -19,14 +19,15 @@ import ( "time" "github.com/dtm-labs/rockscache" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/utils/datautil" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/utils/datautil" - "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/storage/cache/redis/group.go b/pkg/common/storage/cache/redis/group.go index 736111df31..59365859db 100644 --- a/pkg/common/storage/cache/redis/group.go +++ b/pkg/common/storage/cache/redis/group.go @@ -20,16 +20,17 @@ import ( "time" "github.com/dtm-labs/rockscache" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/common" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/log" - "github.com/redis/go-redis/v9" ) const ( diff --git a/pkg/common/storage/cache/redis/lua_script.go b/pkg/common/storage/cache/redis/lua_script.go index c7609cb443..beef2b1bd6 100644 --- a/pkg/common/storage/cache/redis/lua_script.go +++ b/pkg/common/storage/cache/redis/lua_script.go @@ -3,10 +3,12 @@ package redis import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/redis/go-redis/v9" + + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) var ( diff --git a/pkg/common/storage/cache/redis/lua_script_test.go b/pkg/common/storage/cache/redis/lua_script_test.go index 1566b59a0b..5d3ea9cb15 100644 --- a/pkg/common/storage/cache/redis/lua_script_test.go +++ b/pkg/common/storage/cache/redis/lua_script_test.go @@ -2,10 +2,11 @@ package redis import ( "context" + "testing" + "github.com/go-redis/redismock/v9" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "testing" ) func TestLuaSetBatchWithCommonExpire(t *testing.T) { diff --git a/pkg/common/storage/cache/redis/msg.go b/pkg/common/storage/cache/redis/msg.go index b04bc5c357..8522962984 100644 --- a/pkg/common/storage/cache/redis/msg.go +++ b/pkg/common/storage/cache/redis/msg.go @@ -2,15 +2,19 @@ package redis import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" + "time" + "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/utils/datautil" "github.com/redis/go-redis/v9" - "time" -) // + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" +) + +// // msgCacheTimeout is expiration time of message cache, 86400 seconds const msgCacheTimeout = 86400 diff --git a/pkg/common/storage/cache/redis/msg_test.go b/pkg/common/storage/cache/redis/msg_test.go index 10b9ce18b0..40355eaaf9 100644 --- a/pkg/common/storage/cache/redis/msg_test.go +++ b/pkg/common/storage/cache/redis/msg_test.go @@ -16,11 +16,12 @@ package redis import ( "context" "fmt" + "testing" + "github.com/openimsdk/protocol/sdkws" "github.com/redis/go-redis/v9" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/proto" - "testing" ) func Test_msgCache_SetMessagesToCache(t *testing.T) { diff --git a/pkg/common/storage/cache/redis/online.go b/pkg/common/storage/cache/redis/online.go index b6c90264e1..b7d6bec132 100644 --- a/pkg/common/storage/cache/redis/online.go +++ b/pkg/common/storage/cache/redis/online.go @@ -3,15 +3,17 @@ package redis import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "strconv" + "strings" + "time" + "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/redis/go-redis/v9" - "strconv" - "strings" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" ) func NewUserOnline(rdb redis.UniversalClient) cache.OnlineCache { diff --git a/pkg/common/storage/cache/redis/online_test.go b/pkg/common/storage/cache/redis/online_test.go index 0306f6f5d7..a597bd5815 100644 --- a/pkg/common/storage/cache/redis/online_test.go +++ b/pkg/common/storage/cache/redis/online_test.go @@ -2,10 +2,12 @@ package redis import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/tools/db/redisutil" "testing" "time" + + "github.com/openimsdk/tools/db/redisutil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) /* diff --git a/pkg/common/storage/cache/redis/redis_shard_manager.go b/pkg/common/storage/cache/redis/redis_shard_manager.go index 17e5fecf6f..f48b6ddf2c 100644 --- a/pkg/common/storage/cache/redis/redis_shard_manager.go +++ b/pkg/common/storage/cache/redis/redis_shard_manager.go @@ -2,6 +2,7 @@ package redis import ( "context" + "github.com/dtm-labs/rockscache" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" diff --git a/pkg/common/storage/cache/redis/s3.go b/pkg/common/storage/cache/redis/s3.go index 954557aca7..3e6de02f25 100644 --- a/pkg/common/storage/cache/redis/s3.go +++ b/pkg/common/storage/cache/redis/s3.go @@ -16,16 +16,18 @@ package redis import ( "context" + "time" + "github.com/dtm-labs/rockscache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/s3" "github.com/openimsdk/tools/s3/cont" "github.com/openimsdk/tools/s3/minio" "github.com/redis/go-redis/v9" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewObjectCacheRedis(rdb redis.UniversalClient, objDB database.ObjectInfo) cache.ObjectCache { diff --git a/pkg/common/storage/cache/redis/seq_conversation.go b/pkg/common/storage/cache/redis/seq_conversation.go index 71705cef7e..d89601f991 100644 --- a/pkg/common/storage/cache/redis/seq_conversation.go +++ b/pkg/common/storage/cache/redis/seq_conversation.go @@ -4,16 +4,18 @@ import ( "context" "errors" "fmt" + "strconv" + "time" + "github.com/dtm-labs/rockscache" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/log" - "github.com/redis/go-redis/v9" - "strconv" - "time" ) func NewSeqConversationCacheRedis(rdb redis.UniversalClient, mgo database.SeqConversation) cache.SeqConversationCache { diff --git a/pkg/common/storage/cache/redis/seq_conversation_test.go b/pkg/common/storage/cache/redis/seq_conversation_test.go index d8bfdfbfbf..8acbd110af 100644 --- a/pkg/common/storage/cache/redis/seq_conversation_test.go +++ b/pkg/common/storage/cache/redis/seq_conversation_test.go @@ -2,15 +2,17 @@ package redis import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/redis/go-redis/v9" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" "strconv" "sync" "sync/atomic" "testing" "time" + + "github.com/redis/go-redis/v9" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" ) func newTestSeq() *seqConversationCacheRedis { diff --git a/pkg/common/storage/cache/redis/seq_user.go b/pkg/common/storage/cache/redis/seq_user.go index 0cedfeee12..95c7c27004 100644 --- a/pkg/common/storage/cache/redis/seq_user.go +++ b/pkg/common/storage/cache/redis/seq_user.go @@ -2,14 +2,16 @@ package redis import ( "context" + "strconv" + "time" + "github.com/dtm-labs/rockscache" + "github.com/openimsdk/tools/errs" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/tools/errs" - "github.com/redis/go-redis/v9" - "strconv" - "time" ) func NewSeqUserCacheRedis(rdb redis.UniversalClient, mgo database.SeqUser) cache.SeqUser { diff --git a/pkg/common/storage/cache/redis/seq_user_test.go b/pkg/common/storage/cache/redis/seq_user_test.go index 0059c81db9..610b41b257 100644 --- a/pkg/common/storage/cache/redis/seq_user_test.go +++ b/pkg/common/storage/cache/redis/seq_user_test.go @@ -3,16 +3,18 @@ package redis import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - mgo2 "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/redis/go-redis/v9" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" "log" "strconv" "sync/atomic" "testing" "time" + + "github.com/redis/go-redis/v9" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + mgo2 "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" ) func newTestOnline() *userOnline { diff --git a/pkg/common/storage/cache/redis/third.go b/pkg/common/storage/cache/redis/third.go index 3288cecb8f..b4b67cb3ea 100644 --- a/pkg/common/storage/cache/redis/third.go +++ b/pkg/common/storage/cache/redis/third.go @@ -16,11 +16,13 @@ package redis import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "time" + "github.com/openimsdk/tools/errs" "github.com/redis/go-redis/v9" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" ) func NewThirdCache(rdb redis.UniversalClient) cache.ThirdCache { diff --git a/pkg/common/storage/cache/redis/token.go b/pkg/common/storage/cache/redis/token.go index 998b4f1c95..deebb30549 100644 --- a/pkg/common/storage/cache/redis/token.go +++ b/pkg/common/storage/cache/redis/token.go @@ -2,13 +2,15 @@ package redis import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - "github.com/openimsdk/tools/errs" - "github.com/redis/go-redis/v9" "strconv" "sync" "time" + + "github.com/openimsdk/tools/errs" + "github.com/redis/go-redis/v9" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" ) type tokenCache struct { diff --git a/pkg/common/storage/cache/redis/user.go b/pkg/common/storage/cache/redis/user.go index f6b4907302..c9fd5feaa5 100644 --- a/pkg/common/storage/cache/redis/user.go +++ b/pkg/common/storage/cache/redis/user.go @@ -16,15 +16,17 @@ package redis import ( "context" + "time" + "github.com/dtm-labs/rockscache" + "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/log" - "github.com/redis/go-redis/v9" - "time" ) const ( diff --git a/pkg/common/storage/cache/s3.go b/pkg/common/storage/cache/s3.go index 4d899586cc..907406f481 100644 --- a/pkg/common/storage/cache/s3.go +++ b/pkg/common/storage/cache/s3.go @@ -16,8 +16,10 @@ package cache import ( "context" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/s3" + + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type ObjectCache interface { diff --git a/pkg/common/storage/cache/seq_conversation.go b/pkg/common/storage/cache/seq_conversation.go index f35d7bf528..d923be2936 100644 --- a/pkg/common/storage/cache/seq_conversation.go +++ b/pkg/common/storage/cache/seq_conversation.go @@ -2,6 +2,7 @@ package cache import ( "context" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" ) diff --git a/pkg/common/storage/cache/user.go b/pkg/common/storage/cache/user.go index 69a11635ca..96be6e0d72 100644 --- a/pkg/common/storage/cache/user.go +++ b/pkg/common/storage/cache/user.go @@ -16,6 +16,7 @@ package cache import ( "context" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) diff --git a/pkg/common/storage/controller/auth.go b/pkg/common/storage/controller/auth.go index 0a70296627..70347988f5 100644 --- a/pkg/common/storage/controller/auth.go +++ b/pkg/common/storage/controller/auth.go @@ -2,15 +2,17 @@ package controller import ( "context" + "github.com/golang-jwt/jwt/v4" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/tokenverify" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" ) type AuthDatabase interface { diff --git a/pkg/common/storage/controller/black.go b/pkg/common/storage/controller/black.go index 8a12f2aa2d..ed74a7c461 100644 --- a/pkg/common/storage/controller/black.go +++ b/pkg/common/storage/controller/black.go @@ -16,12 +16,14 @@ package controller import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type BlackDatabase interface { diff --git a/pkg/common/storage/controller/conversation.go b/pkg/common/storage/controller/conversation.go index f0b7d70db6..d77e5cdaaa 100644 --- a/pkg/common/storage/controller/conversation.go +++ b/pkg/common/storage/controller/conversation.go @@ -18,17 +18,17 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/db/tx" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/stringutil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) type ConversationDatabase interface { diff --git a/pkg/common/storage/controller/friend.go b/pkg/common/storage/controller/friend.go index 88a5fc863d..c4bc77d77b 100644 --- a/pkg/common/storage/controller/friend.go +++ b/pkg/common/storage/controller/friend.go @@ -17,12 +17,8 @@ package controller import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/db/tx" @@ -30,6 +26,11 @@ import ( "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type FriendDatabase interface { diff --git a/pkg/common/storage/controller/group.go b/pkg/common/storage/controller/group.go index 072429ed09..70eeb7259c 100644 --- a/pkg/common/storage/controller/group.go +++ b/pkg/common/storage/controller/group.go @@ -18,19 +18,19 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - redis2 "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/common" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/db/tx" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/utils/datautil" "github.com/redis/go-redis/v9" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + redis2 "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/common" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type GroupDatabase interface { diff --git a/pkg/common/storage/controller/msg.go b/pkg/common/storage/controller/msg.go index 59718e7b9d..9ad995f364 100644 --- a/pkg/common/storage/controller/msg.go +++ b/pkg/common/storage/controller/msg.go @@ -21,12 +21,6 @@ import ( "strings" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/protocol/constant" pbmsg "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" @@ -37,6 +31,12 @@ import ( "github.com/openimsdk/tools/utils/timeutil" "github.com/redis/go-redis/v9" "go.mongodb.org/mongo-driver/mongo" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/convert" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) const ( diff --git a/pkg/common/storage/controller/msg_transfer.go b/pkg/common/storage/controller/msg_transfer.go index 1ecd786aa3..7e7906c4c3 100644 --- a/pkg/common/storage/controller/msg_transfer.go +++ b/pkg/common/storage/controller/msg_transfer.go @@ -2,19 +2,20 @@ package controller import ( "context" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/protocol/constant" pbmsg "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mq/kafka" "go.mongodb.org/mongo-driver/mongo" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type MsgTransferDatabase interface { diff --git a/pkg/common/storage/controller/push.go b/pkg/common/storage/controller/push.go index 91ef126fe5..346f70600e 100644 --- a/pkg/common/storage/controller/push.go +++ b/pkg/common/storage/controller/push.go @@ -17,12 +17,13 @@ package controller import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/protocol/push" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mq/kafka" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" ) type PushDatabase interface { diff --git a/pkg/common/storage/controller/s3.go b/pkg/common/storage/controller/s3.go index 9b56661a59..2d1c5b2f1a 100644 --- a/pkg/common/storage/controller/s3.go +++ b/pkg/common/storage/controller/s3.go @@ -19,15 +19,15 @@ import ( "path/filepath" "time" - redisCache "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/s3" "github.com/openimsdk/tools/s3/cont" "github.com/redis/go-redis/v9" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + redisCache "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/redis" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type S3Database interface { diff --git a/pkg/common/storage/controller/stream_msg.go b/pkg/common/storage/controller/stream_msg.go index 3409ccd93c..1155ce5434 100644 --- a/pkg/common/storage/controller/stream_msg.go +++ b/pkg/common/storage/controller/stream_msg.go @@ -2,9 +2,10 @@ package controller import ( "context" + "time" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "time" ) type StreamMsgDatabase interface { diff --git a/pkg/common/storage/controller/third.go b/pkg/common/storage/controller/third.go index a9c2ae403c..f233a64fba 100644 --- a/pkg/common/storage/controller/third.go +++ b/pkg/common/storage/controller/third.go @@ -18,11 +18,11 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" - "github.com/openimsdk/tools/db/pagination" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type ThirdDatabase interface { diff --git a/pkg/common/storage/controller/user.go b/pkg/common/storage/controller/user.go index 3f34481a36..ebbabebd11 100644 --- a/pkg/common/storage/controller/user.go +++ b/pkg/common/storage/controller/user.go @@ -18,16 +18,15 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/db/tx" - "github.com/openimsdk/tools/utils/datautil" - - "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type UserDatabase interface { diff --git a/pkg/common/storage/database/black.go b/pkg/common/storage/database/black.go index b53fdd14dc..bbc0c85c1f 100644 --- a/pkg/common/storage/database/black.go +++ b/pkg/common/storage/database/black.go @@ -16,8 +16,10 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type Black interface { diff --git a/pkg/common/storage/database/conversation.go b/pkg/common/storage/database/conversation.go index 5a9b19035d..baf41b59aa 100644 --- a/pkg/common/storage/database/conversation.go +++ b/pkg/common/storage/database/conversation.go @@ -16,8 +16,10 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type Conversation interface { diff --git a/pkg/common/storage/database/friend.go b/pkg/common/storage/database/friend.go index b596411fce..3c2f6a95d5 100644 --- a/pkg/common/storage/database/friend.go +++ b/pkg/common/storage/database/friend.go @@ -17,8 +17,9 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) // Friend defines the operations for managing friends in MongoDB. diff --git a/pkg/common/storage/database/friend_request.go b/pkg/common/storage/database/friend_request.go index f163b4831f..a3c45ffd10 100644 --- a/pkg/common/storage/database/friend_request.go +++ b/pkg/common/storage/database/friend_request.go @@ -16,8 +16,10 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type FriendRequest interface { diff --git a/pkg/common/storage/database/group.go b/pkg/common/storage/database/group.go index 7ef22f6c9a..88686efc26 100644 --- a/pkg/common/storage/database/group.go +++ b/pkg/common/storage/database/group.go @@ -16,9 +16,11 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/db/pagination" "time" + + "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type Group interface { diff --git a/pkg/common/storage/database/group_member.go b/pkg/common/storage/database/group_member.go index 0ddf0654c0..8bae29359c 100644 --- a/pkg/common/storage/database/group_member.go +++ b/pkg/common/storage/database/group_member.go @@ -17,8 +17,9 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type GroupMember interface { diff --git a/pkg/common/storage/database/group_request.go b/pkg/common/storage/database/group_request.go index 7309584f01..61a4d2a824 100644 --- a/pkg/common/storage/database/group_request.go +++ b/pkg/common/storage/database/group_request.go @@ -16,8 +16,10 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type GroupRequest interface { diff --git a/pkg/common/storage/database/log.go b/pkg/common/storage/database/log.go index 383cc55470..64ce6b6f82 100644 --- a/pkg/common/storage/database/log.go +++ b/pkg/common/storage/database/log.go @@ -16,9 +16,11 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/db/pagination" "time" + + "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type Log interface { diff --git a/pkg/common/storage/database/mgo/black.go b/pkg/common/storage/database/mgo/black.go index 4a7a35e6f1..fe2c744efd 100644 --- a/pkg/common/storage/database/mgo/black.go +++ b/pkg/common/storage/database/mgo/black.go @@ -16,14 +16,15 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewBlackMongo(db *mongo.Database) (database.Black, error) { diff --git a/pkg/common/storage/database/mgo/conversation.go b/pkg/common/storage/database/mgo/conversation.go index f7ced1c2cf..058416e9ad 100644 --- a/pkg/common/storage/database/mgo/conversation.go +++ b/pkg/common/storage/database/mgo/conversation.go @@ -16,8 +16,6 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" "github.com/openimsdk/protocol/constant" @@ -27,6 +25,9 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewConversationMongo(db *mongo.Database) (*ConversationMgo, error) { diff --git a/pkg/common/storage/database/mgo/friend.go b/pkg/common/storage/database/mgo/friend.go index 76c82bac24..cf3e217287 100644 --- a/pkg/common/storage/database/mgo/friend.go +++ b/pkg/common/storage/database/mgo/friend.go @@ -16,16 +16,17 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "go.mongodb.org/mongo-driver/bson/primitive" "time" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) // FriendMgo implements Friend using MongoDB as the storage backend. diff --git a/pkg/common/storage/database/mgo/friend_request.go b/pkg/common/storage/database/mgo/friend_request.go index 4eed2f4a26..1eec305e78 100644 --- a/pkg/common/storage/database/mgo/friend_request.go +++ b/pkg/common/storage/database/mgo/friend_request.go @@ -16,14 +16,15 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewFriendRequestMongo(db *mongo.Database) (database.FriendRequest, error) { diff --git a/pkg/common/storage/database/mgo/group.go b/pkg/common/storage/database/mgo/group.go index 620269b43f..6f1fca58c5 100644 --- a/pkg/common/storage/database/mgo/group.go +++ b/pkg/common/storage/database/mgo/group.go @@ -16,8 +16,6 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" "github.com/openimsdk/protocol/constant" @@ -27,6 +25,9 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewGroupMongo(db *mongo.Database) (database.Group, error) { diff --git a/pkg/common/storage/database/mgo/group_member.go b/pkg/common/storage/database/mgo/group_member.go index 2fdf2003b5..56b4d37e49 100644 --- a/pkg/common/storage/database/mgo/group_member.go +++ b/pkg/common/storage/database/mgo/group_member.go @@ -17,17 +17,17 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewGroupMember(db *mongo.Database) (database.GroupMember, error) { diff --git a/pkg/common/storage/database/mgo/group_request.go b/pkg/common/storage/database/mgo/group_request.go index b1942b7083..ac17a29f91 100644 --- a/pkg/common/storage/database/mgo/group_request.go +++ b/pkg/common/storage/database/mgo/group_request.go @@ -16,8 +16,6 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" @@ -25,6 +23,9 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewGroupRequestMgo(db *mongo.Database) (database.GroupRequest, error) { diff --git a/pkg/common/storage/database/mgo/log.go b/pkg/common/storage/database/mgo/log.go index 6ff4c60395..f2ab416b62 100644 --- a/pkg/common/storage/database/mgo/log.go +++ b/pkg/common/storage/database/mgo/log.go @@ -16,8 +16,6 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" "github.com/openimsdk/tools/db/mongoutil" @@ -25,6 +23,9 @@ import ( "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewLogMongo(db *mongo.Database) (database.Log, error) { diff --git a/pkg/common/storage/database/mgo/msg.go b/pkg/common/storage/database/mgo/msg.go index fc1fe47eab..82252be5f5 100644 --- a/pkg/common/storage/database/mgo/msg.go +++ b/pkg/common/storage/database/mgo/msg.go @@ -5,22 +5,22 @@ import ( "fmt" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/utils/datautil" - "golang.org/x/exp/rand" - "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/utils/datautil" "github.com/openimsdk/tools/utils/jsonutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + "golang.org/x/exp/rand" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewMsgMongo(db *mongo.Database) (database.Msg, error) { diff --git a/pkg/common/storage/database/mgo/msg_test.go b/pkg/common/storage/database/mgo/msg_test.go index 5aed4dc511..9e65622025 100644 --- a/pkg/common/storage/database/mgo/msg_test.go +++ b/pkg/common/storage/database/mgo/msg_test.go @@ -2,17 +2,19 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "math/rand" + "strconv" + "testing" + "time" + "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "math/rand" - "strconv" - "testing" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func TestName1(t *testing.T) { diff --git a/pkg/common/storage/database/mgo/object.go b/pkg/common/storage/database/mgo/object.go index 4242fbb53a..3fe4179067 100644 --- a/pkg/common/storage/database/mgo/object.go +++ b/pkg/common/storage/database/mgo/object.go @@ -18,15 +18,15 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/pagination" "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewS3Mongo(db *mongo.Database) (database.ObjectInfo, error) { diff --git a/pkg/common/storage/database/mgo/seq_conversation.go b/pkg/common/storage/database/mgo/seq_conversation.go index 7971b7e1a7..81f00ac627 100644 --- a/pkg/common/storage/database/mgo/seq_conversation.go +++ b/pkg/common/storage/database/mgo/seq_conversation.go @@ -3,12 +3,14 @@ package mgo import ( "context" "errors" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewSeqConversationMongo(db *mongo.Database) (database.SeqConversation, error) { diff --git a/pkg/common/storage/database/mgo/seq_conversation_test.go b/pkg/common/storage/database/mgo/seq_conversation_test.go index 42507a6937..ae889fbba3 100644 --- a/pkg/common/storage/database/mgo/seq_conversation_test.go +++ b/pkg/common/storage/database/mgo/seq_conversation_test.go @@ -2,10 +2,11 @@ package mgo import ( "context" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" "testing" "time" + + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" ) func Result[V any](val V, err error) V { diff --git a/pkg/common/storage/database/mgo/seq_user.go b/pkg/common/storage/database/mgo/seq_user.go index 244de30000..ebb517cd9b 100644 --- a/pkg/common/storage/database/mgo/seq_user.go +++ b/pkg/common/storage/database/mgo/seq_user.go @@ -3,12 +3,14 @@ package mgo import ( "context" "errors" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/tools/db/mongoutil" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewSeqUserMongo(db *mongo.Database) (database.SeqUser, error) { diff --git a/pkg/common/storage/database/mgo/stream_msg.go b/pkg/common/storage/database/mgo/stream_msg.go index c57798daa5..3ff330cb09 100644 --- a/pkg/common/storage/database/mgo/stream_msg.go +++ b/pkg/common/storage/database/mgo/stream_msg.go @@ -2,14 +2,16 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "time" + "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/errs" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewStreamMsgMongo(db *mongo.Database) (*StreamMsgMongo, error) { diff --git a/pkg/common/storage/database/mgo/user.go b/pkg/common/storage/database/mgo/user.go index ee92b75544..32f9f93a90 100644 --- a/pkg/common/storage/database/mgo/user.go +++ b/pkg/common/storage/database/mgo/user.go @@ -16,8 +16,6 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" "github.com/openimsdk/protocol/user" @@ -28,6 +26,9 @@ import ( "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) func NewUserMongo(db *mongo.Database) (database.User, error) { diff --git a/pkg/common/storage/database/mgo/version_log.go b/pkg/common/storage/database/mgo/version_log.go index 2c4bdef4e8..5f96db8d15 100644 --- a/pkg/common/storage/database/mgo/version_log.go +++ b/pkg/common/storage/database/mgo/version_log.go @@ -5,9 +5,6 @@ import ( "errors" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" @@ -15,6 +12,10 @@ import ( "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/versionctx" ) func NewVersionLog(coll *mongo.Collection) (database.VersionLog, error) { diff --git a/pkg/common/storage/database/mgo/version_test.go b/pkg/common/storage/database/mgo/version_test.go index 4576e45bcd..6ca05d0fcc 100644 --- a/pkg/common/storage/database/mgo/version_test.go +++ b/pkg/common/storage/database/mgo/version_test.go @@ -2,11 +2,13 @@ package mgo import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" "testing" "time" + + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) //func Result[V any](val V, err error) V { diff --git a/pkg/common/storage/database/msg.go b/pkg/common/storage/database/msg.go index 23a99f5b96..abc4a6a80a 100644 --- a/pkg/common/storage/database/msg.go +++ b/pkg/common/storage/database/msg.go @@ -18,9 +18,10 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/protocol/msg" "go.mongodb.org/mongo-driver/mongo" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type Msg interface { diff --git a/pkg/common/storage/database/object.go b/pkg/common/storage/database/object.go index 8292006a04..edcd7238b9 100644 --- a/pkg/common/storage/database/object.go +++ b/pkg/common/storage/database/object.go @@ -18,8 +18,9 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "github.com/openimsdk/tools/db/pagination" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type ObjectInfo interface { diff --git a/pkg/common/storage/database/stream_msg.go b/pkg/common/storage/database/stream_msg.go index e83fffbaae..021cdbd767 100644 --- a/pkg/common/storage/database/stream_msg.go +++ b/pkg/common/storage/database/stream_msg.go @@ -2,8 +2,9 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type StreamMsg interface { diff --git a/pkg/common/storage/database/user.go b/pkg/common/storage/database/user.go index 4ddc8285f6..046d53db39 100644 --- a/pkg/common/storage/database/user.go +++ b/pkg/common/storage/database/user.go @@ -16,10 +16,12 @@ package database import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" + "time" + "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/db/pagination" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type User interface { diff --git a/pkg/common/storage/model/application.go b/pkg/common/storage/model/application.go index b09b0e8948..70ff4e5946 100644 --- a/pkg/common/storage/model/application.go +++ b/pkg/common/storage/model/application.go @@ -1,8 +1,9 @@ package model import ( - "go.mongodb.org/mongo-driver/bson/primitive" "time" + + "go.mongodb.org/mongo-driver/bson/primitive" ) type Application struct { diff --git a/pkg/common/storage/model/friend.go b/pkg/common/storage/model/friend.go index abcca2f2b9..996189f6c0 100644 --- a/pkg/common/storage/model/friend.go +++ b/pkg/common/storage/model/friend.go @@ -15,8 +15,9 @@ package model import ( - "go.mongodb.org/mongo-driver/bson/primitive" "time" + + "go.mongodb.org/mongo-driver/bson/primitive" ) // Friend represents the data structure for a friend relationship in MongoDB. diff --git a/pkg/common/storage/model/msg.go b/pkg/common/storage/model/msg.go index e16233973b..0ae907f5ec 100644 --- a/pkg/common/storage/model/msg.go +++ b/pkg/common/storage/model/msg.go @@ -15,9 +15,10 @@ package model import ( + "strconv" + "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/errs" - "strconv" ) const ( diff --git a/pkg/common/storage/model/version_log.go b/pkg/common/storage/model/version_log.go index 6ed8d30f2e..17e84ac51f 100644 --- a/pkg/common/storage/model/version_log.go +++ b/pkg/common/storage/model/version_log.go @@ -3,9 +3,10 @@ package model import ( "context" "errors" + "time" + "github.com/openimsdk/tools/log" "go.mongodb.org/mongo-driver/bson/primitive" - "time" ) const ( diff --git a/pkg/common/storage/versionctx/rpc.go b/pkg/common/storage/versionctx/rpc.go index 67b95aebd5..43b4ab92bf 100644 --- a/pkg/common/storage/versionctx/rpc.go +++ b/pkg/common/storage/versionctx/rpc.go @@ -2,6 +2,7 @@ package versionctx import ( "context" + "google.golang.org/grpc" ) diff --git a/pkg/common/storage/versionctx/version.go b/pkg/common/storage/versionctx/version.go index 5db8856401..e0c9d85984 100644 --- a/pkg/common/storage/versionctx/version.go +++ b/pkg/common/storage/versionctx/version.go @@ -2,8 +2,9 @@ package versionctx import ( "context" - tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" "sync" + + tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/storage/model" ) type Collection struct { diff --git a/pkg/common/webhook/condition.go b/pkg/common/webhook/condition.go index 2c038f5674..2cb9a4f550 100644 --- a/pkg/common/webhook/condition.go +++ b/pkg/common/webhook/condition.go @@ -2,6 +2,7 @@ package webhook import ( "context" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) diff --git a/pkg/common/webhook/http_client.go b/pkg/common/webhook/http_client.go index e46f08806d..c0c5a8fc0b 100644 --- a/pkg/common/webhook/http_client.go +++ b/pkg/common/webhook/http_client.go @@ -17,15 +17,17 @@ package webhook import ( "context" "encoding/json" - "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" + "net/http" + "github.com/openimsdk/protocol/constant" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/mcontext" "github.com/openimsdk/tools/mq/memamq" "github.com/openimsdk/tools/utils/httputil" - "net/http" + + "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) type Client struct { diff --git a/pkg/localcache/init.go b/pkg/localcache/init.go index d1c16f6751..d0bccaa7e5 100644 --- a/pkg/localcache/init.go +++ b/pkg/localcache/init.go @@ -15,10 +15,11 @@ package localcache import ( - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "strings" "sync" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" ) var ( diff --git a/pkg/rpccache/conversation.go b/pkg/rpccache/conversation.go index 925d2a37ca..018d0db80e 100644 --- a/pkg/rpccache/conversation.go +++ b/pkg/rpccache/conversation.go @@ -16,16 +16,18 @@ package rpccache import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + pbconversation "github.com/openimsdk/protocol/conversation" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" "github.com/redis/go-redis/v9" "golang.org/x/sync/errgroup" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) const ( diff --git a/pkg/rpccache/friend.go b/pkg/rpccache/friend.go index dca3b4c97c..9e6a7f54e2 100644 --- a/pkg/rpccache/friend.go +++ b/pkg/rpccache/friend.go @@ -16,14 +16,15 @@ package rpccache import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "github.com/openimsdk/protocol/relation" + "github.com/openimsdk/tools/log" + "github.com/redis/go-redis/v9" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/localcache" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/tools/log" - "github.com/redis/go-redis/v9" ) func NewFriendLocalCache(client rpcclient.FriendRpcClient, localCache *config.LocalCache, cli redis.UniversalClient) *FriendLocalCache { diff --git a/pkg/rpccache/group.go b/pkg/rpccache/group.go index b2d852fc5f..e1372ecbf8 100644 --- a/pkg/rpccache/group.go +++ b/pkg/rpccache/group.go @@ -16,17 +16,18 @@ package rpccache import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "github.com/openimsdk/protocol/group" + "github.com/openimsdk/protocol/sdkws" + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/log" "github.com/openimsdk/tools/utils/datautil" + "github.com/redis/go-redis/v9" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/localcache" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - "github.com/openimsdk/protocol/sdkws" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/log" - "github.com/redis/go-redis/v9" ) func NewGroupLocalCache(client rpcclient.GroupRpcClient, localCache *config.LocalCache, cli redis.UniversalClient) *GroupLocalCache { diff --git a/pkg/rpccache/online.go b/pkg/rpccache/online.go index a02a0662d4..01b4ad7e6c 100644 --- a/pkg/rpccache/online.go +++ b/pkg/rpccache/online.go @@ -3,23 +3,24 @@ package rpccache import ( "context" "fmt" - "github.com/openimsdk/protocol/constant" - "github.com/openimsdk/protocol/user" "math/rand" "strconv" "sync" "sync/atomic" "time" + "github.com/openimsdk/protocol/constant" + "github.com/openimsdk/protocol/user" + "github.com/openimsdk/tools/db/cacheutil" + "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mcontext" + "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" "github.com/openimsdk/open-im-server/v3/pkg/localcache" "github.com/openimsdk/open-im-server/v3/pkg/localcache/lru" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/open-im-server/v3/pkg/util/useronline" - "github.com/openimsdk/tools/db/cacheutil" - "github.com/openimsdk/tools/log" - "github.com/openimsdk/tools/mcontext" - "github.com/redis/go-redis/v9" ) func NewOnlineCache(user rpcclient.UserRpcClient, group *GroupLocalCache, rdb redis.UniversalClient, fullUserCache bool, fn func(ctx context.Context, userID string, platformIDs []int32)) (*OnlineCache, error) { diff --git a/pkg/rpccache/subscriber.go b/pkg/rpccache/subscriber.go index 3c73ef4496..86979040fa 100644 --- a/pkg/rpccache/subscriber.go +++ b/pkg/rpccache/subscriber.go @@ -17,9 +17,9 @@ package rpccache import ( "context" "encoding/json" - "github.com/openimsdk/tools/mw" "github.com/openimsdk/tools/log" + "github.com/openimsdk/tools/mw" "github.com/redis/go-redis/v9" ) diff --git a/pkg/rpccache/user.go b/pkg/rpccache/user.go index 79a768597f..3fefcfc51b 100644 --- a/pkg/rpccache/user.go +++ b/pkg/rpccache/user.go @@ -17,15 +17,16 @@ package rpccache import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" - "github.com/openimsdk/open-im-server/v3/pkg/localcache" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/errs" "github.com/openimsdk/tools/log" "github.com/redis/go-redis/v9" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/cache/cachekey" + "github.com/openimsdk/open-im-server/v3/pkg/localcache" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) func NewUserLocalCache(client rpcclient.UserRpcClient, localCache *config.LocalCache, cli redis.UniversalClient) *UserLocalCache { diff --git a/pkg/rpcclient/group.go b/pkg/rpcclient/group.go index 30d0b3288f..36478e595d 100644 --- a/pkg/rpcclient/group.go +++ b/pkg/rpcclient/group.go @@ -18,13 +18,14 @@ import ( "context" "strings" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/group" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/system/program" "github.com/openimsdk/tools/utils/datautil" + + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) type Group struct { diff --git a/pkg/rpcclient/msg.go b/pkg/rpcclient/msg.go index 9b26a7abda..e2c1879a91 100644 --- a/pkg/rpcclient/msg.go +++ b/pkg/rpcclient/msg.go @@ -19,10 +19,6 @@ import ( "encoding/json" "time" - "google.golang.org/grpc" - "google.golang.org/protobuf/proto" - - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/protocol/sdkws" @@ -33,6 +29,10 @@ import ( "github.com/openimsdk/tools/utils/idutil" "github.com/openimsdk/tools/utils/jsonutil" "github.com/openimsdk/tools/utils/timeutil" + "google.golang.org/grpc" + "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) func newContentTypeConf(conf *config.Notification) map[int32]config.NotificationConfig { diff --git a/pkg/rpcclient/user.go b/pkg/rpcclient/user.go index bdc1a2e012..de97835bd0 100644 --- a/pkg/rpcclient/user.go +++ b/pkg/rpcclient/user.go @@ -18,14 +18,15 @@ import ( "context" "strings" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" "github.com/openimsdk/protocol/sdkws" "github.com/openimsdk/protocol/user" "github.com/openimsdk/tools/discovery" "github.com/openimsdk/tools/system/program" "github.com/openimsdk/tools/utils/datautil" "google.golang.org/grpc" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/servererrs" ) // User represents a structure holding connection details for the User RPC client. diff --git a/pkg/tools/batcher/batcher.go b/pkg/tools/batcher/batcher.go index 163aeed399..b618abf276 100644 --- a/pkg/tools/batcher/batcher.go +++ b/pkg/tools/batcher/batcher.go @@ -3,11 +3,12 @@ package batcher import ( "context" "fmt" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/tools/utils/idutil" "strings" "sync" "time" + + "github.com/openimsdk/tools/errs" + "github.com/openimsdk/tools/utils/idutil" ) var ( diff --git a/pkg/tools/batcher/batcher_test.go b/pkg/tools/batcher/batcher_test.go index 90e0284490..2ced89e741 100644 --- a/pkg/tools/batcher/batcher_test.go +++ b/pkg/tools/batcher/batcher_test.go @@ -3,9 +3,10 @@ package batcher import ( "context" "fmt" - "github.com/openimsdk/tools/utils/stringutil" "testing" "time" + + "github.com/openimsdk/tools/utils/stringutil" ) func TestBatcher(t *testing.T) { diff --git a/tools/check-component/main.go b/tools/check-component/main.go index 94dbd613c4..cd492793e5 100644 --- a/tools/check-component/main.go +++ b/tools/check-component/main.go @@ -24,8 +24,6 @@ import ( "path/filepath" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/tools/db/mongoutil" "github.com/openimsdk/tools/db/redisutil" "github.com/openimsdk/tools/discovery/etcd" @@ -33,6 +31,9 @@ import ( "github.com/openimsdk/tools/mq/kafka" "github.com/openimsdk/tools/s3/minio" "github.com/openimsdk/tools/system/program" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) const maxRetry = 180 diff --git a/tools/seq/internal/main.go b/tools/seq/internal/main.go index 2bec5a8f1c..9f7dc5f089 100644 --- a/tools/seq/internal/main.go +++ b/tools/seq/internal/main.go @@ -5,16 +5,6 @@ import ( "context" "errors" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" - "github.com/openimsdk/tools/db/mongoutil" - "github.com/openimsdk/tools/db/redisutil" - "github.com/redis/go-redis/v9" - "go.mongodb.org/mongo-driver/bson" - "go.mongodb.org/mongo-driver/mongo" - "go.mongodb.org/mongo-driver/mongo/options" - "gopkg.in/yaml.v3" "os" "os/signal" "path/filepath" @@ -24,6 +14,18 @@ import ( "sync/atomic" "syscall" "time" + + "github.com/openimsdk/tools/db/mongoutil" + "github.com/openimsdk/tools/db/redisutil" + "github.com/redis/go-redis/v9" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "gopkg.in/yaml.v3" + + "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/storage/database/mgo" ) const ( diff --git a/tools/seq/main.go b/tools/seq/main.go index 16da9f156e..11fa6cfa65 100644 --- a/tools/seq/main.go +++ b/tools/seq/main.go @@ -3,8 +3,9 @@ package main import ( "flag" "fmt" - "github.com/openimsdk/open-im-server/v3/tools/seq/internal" "time" + + "github.com/openimsdk/open-im-server/v3/tools/seq/internal" ) func main() { diff --git a/tools/streammsg/main.go b/tools/streammsg/main.go index bb567e2332..8ebffd3654 100644 --- a/tools/streammsg/main.go +++ b/tools/streammsg/main.go @@ -5,19 +5,21 @@ import ( "context" "encoding/json" "fmt" + "io" + "net/http" + "strings" + "time" + "github.com/gin-gonic/gin" "github.com/google/uuid" - "github.com/openimsdk/open-im-server/v3/pkg/apistruct" - cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" "github.com/openimsdk/protocol/auth" "github.com/openimsdk/protocol/constant" "github.com/openimsdk/protocol/msg" "github.com/openimsdk/tools/apiresp" "github.com/openimsdk/tools/errs" - "io" - "net/http" - "strings" - "time" + + "github.com/openimsdk/open-im-server/v3/pkg/apistruct" + cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" ) const ( diff --git a/tools/url2im/pkg/manage.go b/tools/url2im/pkg/manage.go index 9dc1de8010..9ce95cb254 100644 --- a/tools/url2im/pkg/manage.go +++ b/tools/url2im/pkg/manage.go @@ -33,9 +33,8 @@ import ( "sync/atomic" "time" - "github.com/openimsdk/tools/errs" - "github.com/openimsdk/protocol/third" + "github.com/openimsdk/tools/errs" ) type Upload struct {