style: add format and lint (#773)

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong
2023-08-04 21:38:30 +08:00
committed by GitHub
parent 863c52c7bb
commit af00960ad1
132 changed files with 679 additions and 244 deletions
+2 -1
View File
@@ -19,9 +19,10 @@ import (
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/protocol/auth"
"github.com/OpenIMSDK/tools/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
func NewAuth(discov discoveryregistry.SvcDiscoveryRegistry) *Auth {
+2 -1
View File
@@ -20,10 +20,11 @@ import (
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
pbConversation "github.com/OpenIMSDK/protocol/conversation"
"github.com/OpenIMSDK/tools/discoveryregistry"
"github.com/OpenIMSDK/tools/errs"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
type Conversation struct {
+2 -1
View File
@@ -19,10 +19,11 @@ import (
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/protocol/friend"
sdkws "github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/tools/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
type Friend struct {
+2 -1
View File
@@ -20,13 +20,14 @@ import (
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"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"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
type Group struct {
+2 -1
View File
@@ -21,13 +21,14 @@ import (
"google.golang.org/grpc"
"google.golang.org/protobuf/proto"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"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"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
// "google.golang.org/protobuf/proto".
)
+4 -2
View File
@@ -17,9 +17,10 @@ package notification
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
"github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
)
type ConversationNotificationSender struct {
@@ -32,7 +33,8 @@ func NewConversationNotificationSender(msgRpcClient *rpcclient.MessageRpcClient)
// SetPrivate调用.
func (c *ConversationNotificationSender) ConversationSetPrivateNotification(ctx context.Context, sendID, recvID string,
isPrivateChat bool, conversationID string) error {
isPrivateChat bool, conversationID string,
) error {
tips := &sdkws.ConversationSetPrivateTips{
RecvID: recvID,
SendID: sendID,
+4 -3
View File
@@ -19,13 +19,14 @@ import (
"github.com/OpenIMSDK/tools/mcontext"
"github.com/OpenIMSDK/protocol/constant"
pbFriend "github.com/OpenIMSDK/protocol/friend"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/convert"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
"github.com/OpenIMSDK/protocol/constant"
pbFriend "github.com/OpenIMSDK/protocol/friend"
"github.com/OpenIMSDK/protocol/sdkws"
)
type FriendNotificationSender struct {
+4 -3
View File
@@ -18,9 +18,6 @@ import (
"context"
"fmt"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
"github.com/OpenIMSDK/protocol/constant"
pbGroup "github.com/OpenIMSDK/protocol/group"
"github.com/OpenIMSDK/protocol/sdkws"
@@ -28,6 +25,10 @@ import (
"github.com/OpenIMSDK/tools/log"
"github.com/OpenIMSDK/tools/mcontext"
"github.com/OpenIMSDK/tools/utils"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
)
func NewGroupNotificationSender(
+2 -1
View File
@@ -17,9 +17,10 @@ package notification
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
"github.com/OpenIMSDK/protocol/constant"
"github.com/OpenIMSDK/protocol/sdkws"
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
)
type MsgNotificationSender struct {
+2 -1
View File
@@ -19,9 +19,10 @@ import (
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/protocol/push"
"github.com/OpenIMSDK/tools/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
type Push struct {
+2 -1
View File
@@ -23,9 +23,10 @@ import (
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"github.com/OpenIMSDK/protocol/third"
"github.com/OpenIMSDK/tools/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
type Third struct {
+5 -2
View File
@@ -16,17 +16,19 @@ package rpcclient
import (
"context"
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
"strings"
"github.com/OpenIMSDK/Open-IM-Server/pkg/authverify"
"google.golang.org/grpc"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
"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"
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
)
type User struct {
@@ -154,6 +156,7 @@ func (u *UserRpcClient) GetAllUserIDs(ctx context.Context, pageNumber, showNumbe
}
return resp.UserIDs, nil
}
func (u *UserRpcClient) SetUserStatus(ctx context.Context, userID string, status int32, platformID int) error {
_, err := u.Client.SetUserStatus(ctx, &user.SetUserStatusReq{StatusList: []*user.OnlineStatus{{UserID: userID, Status: status, PlatformID: int32(platformID)}}})
return err