diff --git a/.golangci.yml b/.golangci.yml index 67419d05e..5bf9eeba9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -118,7 +118,6 @@ linters-settings: right-to-left-isolate: true first-strong-isolate: true pop-directional-isolate: true - dogsled: # checks assignments with too many blank identifiers; default is 2 max-blank-identifiers: 2 dupl: @@ -729,6 +728,21 @@ linters: - gofmt # Format check - govet # Go's standard linting tool - gosimple # Suggestions for simplifying code + - errcheck + - decorder + - sloglint + - ineffassign + - revive + - reassign + - tparallel + - unconvert + - dupl + - dupword + - errname + - gci + - goheader + - goprintffuncname + - gosec - misspell # Spelling mistakes - staticcheck # Static analysis - unused # Checks for unused code diff --git a/cmd/openim-api/main.go b/cmd/openim-api/main.go index eeaa04d07..ad4e3b5c4 100644 --- a/cmd/openim-api/main.go +++ b/cmd/openim-api/main.go @@ -26,12 +26,9 @@ import ( "syscall" "time" - util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" - - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/discoveryregistry" + "github.com/OpenIMSDK/tools/errs" "github.com/openimsdk/open-im-server/v3/internal/api" "github.com/openimsdk/open-im-server/v3/pkg/common/cmd" @@ -40,6 +37,7 @@ import ( kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" ginprom "github.com/openimsdk/open-im-server/v3/pkg/common/ginprometheus" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" ) func main() { diff --git a/internal/api/auth.go b/internal/api/auth.go index 88539f63a..4aeadd790 100644 --- a/internal/api/auth.go +++ b/internal/api/auth.go @@ -15,10 +15,9 @@ package api import ( - "github.com/gin-gonic/gin" - "github.com/OpenIMSDK/protocol/auth" "github.com/OpenIMSDK/tools/a2r" + "github.com/gin-gonic/gin" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/api/conversation.go b/internal/api/conversation.go index eb735e550..c9101fb26 100644 --- a/internal/api/conversation.go +++ b/internal/api/conversation.go @@ -15,10 +15,9 @@ package api import ( - "github.com/gin-gonic/gin" - "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/tools/a2r" + "github.com/gin-gonic/gin" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/api/custom_validator.go b/internal/api/custom_validator.go index 1df4169e4..d135b0dc4 100644 --- a/internal/api/custom_validator.go +++ b/internal/api/custom_validator.go @@ -15,9 +15,8 @@ package api import ( - "github.com/go-playground/validator/v10" - "github.com/OpenIMSDK/protocol/constant" + "github.com/go-playground/validator/v10" ) // RequiredIf validates if the specified field is required based on the session type. diff --git a/internal/api/friend.go b/internal/api/friend.go index 7dc898a02..98e86a037 100644 --- a/internal/api/friend.go +++ b/internal/api/friend.go @@ -17,10 +17,9 @@ package api import ( "github.com/OpenIMSDK/protocol/friend" "github.com/OpenIMSDK/tools/a2r" + "github.com/gin-gonic/gin" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - - "github.com/gin-gonic/gin" ) type FriendApi rpcclient.Friend diff --git a/internal/api/group.go b/internal/api/group.go index e525cd495..af90c2db4 100644 --- a/internal/api/group.go +++ b/internal/api/group.go @@ -17,10 +17,9 @@ package api import ( "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/tools/a2r" + "github.com/gin-gonic/gin" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - - "github.com/gin-gonic/gin" ) type GroupApi rpcclient.Group diff --git a/internal/api/msg.go b/internal/api/msg.go index 1bbcf5428..4b253f56b 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -28,10 +28,9 @@ import ( "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/apistruct" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/api/route.go b/internal/api/route.go index a6d73b683..c6e0f53aa 100644 --- a/internal/api/route.go +++ b/internal/api/route.go @@ -21,13 +21,11 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/apiresp" + "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" + "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/mw" "github.com/OpenIMSDK/tools/tokenverify" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" - "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/go-playground/validator/v10" @@ -35,11 +33,10 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/tools/mw" - + "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/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/api/statistics.go b/internal/api/statistics.go index 5750a7315..397523e88 100644 --- a/internal/api/statistics.go +++ b/internal/api/statistics.go @@ -15,10 +15,9 @@ package api import ( - "github.com/gin-gonic/gin" - "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/a2r" + "github.com/gin-gonic/gin" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/api/third.go b/internal/api/third.go index 0a1ef0fbe..2acf1ce89 100644 --- a/internal/api/third.go +++ b/internal/api/third.go @@ -19,15 +19,13 @@ import ( "net/http" "strconv" - config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" - - "github.com/gin-gonic/gin" - "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/a2r" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mcontext" + "github.com/gin-gonic/gin" + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/msggateway/client.go b/internal/msggateway/client.go index 06efea12f..7017cf7d4 100644 --- a/internal/msggateway/client.go +++ b/internal/msggateway/client.go @@ -22,18 +22,16 @@ import ( "sync" "sync/atomic" - "github.com/OpenIMSDK/tools/errs" - - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - - "google.golang.org/protobuf/proto" - "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/utils" + "google.golang.org/protobuf/proto" + + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) var ( diff --git a/internal/msggateway/hub_server.go b/internal/msggateway/hub_server.go index 807c4af3b..f6228717d 100644 --- a/internal/msggateway/hub_server.go +++ b/internal/msggateway/hub_server.go @@ -17,8 +17,6 @@ package msggateway import ( "context" - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msggateway" "github.com/OpenIMSDK/tools/discoveryregistry" @@ -26,6 +24,7 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/config" diff --git a/internal/msggateway/message_handler.go b/internal/msggateway/message_handler.go index 74bde1ff5..1cf91f67d 100644 --- a/internal/msggateway/message_handler.go +++ b/internal/msggateway/message_handler.go @@ -18,17 +18,15 @@ import ( "context" "sync" + "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/push" + "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" - + "github.com/OpenIMSDK/tools/utils" "github.com/go-playground/validator/v10" "google.golang.org/protobuf/proto" - "github.com/OpenIMSDK/protocol/msg" - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/tools/utils" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/msggateway/n_ws_server.go b/internal/msggateway/n_ws_server.go index f466a7dc4..bf8a0da39 100644 --- a/internal/msggateway/n_ws_server.go +++ b/internal/msggateway/n_ws_server.go @@ -25,18 +25,16 @@ import ( "sync/atomic" "time" - "github.com/OpenIMSDK/tools/apiresp" - - "github.com/go-playground/validator/v10" - "github.com/redis/go-redis/v9" - "golang.org/x/sync/errgroup" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msggateway" + "github.com/OpenIMSDK/tools/apiresp" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" + "github.com/go-playground/validator/v10" + "github.com/redis/go-redis/v9" + "golang.org/x/sync/errgroup" "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/config" diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go index ca9ab5ac4..077282f83 100644 --- a/internal/msgtransfer/init.go +++ b/internal/msgtransfer/init.go @@ -18,16 +18,12 @@ import ( "context" "errors" "fmt" - - "github.com/OpenIMSDK/tools/errs" - - util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" - "net/http" "os" "os/signal" "syscall" + "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mw" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" @@ -42,6 +38,7 @@ import ( kdisc "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/rpcclient" + util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" ) type MsgTransfer struct { @@ -121,7 +118,7 @@ func (m *MsgTransfer) Start(prometheusPort int) error { var ( netDone = make(chan struct{}, 1) - netErr error + netErr error ) go m.historyCH.historyConsumerGroup.RegisterHandleAndConsumer(m.ctx, m.historyCH) diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go index 635fe2eac..e06ab5f07 100644 --- a/internal/msgtransfer/online_history_msg_handler.go +++ b/internal/msgtransfer/online_history_msg_handler.go @@ -22,23 +22,20 @@ import ( "sync/atomic" "time" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - - "github.com/OpenIMSDK/tools/errs" - "github.com/IBM/sarama" - "github.com/go-redis/redis" - "google.golang.org/protobuf/proto" - "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/utils" + "github.com/go-redis/redis" + "google.golang.org/protobuf/proto" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/msgtransfer/online_msg_to_mongo_handler.go b/internal/msgtransfer/online_msg_to_mongo_handler.go index 6e6c4c819..35c0a4a4c 100644 --- a/internal/msgtransfer/online_msg_to_mongo_handler.go +++ b/internal/msgtransfer/online_msg_to_mongo_handler.go @@ -18,10 +18,9 @@ import ( "context" "github.com/IBM/sarama" - "google.golang.org/protobuf/proto" - pbmsg "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/tools/log" + "google.golang.org/protobuf/proto" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" diff --git a/internal/push/offlinepush/fcm/push.go b/internal/push/offlinepush/fcm/push.go index b1f16b4b2..a3453ba5a 100644 --- a/internal/push/offlinepush/fcm/push.go +++ b/internal/push/offlinepush/fcm/push.go @@ -20,11 +20,10 @@ import ( firebase "firebase.google.com/go" "firebase.google.com/go/messaging" + "github.com/OpenIMSDK/protocol/constant" "github.com/redis/go-redis/v9" "google.golang.org/api/option" - "github.com/OpenIMSDK/protocol/constant" - "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/db/cache" diff --git a/internal/push/offlinepush/getui/push.go b/internal/push/offlinepush/getui/push.go index 8115e4efb..81dbfaee3 100644 --- a/internal/push/offlinepush/getui/push.go +++ b/internal/push/offlinepush/getui/push.go @@ -23,12 +23,11 @@ import ( "sync" "time" - "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils/splitter" + "github.com/redis/go-redis/v9" "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" "github.com/openimsdk/open-im-server/v3/pkg/common/config" diff --git a/internal/push/push_handler.go b/internal/push/push_handler.go index 19d42ebb9..18b987267 100644 --- a/internal/push/push_handler.go +++ b/internal/push/push_handler.go @@ -18,13 +18,12 @@ import ( "context" "github.com/IBM/sarama" - "google.golang.org/protobuf/proto" - "github.com/OpenIMSDK/protocol/constant" pbchat "github.com/OpenIMSDK/protocol/msg" pbpush "github.com/OpenIMSDK/protocol/push" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/protobuf/proto" "github.com/openimsdk/open-im-server/v3/pkg/common/config" kfk "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" diff --git a/internal/push/push_rpc_server.go b/internal/push/push_rpc_server.go index f558aeec3..30896849a 100644 --- a/internal/push/push_rpc_server.go +++ b/internal/push/push_rpc_server.go @@ -17,14 +17,12 @@ package push import ( "context" - "github.com/OpenIMSDK/tools/utils" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" pbpush "github.com/OpenIMSDK/protocol/push" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" diff --git a/internal/push/push_to_client.go b/internal/push/push_to_client.go index 1140e8ce4..6e767a6be 100644 --- a/internal/push/push_to_client.go +++ b/internal/push/push_to_client.go @@ -20,10 +20,6 @@ import ( "errors" "sync" - "google.golang.org/grpc" - - "golang.org/x/sync/errgroup" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/protocol/msggateway" @@ -32,6 +28,8 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/dummy" diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index cde1e6ac5..774717cf9 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -17,10 +17,6 @@ package auth import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - - "google.golang.org/grpc" - pbauth "github.com/OpenIMSDK/protocol/auth" "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msggateway" @@ -29,7 +25,9 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/tokenverify" + "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/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 582f93246..f513d1a2c 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -19,26 +19,22 @@ import ( "errors" "sort" - "github.com/OpenIMSDK/protocol/sdkws" - - "github.com/OpenIMSDK/tools/tx" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" pbconversation "github.com/OpenIMSDK/protocol/conversation" + "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/convert" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) diff --git a/internal/rpc/friend/black.go b/internal/rpc/friend/black.go index ed5791c38..979cfdc95 100644 --- a/internal/rpc/friend/black.go +++ b/internal/rpc/friend/black.go @@ -18,11 +18,10 @@ import ( "context" "time" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - pbfriend "github.com/OpenIMSDK/protocol/friend" "github.com/OpenIMSDK/tools/mcontext" + "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/db/table/relation" ) diff --git a/internal/rpc/friend/friend.go b/internal/rpc/friend/friend.go index 9c49af220..f3aea14f5 100644 --- a/internal/rpc/friend/friend.go +++ b/internal/rpc/friend/friend.go @@ -17,30 +17,24 @@ package friend import ( "context" - "github.com/OpenIMSDK/tools/tx" - - "github.com/OpenIMSDK/protocol/sdkws" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - - "github.com/OpenIMSDK/tools/log" - - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" pbfriend "github.com/OpenIMSDK/protocol/friend" + "github.com/OpenIMSDK/protocol/sdkws" registry "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" + "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" + "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/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) diff --git a/internal/rpc/group/callback.go b/internal/rpc/group/callback.go index d891f4d1e..2a0ce6584 100644 --- a/internal/rpc/group/callback.go +++ b/internal/rpc/group/callback.go @@ -18,16 +18,14 @@ import ( "context" "time" - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/group" + pbgroup "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" - pbgroup "github.com/OpenIMSDK/protocol/group" - "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" diff --git a/internal/rpc/group/db_map.go b/internal/rpc/group/db_map.go index 07084873c..e4c18bb17 100644 --- a/internal/rpc/group/db_map.go +++ b/internal/rpc/group/db_map.go @@ -18,10 +18,9 @@ import ( "context" "time" - "github.com/OpenIMSDK/tools/mcontext" - pbgroup "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/protocol/sdkws" + "github.com/OpenIMSDK/tools/mcontext" ) func UpdateGroupInfoMap(ctx context.Context, group *sdkws.GroupInfoForSet) map[string]any { diff --git a/internal/rpc/group/group.go b/internal/rpc/group/group.go index db5108f31..d8a1e1d56 100644 --- a/internal/rpc/group/group.go +++ b/internal/rpc/group/group.go @@ -23,40 +23,32 @@ import ( "strings" "time" - "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - - pbconversation "github.com/OpenIMSDK/protocol/conversation" - "github.com/OpenIMSDK/protocol/wrapperspb" - "github.com/OpenIMSDK/tools/tx" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/grouphash" - - "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/rpcclient/notification" - - "github.com/OpenIMSDK/tools/mw/specialerror" - - "github.com/openimsdk/open-im-server/v3/pkg/common/convert" - "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" + pbconversation "github.com/OpenIMSDK/protocol/conversation" pbgroup "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/protocol/sdkws" + "github.com/OpenIMSDK/protocol/wrapperspb" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" + "github.com/OpenIMSDK/tools/mw/specialerror" + "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" + "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/convert" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + "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" ) func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { diff --git a/internal/rpc/msg/as_read.go b/internal/rpc/msg/as_read.go index cb292421e..f9a44577b 100644 --- a/internal/rpc/msg/as_read.go +++ b/internal/rpc/msg/as_read.go @@ -17,17 +17,15 @@ package msg import ( "context" - utils2 "github.com/OpenIMSDK/tools/utils" - - cbapi "github.com/openimsdk/open-im-server/v3/pkg/callbackstruct" - - "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" + utils2 "github.com/OpenIMSDK/tools/utils" + "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) (resp *msg.GetConversationsHasReadAndMaxSeqResp, err error) { diff --git a/internal/rpc/msg/callback.go b/internal/rpc/msg/callback.go index f98318bba..e281e4828 100644 --- a/internal/rpc/msg/callback.go +++ b/internal/rpc/msg/callback.go @@ -17,17 +17,15 @@ package msg import ( "context" - "github.com/OpenIMSDK/protocol/sdkws" - "google.golang.org/protobuf/proto" - "github.com/OpenIMSDK/protocol/constant" pbchat "github.com/OpenIMSDK/protocol/msg" + "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + "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/http" ) diff --git a/internal/rpc/msg/delete.go b/internal/rpc/msg/delete.go index b5c23bed6..e2d81c92a 100644 --- a/internal/rpc/msg/delete.go +++ b/internal/rpc/msg/delete.go @@ -17,14 +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" + + "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/revoke.go b/internal/rpc/msg/revoke.go index 0a24753b2..2272911bc 100644 --- a/internal/rpc/msg/revoke.go +++ b/internal/rpc/msg/revoke.go @@ -19,8 +19,6 @@ import ( "encoding/json" "time" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/sdkws" @@ -29,6 +27,7 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/config" unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go index 630b74a4a..6f590578c 100644 --- a/internal/rpc/msg/send.go +++ b/internal/rpc/msg/send.go @@ -17,9 +17,6 @@ package msg import ( "context" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/OpenIMSDK/protocol/constant" pbconversation "github.com/OpenIMSDK/protocol/conversation" pbmsg "github.com/OpenIMSDK/protocol/msg" @@ -29,6 +26,9 @@ import ( "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) func (m *msgServer) SendMsg(ctx context.Context, req *pbmsg.SendMsgReq) (resp *pbmsg.SendMsgResp, error error) { diff --git a/internal/rpc/msg/server.go b/internal/rpc/msg/server.go index c25879276..0643abe26 100644 --- a/internal/rpc/msg/server.go +++ b/internal/rpc/msg/server.go @@ -15,12 +15,11 @@ package msg import ( - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/tools/discoveryregistry" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" diff --git a/internal/rpc/msg/sync_msg.go b/internal/rpc/msg/sync_msg.go index dbd8da4d8..3b76db1e4 100644 --- a/internal/rpc/msg/sync_msg.go +++ b/internal/rpc/msg/sync_msg.go @@ -17,15 +17,14 @@ 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/protocol/constant" "github.com/OpenIMSDK/protocol/msg" - "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" + + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) func (m *msgServer) PullMessageBySeqs( diff --git a/internal/rpc/third/s3.go b/internal/rpc/third/s3.go index 3b501d4ad..488deb19e 100644 --- a/internal/rpc/third/s3.go +++ b/internal/rpc/third/s3.go @@ -23,18 +23,15 @@ import ( "strconv" "time" - "github.com/google/uuid" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" - "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + "github.com/google/uuid" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cont" "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) diff --git a/internal/rpc/third/third.go b/internal/rpc/third/third.go index 0d474d2c4..dfa77f9d3 100644 --- a/internal/rpc/third/third.go +++ b/internal/rpc/third/third.go @@ -20,22 +20,19 @@ import ( "net/url" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/oss" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/discoveryregistry" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/cos" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/minio" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3/oss" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" ) diff --git a/internal/rpc/third/tool.go b/internal/rpc/third/tool.go index a6c16ff9d..efa047a43 100644 --- a/internal/rpc/third/tool.go +++ b/internal/rpc/third/tool.go @@ -21,11 +21,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/user.go b/internal/rpc/user/user.go index 6f9e2949f..b4140420b 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -21,35 +21,28 @@ import ( "strings" "time" - "github.com/OpenIMSDK/tools/pagination" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" - - "github.com/OpenIMSDK/tools/tx" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" + pbuser "github.com/OpenIMSDK/protocol/user" + registry "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/pagination" + "github.com/OpenIMSDK/tools/tx" + "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" - - registry "github.com/OpenIMSDK/tools/discoveryregistry" - "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/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" tablerelation "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" - - pbuser "github.com/OpenIMSDK/protocol/user" - "github.com/OpenIMSDK/tools/utils" - "google.golang.org/grpc" ) type userServer struct { diff --git a/internal/tools/conversation.go b/internal/tools/conversation.go index 6b918c0d1..5550bbad2 100644 --- a/internal/tools/conversation.go +++ b/internal/tools/conversation.go @@ -20,7 +20,6 @@ import ( "time" "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" diff --git a/internal/tools/cron_task.go b/internal/tools/cron_task.go index 0544f2f85..8d198ff28 100644 --- a/internal/tools/cron_task.go +++ b/internal/tools/cron_task.go @@ -23,7 +23,6 @@ import ( "time" "github.com/OpenIMSDK/tools/errs" - "github.com/redis/go-redis/v9" "github.com/robfig/cron/v3" diff --git a/internal/tools/msg.go b/internal/tools/msg.go index 7548e3c04..6d5a50b1e 100644 --- a/internal/tools/msg.go +++ b/internal/tools/msg.go @@ -18,30 +18,25 @@ import ( "context" "fmt" "math" - - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/tools/tx" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" - - "github.com/redis/go-redis/v9" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - - kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" - "math/rand" + "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/mw" + "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" + "github.com/redis/go-redis/v9" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/mgo" "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" + kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient/notification" ) diff --git a/pkg/common/cmd/msg_gateway.go b/pkg/common/cmd/msg_gateway.go index 317844770..1543afe15 100644 --- a/pkg/common/cmd/msg_gateway.go +++ b/pkg/common/cmd/msg_gateway.go @@ -17,13 +17,11 @@ package cmd import ( "errors" + "github.com/OpenIMSDK/protocol/constant" + "github.com/OpenIMSDK/tools/errs" "github.com/spf13/cobra" "github.com/openimsdk/open-im-server/v3/internal/msggateway" - - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/errs" - v3config "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) diff --git a/pkg/common/cmd/msg_transfer.go b/pkg/common/cmd/msg_transfer.go index 545c7543b..6ea2b86fa 100644 --- a/pkg/common/cmd/msg_transfer.go +++ b/pkg/common/cmd/msg_transfer.go @@ -20,9 +20,8 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/spf13/cobra" - config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/internal/msgtransfer" + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type MsgTransferCmd struct { diff --git a/pkg/common/cmd/root.go b/pkg/common/cmd/root.go index 4f4c5e69b..69a2af950 100644 --- a/pkg/common/cmd/root.go +++ b/pkg/common/cmd/root.go @@ -17,16 +17,13 @@ package cmd import ( "fmt" - config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" - + "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/errs" - + "github.com/OpenIMSDK/tools/log" "github.com/spf13/cobra" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/log" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" + config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) type RootCmdPt interface { diff --git a/pkg/common/cmd/rpc.go b/pkg/common/cmd/rpc.go index 39bf9c036..d78233cbc 100644 --- a/pkg/common/cmd/rpc.go +++ b/pkg/common/cmd/rpc.go @@ -19,15 +19,12 @@ import ( "fmt" "github.com/OpenIMSDK/protocol/constant" + "github.com/OpenIMSDK/tools/discoveryregistry" + "github.com/OpenIMSDK/tools/errs" "github.com/spf13/cobra" "google.golang.org/grpc" - "github.com/OpenIMSDK/tools/errs" - config2 "github.com/openimsdk/open-im-server/v3/pkg/common/config" - - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/openimsdk/open-im-server/v3/pkg/common/startrpc" ) diff --git a/pkg/common/db/cache/conversation.go b/pkg/common/db/cache/conversation.go index 047188947..c8cc11923 100644 --- a/pkg/common/db/cache/conversation.go +++ b/pkg/common/db/cache/conversation.go @@ -20,11 +20,10 @@ import ( "strings" "time" + "github.com/OpenIMSDK/tools/utils" "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/tools/utils" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) diff --git a/pkg/common/db/cache/friend.go b/pkg/common/db/cache/friend.go index a2b60d48f..91faddaf9 100644 --- a/pkg/common/db/cache/friend.go +++ b/pkg/common/db/cache/friend.go @@ -18,11 +18,10 @@ import ( "context" "time" + "github.com/OpenIMSDK/tools/utils" "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/tools/utils" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) diff --git a/pkg/common/db/cache/group.go b/pkg/common/db/cache/group.go index 57fcf1a9b..0acf95ed4 100644 --- a/pkg/common/db/cache/group.go +++ b/pkg/common/db/cache/group.go @@ -22,14 +22,11 @@ import ( "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" - + "github.com/OpenIMSDK/tools/utils" "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/tools/utils" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) diff --git a/pkg/common/db/cache/init_redis.go b/pkg/common/db/cache/init_redis.go index a41a4f460..24de092b0 100644 --- a/pkg/common/db/cache/init_redis.go +++ b/pkg/common/db/cache/init_redis.go @@ -22,10 +22,9 @@ import ( "strings" "time" - "github.com/redis/go-redis/v9" - "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mw/specialerror" + "github.com/redis/go-redis/v9" "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) diff --git a/pkg/common/db/cache/meta_cache.go b/pkg/common/db/cache/meta_cache.go index fee982dc5..5f05ff166 100644 --- a/pkg/common/db/cache/meta_cache.go +++ b/pkg/common/db/cache/meta_cache.go @@ -20,13 +20,11 @@ import ( "errors" "time" - "github.com/OpenIMSDK/tools/mw/specialerror" - - "github.com/dtm-labs/rockscache" - "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/mw/specialerror" "github.com/OpenIMSDK/tools/utils" + "github.com/dtm-labs/rockscache" ) const ( diff --git a/pkg/common/db/cache/msg.go b/pkg/common/db/cache/msg.go index 5cef509ed..09c456ab3 100644 --- a/pkg/common/db/cache/msg.go +++ b/pkg/common/db/cache/msg.go @@ -20,21 +20,17 @@ import ( "strconv" "time" - "golang.org/x/sync/errgroup" - - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - - "github.com/gogo/protobuf/jsonpb" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" + "github.com/gogo/protobuf/jsonpb" + "github.com/redis/go-redis/v9" + "golang.org/x/sync/errgroup" "github.com/openimsdk/open-im-server/v3/pkg/common/config" - - "github.com/redis/go-redis/v9" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) const ( diff --git a/pkg/common/db/cache/user.go b/pkg/common/db/cache/user.go index f444a2c46..11c46b5ac 100644 --- a/pkg/common/db/cache/user.go +++ b/pkg/common/db/cache/user.go @@ -22,17 +22,14 @@ import ( "strconv" "time" - relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" - - "github.com/OpenIMSDK/tools/log" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/errs" - + "github.com/OpenIMSDK/tools/log" "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" + + relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" ) const ( diff --git a/pkg/common/db/controller/auth.go b/pkg/common/db/controller/auth.go index 13bc066ca..04c5d2617 100644 --- a/pkg/common/db/controller/auth.go +++ b/pkg/common/db/controller/auth.go @@ -17,15 +17,12 @@ package controller import ( "context" + "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/errs" - - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - + "github.com/OpenIMSDK/tools/tokenverify" "github.com/golang-jwt/jwt/v4" - "github.com/OpenIMSDK/protocol/constant" - "github.com/OpenIMSDK/tools/tokenverify" - + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" ) diff --git a/pkg/common/db/controller/black.go b/pkg/common/db/controller/black.go index 3c8a47a01..427194ecd 100644 --- a/pkg/common/db/controller/black.go +++ b/pkg/common/db/controller/black.go @@ -17,9 +17,8 @@ package controller import ( "context" - "github.com/OpenIMSDK/tools/pagination" - "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/pagination" "github.com/OpenIMSDK/tools/utils" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" diff --git a/pkg/common/db/controller/conversation.go b/pkg/common/db/controller/conversation.go index 0c64169a7..bf4349cf4 100644 --- a/pkg/common/db/controller/conversation.go +++ b/pkg/common/db/controller/conversation.go @@ -18,17 +18,15 @@ import ( "context" "time" - "github.com/OpenIMSDK/tools/pagination" - - "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/pagination" "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" relationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + "github.com/openimsdk/open-im-server/v3/pkg/msgprocessor" ) type ConversationDatabase interface { diff --git a/pkg/common/db/controller/friend.go b/pkg/common/db/controller/friend.go index bb5ec3087..24504c227 100644 --- a/pkg/common/db/controller/friend.go +++ b/pkg/common/db/controller/friend.go @@ -19,12 +19,11 @@ import ( "fmt" "time" - "github.com/OpenIMSDK/tools/pagination" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" + "github.com/OpenIMSDK/tools/pagination" "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" diff --git a/pkg/common/db/controller/group.go b/pkg/common/db/controller/group.go index 6f208cc24..2f2a972e4 100644 --- a/pkg/common/db/controller/group.go +++ b/pkg/common/db/controller/group.go @@ -18,12 +18,11 @@ import ( "context" "time" - "github.com/OpenIMSDK/tools/pagination" - "github.com/dtm-labs/rockscache" - "github.com/OpenIMSDK/protocol/constant" + "github.com/OpenIMSDK/tools/pagination" "github.com/OpenIMSDK/tools/tx" "github.com/OpenIMSDK/tools/utils" + "github.com/dtm-labs/rockscache" "github.com/redis/go-redis/v9" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" diff --git a/pkg/common/db/controller/msg.go b/pkg/common/db/controller/msg.go index add9b63ce..07b540ec0 100644 --- a/pkg/common/db/controller/msg.go +++ b/pkg/common/db/controller/msg.go @@ -21,14 +21,12 @@ import ( "time" "github.com/OpenIMSDK/protocol/constant" - - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - - "github.com/redis/go-redis/v9" - + 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/utils" + "github.com/redis/go-redis/v9" "go.mongodb.org/mongo-driver/mongo" "github.com/openimsdk/open-im-server/v3/pkg/common/config" @@ -37,10 +35,7 @@ import ( unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" "github.com/openimsdk/open-im-server/v3/pkg/common/db/unrelation" "github.com/openimsdk/open-im-server/v3/pkg/common/kafka" - - pbmsg "github.com/OpenIMSDK/protocol/msg" - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" ) const ( diff --git a/pkg/common/db/controller/user.go b/pkg/common/db/controller/user.go index 8ba1c01d3..c18fef316 100644 --- a/pkg/common/db/controller/user.go +++ b/pkg/common/db/controller/user.go @@ -18,19 +18,15 @@ import ( "context" "time" + "github.com/OpenIMSDK/protocol/user" + "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/pagination" "github.com/OpenIMSDK/tools/tx" - - "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" - - "github.com/OpenIMSDK/protocol/user" - - unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" - - "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" + unrelationtb "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) type UserDatabase interface { diff --git a/pkg/common/db/mgo/conversation.go b/pkg/common/db/mgo/conversation.go index d0a46ae47..93ca4eceb 100644 --- a/pkg/common/db/mgo/conversation.go +++ b/pkg/common/db/mgo/conversation.go @@ -18,9 +18,8 @@ import ( "context" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/protocol/constant" + "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/pagination" "go.mongodb.org/mongo-driver/bson" diff --git a/pkg/common/db/mgo/friend.go b/pkg/common/db/mgo/friend.go index 851db6157..01719822d 100644 --- a/pkg/common/db/mgo/friend.go +++ b/pkg/common/db/mgo/friend.go @@ -19,10 +19,9 @@ import ( "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/pagination" - "go.mongodb.org/mongo-driver/mongo/options" - "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/db/table/relation" ) diff --git a/pkg/common/db/mgo/friend_request.go b/pkg/common/db/mgo/friend_request.go index bfc101917..a05ca1018 100644 --- a/pkg/common/db/mgo/friend_request.go +++ b/pkg/common/db/mgo/friend_request.go @@ -19,10 +19,9 @@ import ( "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/pagination" - "go.mongodb.org/mongo-driver/mongo/options" - "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/db/table/relation" ) diff --git a/pkg/common/db/mgo/group.go b/pkg/common/db/mgo/group.go index 922bfd424..cfb104a21 100644 --- a/pkg/common/db/mgo/group.go +++ b/pkg/common/db/mgo/group.go @@ -19,7 +19,6 @@ import ( "time" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/pagination" "go.mongodb.org/mongo-driver/bson" diff --git a/pkg/common/db/mgo/group_member.go b/pkg/common/db/mgo/group_member.go index e28432b11..5d3331baa 100644 --- a/pkg/common/db/mgo/group_member.go +++ b/pkg/common/db/mgo/group_member.go @@ -17,9 +17,8 @@ package mgo import ( "context" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/protocol/constant" + "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/pagination" "go.mongodb.org/mongo-driver/bson" diff --git a/pkg/common/db/mgo/group_request.go b/pkg/common/db/mgo/group_request.go index d20682239..87fba1636 100644 --- a/pkg/common/db/mgo/group_request.go +++ b/pkg/common/db/mgo/group_request.go @@ -18,7 +18,6 @@ import ( "context" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/pagination" "go.mongodb.org/mongo-driver/bson" diff --git a/pkg/common/db/mgo/user.go b/pkg/common/db/mgo/user.go index 2797bc53f..df26776ac 100644 --- a/pkg/common/db/mgo/user.go +++ b/pkg/common/db/mgo/user.go @@ -20,11 +20,10 @@ import ( "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/errs" - "go.mongodb.org/mongo-driver/bson/primitive" - "github.com/OpenIMSDK/tools/mgoutil" "github.com/OpenIMSDK/tools/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" diff --git a/pkg/common/db/s3/cont/controller.go b/pkg/common/db/s3/cont/controller.go index f60c2c650..0a40d8f36 100644 --- a/pkg/common/db/s3/cont/controller.go +++ b/pkg/common/db/s3/cont/controller.go @@ -24,13 +24,11 @@ import ( "strings" "time" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" - - "github.com/google/uuid" - "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" + "github.com/google/uuid" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) diff --git a/pkg/common/db/s3/minio/minio.go b/pkg/common/db/s3/minio/minio.go index 81545ff1b..a5e34e1aa 100644 --- a/pkg/common/db/s3/minio/minio.go +++ b/pkg/common/db/s3/minio/minio.go @@ -29,14 +29,13 @@ import ( "time" "unsafe" - "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" - "github.com/OpenIMSDK/tools/log" "github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/signer" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/s3" ) diff --git a/pkg/common/db/table/relation/user.go b/pkg/common/db/table/relation/user.go index 265c3c93a..375930ddf 100644 --- a/pkg/common/db/table/relation/user.go +++ b/pkg/common/db/table/relation/user.go @@ -19,7 +19,6 @@ import ( "time" "github.com/OpenIMSDK/protocol/user" - "github.com/OpenIMSDK/tools/pagination" ) diff --git a/pkg/common/db/table/unrelation/msg.go b/pkg/common/db/table/unrelation/msg.go index c95b211a8..60dd7c260 100644 --- a/pkg/common/db/table/unrelation/msg.go +++ b/pkg/common/db/table/unrelation/msg.go @@ -20,10 +20,8 @@ import ( "time" "github.com/OpenIMSDK/protocol/msg" - - "go.mongodb.org/mongo-driver/mongo" - "github.com/OpenIMSDK/protocol/sdkws" + "go.mongodb.org/mongo-driver/mongo" ) const ( diff --git a/pkg/common/db/unrelation/mongo.go b/pkg/common/db/unrelation/mongo.go index 4c093b3c3..25bf4d10c 100644 --- a/pkg/common/db/unrelation/mongo.go +++ b/pkg/common/db/unrelation/mongo.go @@ -21,13 +21,12 @@ import ( "strings" "time" + "github.com/OpenIMSDK/tools/errs" + "github.com/OpenIMSDK/tools/mw/specialerror" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mw/specialerror" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index 0a6f683a5..0e33970c3 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -21,20 +21,17 @@ import ( "fmt" "time" - "github.com/OpenIMSDK/protocol/msg" - "github.com/OpenIMSDK/protocol/constant" - + "github.com/OpenIMSDK/protocol/msg" + "github.com/OpenIMSDK/protocol/sdkws" + "github.com/OpenIMSDK/tools/errs" + "github.com/OpenIMSDK/tools/log" "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" "google.golang.org/protobuf/proto" - "github.com/OpenIMSDK/protocol/sdkws" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/log" - table "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/unrelation" ) diff --git a/pkg/common/discoveryregister/discoveryregister.go b/pkg/common/discoveryregister/discoveryregister.go index 4ade0147a..18684c349 100644 --- a/pkg/common/discoveryregister/discoveryregister.go +++ b/pkg/common/discoveryregister/discoveryregister.go @@ -18,13 +18,12 @@ import ( "errors" "os" - "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/direct" - - "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes" - "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper" - "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" + + "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/direct" + "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/kubernetes" + "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister/zookeeper" ) // NewDiscoveryRegister creates a new service discovery and registry client based on the provided environment type. diff --git a/pkg/common/discoveryregister/kubernetes/kubernetes.go b/pkg/common/discoveryregister/kubernetes/kubernetes.go index ab8864c6f..59a78a336 100644 --- a/pkg/common/discoveryregister/kubernetes/kubernetes.go +++ b/pkg/common/discoveryregister/kubernetes/kubernetes.go @@ -22,12 +22,10 @@ import ( "strconv" "strings" - "github.com/stathat/consistent" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/log" + "github.com/stathat/consistent" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) diff --git a/pkg/common/discoveryregister/zookeeper/zookeeper.go b/pkg/common/discoveryregister/zookeeper/zookeeper.go index 6e55b6b8b..099badf42 100644 --- a/pkg/common/discoveryregister/zookeeper/zookeeper.go +++ b/pkg/common/discoveryregister/zookeeper/zookeeper.go @@ -20,10 +20,9 @@ import ( "strings" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/discoveryregistry" openkeeper "github.com/OpenIMSDK/tools/discoveryregistry/zookeeper" + "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/openimsdk/open-im-server/v3/pkg/common/config" diff --git a/pkg/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go index ed961b93e..f8b3ee249 100644 --- a/pkg/common/kafka/consumer_group.go +++ b/pkg/common/kafka/consumer_group.go @@ -17,13 +17,12 @@ package kafka import ( "context" "errors" + "strings" "github.com/IBM/sarama" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" - "strings" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) diff --git a/pkg/common/kafka/producer.go b/pkg/common/kafka/producer.go index 81064ab5f..19ff19828 100644 --- a/pkg/common/kafka/producer.go +++ b/pkg/common/kafka/producer.go @@ -18,19 +18,17 @@ import ( "bytes" "context" "errors" + "fmt" "strings" "time" - "github.com/OpenIMSDK/tools/errs" - "github.com/IBM/sarama" "github.com/OpenIMSDK/protocol/constant" + "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/mcontext" "google.golang.org/protobuf/proto" - "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/common/config" ) diff --git a/pkg/common/startrpc/start.go b/pkg/common/startrpc/start.go index e19456d86..07b50070f 100644 --- a/pkg/common/startrpc/start.go +++ b/pkg/common/startrpc/start.go @@ -27,25 +27,20 @@ import ( "syscall" "time" + "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" - - util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" - + "github.com/OpenIMSDK/tools/mw" + "github.com/OpenIMSDK/tools/network" + grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" - - "github.com/openimsdk/open-im-server/v3/pkg/common/config" - "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" - - grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" - - "github.com/OpenIMSDK/tools/discoveryregistry" - "github.com/OpenIMSDK/tools/mw" - "github.com/OpenIMSDK/tools/network" + "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" + util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" ) // Start rpc server. diff --git a/pkg/rpcclient/auth.go b/pkg/rpcclient/auth.go index 810b7ae93..387acf320 100644 --- a/pkg/rpcclient/auth.go +++ b/pkg/rpcclient/auth.go @@ -17,10 +17,9 @@ package rpcclient import ( "context" - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/auth" "github.com/OpenIMSDK/tools/discoveryregistry" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" diff --git a/pkg/rpcclient/conversation.go b/pkg/rpcclient/conversation.go index 9afa45004..926c571a4 100644 --- a/pkg/rpcclient/conversation.go +++ b/pkg/rpcclient/conversation.go @@ -18,15 +18,13 @@ import ( "context" "fmt" - "google.golang.org/grpc" - pbconversation "github.com/OpenIMSDK/protocol/conversation" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" - - util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" ) type Conversation struct { diff --git a/pkg/rpcclient/friend.go b/pkg/rpcclient/friend.go index 39026b10c..a0e0226ec 100644 --- a/pkg/rpcclient/friend.go +++ b/pkg/rpcclient/friend.go @@ -17,11 +17,10 @@ package rpcclient import ( "context" - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/friend" sdkws "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/discoveryregistry" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" diff --git a/pkg/rpcclient/group.go b/pkg/rpcclient/group.go index cb61579be..7a15c1116 100644 --- a/pkg/rpcclient/group.go +++ b/pkg/rpcclient/group.go @@ -18,14 +18,13 @@ import ( "context" "strings" - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" diff --git a/pkg/rpcclient/msg.go b/pkg/rpcclient/msg.go index 6804e78a2..f468a6569 100644 --- a/pkg/rpcclient/msg.go +++ b/pkg/rpcclient/msg.go @@ -18,18 +18,16 @@ import ( "context" "encoding/json" - "google.golang.org/grpc" - "google.golang.org/protobuf/proto" - "github.com/OpenIMSDK/protocol/constant" "github.com/OpenIMSDK/protocol/msg" "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/log" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" + "google.golang.org/protobuf/proto" "github.com/openimsdk/open-im-server/v3/pkg/common/config" - // "google.golang.org/protobuf/proto". ) func newContentTypeConf() map[int32]config.NotificationConf { diff --git a/pkg/rpcclient/notification/friend.go b/pkg/rpcclient/notification/friend.go index a6b693724..ba7a77c55 100644 --- a/pkg/rpcclient/notification/friend.go +++ b/pkg/rpcclient/notification/friend.go @@ -17,11 +17,10 @@ package notification import ( "context" - "github.com/OpenIMSDK/tools/mcontext" - "github.com/OpenIMSDK/protocol/constant" pbfriend "github.com/OpenIMSDK/protocol/friend" "github.com/OpenIMSDK/protocol/sdkws" + "github.com/OpenIMSDK/tools/mcontext" "github.com/openimsdk/open-im-server/v3/pkg/common/convert" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" diff --git a/pkg/rpcclient/notification/group.go b/pkg/rpcclient/notification/group.go old mode 100755 new mode 100644 index d336e4b12..8b355b663 --- a/pkg/rpcclient/notification/group.go +++ b/pkg/rpcclient/notification/group.go @@ -18,8 +18,6 @@ import ( "context" "fmt" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - "github.com/OpenIMSDK/protocol/constant" pbgroup "github.com/OpenIMSDK/protocol/group" "github.com/OpenIMSDK/protocol/sdkws" @@ -28,6 +26,7 @@ import ( "github.com/OpenIMSDK/tools/mcontext" "github.com/OpenIMSDK/tools/utils" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" "github.com/openimsdk/open-im-server/v3/pkg/common/db/table/relation" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" diff --git a/pkg/rpcclient/push.go b/pkg/rpcclient/push.go index b5a5c49cf..20296e6cd 100644 --- a/pkg/rpcclient/push.go +++ b/pkg/rpcclient/push.go @@ -17,10 +17,9 @@ package rpcclient import ( "context" - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/push" "github.com/OpenIMSDK/tools/discoveryregistry" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" diff --git a/pkg/rpcclient/third.go b/pkg/rpcclient/third.go old mode 100755 new mode 100644 index 05b825060..f6ca458fd --- a/pkg/rpcclient/third.go +++ b/pkg/rpcclient/third.go @@ -18,13 +18,12 @@ import ( "context" "net/url" - "github.com/minio/minio-go/v7" - "github.com/minio/minio-go/v7/pkg/credentials" - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/third" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" + "google.golang.org/grpc" "github.com/openimsdk/open-im-server/v3/pkg/common/config" util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" diff --git a/pkg/rpcclient/user.go b/pkg/rpcclient/user.go index 810a88ad0..8d0f7fc8b 100644 --- a/pkg/rpcclient/user.go +++ b/pkg/rpcclient/user.go @@ -18,18 +18,16 @@ import ( "context" "strings" - "github.com/openimsdk/open-im-server/v3/pkg/authverify" - util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" - - "google.golang.org/grpc" - "github.com/OpenIMSDK/protocol/sdkws" "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/discoveryregistry" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/utils" + "google.golang.org/grpc" + "github.com/openimsdk/open-im-server/v3/pkg/authverify" "github.com/openimsdk/open-im-server/v3/pkg/common/config" + util "github.com/openimsdk/open-im-server/v3/pkg/util/genutil" ) // User represents a structure holding connection details for the User RPC client.