Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort code import with order like std, default, local #2897

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cmd/openim-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-cmdutils/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-crontask/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-msggateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-msgtransfer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-push/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-conversation/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-friend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-group/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-msg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-third/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/openim-rpc/openim-rpc-user/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion internal/api/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/api/conversation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions internal/api/friend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/api/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions internal/api/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion internal/api/jssdk/jssdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package jssdk

import (
"context"
"sort"

"github.com/gin-gonic/gin"
"github.com/openimsdk/protocol/conversation"
"github.com/openimsdk/protocol/group"
Expand All @@ -12,7 +14,6 @@ import (
"github.com/openimsdk/protocol/user"
"github.com/openimsdk/tools/mcontext"
"github.com/openimsdk/tools/utils/datautil"
"sort"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions internal/api/jssdk/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package jssdk

import (
"context"
"io"
"strings"

"github.com/gin-gonic/gin"
"github.com/openimsdk/tools/a2r"
"github.com/openimsdk/tools/apiresp"
"github.com/openimsdk/tools/checker"
"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) {
Expand Down
9 changes: 5 additions & 4 deletions internal/api/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
19 changes: 8 additions & 11 deletions internal/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
3 changes: 2 additions & 1 deletion internal/api/statistics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions internal/api/third.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ package api

import (
"context"
"google.golang.org/grpc"
"math/rand"
"net/http"
"net/url"
"strconv"
"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
Expand Down
3 changes: 2 additions & 1 deletion internal/api/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ 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"
"github.com/openimsdk/tools/a2r"
"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
Expand Down
5 changes: 3 additions & 2 deletions internal/msggateway/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Loading
Loading