From 4b111474f58d88b516dc9ac3358f683323c4d37b Mon Sep 17 00:00:00 2001 From: AndrewZuo01 Date: Fri, 29 Dec 2023 15:51:46 +0800 Subject: [PATCH] fix updateUserInfoEx --- internal/rpc/conversation/conversaion.go | 5 +++++ internal/rpc/msg/server.go | 15 +++++++++++++++ internal/rpc/user/callback.go | 9 ++++----- pkg/callbackstruct/user.go | 8 ++++---- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/internal/rpc/conversation/conversaion.go b/internal/rpc/conversation/conversaion.go index 88c9ff7ff..e65bd945a 100644 --- a/internal/rpc/conversation/conversaion.go +++ b/internal/rpc/conversation/conversaion.go @@ -46,6 +46,11 @@ type conversationServer struct { conversationNotificationSender *notification.ConversationNotificationSender } +func (c *conversationServer) GetConversationList(ctx context.Context, req *pbconversation.GetConversationListReq) (*pbconversation.GetConversationListResp, error) { + //TODO implement me + panic("implement me") +} + func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error { rdb, err := cache.NewRedis() if err != nil { diff --git a/internal/rpc/msg/server.go b/internal/rpc/msg/server.go index 88be287fd..bb59b00b4 100644 --- a/internal/rpc/msg/server.go +++ b/internal/rpc/msg/server.go @@ -47,6 +47,21 @@ type ( } ) +func (m *msgServer) GetMaxSeqs(ctx context.Context, req *msg.GetMaxSeqsReq) (*msg.SeqsInfoResp, error) { + //TODO implement me + panic("implement me") +} + +func (m *msgServer) GetHasReadSeqs(ctx context.Context, req *msg.GetHasReadSeqsReq) (*msg.SeqsInfoResp, error) { + //TODO implement me + panic("implement me") +} + +func (m *msgServer) GetMsgByConversationIDs(ctx context.Context, req *msg.GetMsgByConversationIDsReq) (*msg.GetMsgByConversationIDsResp, error) { + //TODO implement me + panic("implement me") +} + func (m *msgServer) addInterceptorHandler(interceptorFunc ...MessageInterceptorFunc) { m.Handlers = append(m.Handlers, interceptorFunc...) } diff --git a/internal/rpc/user/callback.go b/internal/rpc/user/callback.go index 9e02eb130..601de8e43 100644 --- a/internal/rpc/user/callback.go +++ b/internal/rpc/user/callback.go @@ -16,7 +16,6 @@ package user import ( "context" - pbuser "github.com/OpenIMSDK/protocol/user" "github.com/OpenIMSDK/tools/utils" @@ -67,16 +66,16 @@ func CallbackBeforeUpdateUserInfoEx(ctx context.Context, req *pbuser.UpdateUserI cbReq := &cbapi.CallbackBeforeUpdateUserInfoExReq{ CallbackCommand: cbapi.CallbackBeforeUpdateUserInfoExCommand, UserID: req.UserInfo.UserID, - FaceURL: &req.UserInfo.FaceURL, - Nickname: &req.UserInfo.Nickname, + FaceURL: &req.UserInfo.FaceURL.Value, + Nickname: &req.UserInfo.Nickname.Value, } resp := &cbapi.CallbackBeforeUpdateUserInfoExResp{} if err := http.CallBackPostReturn(ctx, config.Config.Callback.CallbackUrl, cbReq, resp, config.Config.Callback.CallbackBeforeUpdateUserInfoEx); err != nil { return err } - utils.NotNilReplace(&req.UserInfo.FaceURL, resp.FaceURL) + utils.NotNilReplace(req.UserInfo.FaceURL, resp.FaceURL) utils.NotNilReplace(req.UserInfo.Ex, resp.Ex) - utils.NotNilReplace(&req.UserInfo.Nickname, resp.Nickname) + utils.NotNilReplace(req.UserInfo.Nickname, resp.Nickname) return nil } func CallbackAfterUpdateUserInfoEx(ctx context.Context, req *pbuser.UpdateUserInfoExReq) error { diff --git a/pkg/callbackstruct/user.go b/pkg/callbackstruct/user.go index bfb69bd38..12dcca963 100644 --- a/pkg/callbackstruct/user.go +++ b/pkg/callbackstruct/user.go @@ -53,16 +53,16 @@ type CallbackBeforeUpdateUserInfoExReq struct { } type CallbackBeforeUpdateUserInfoExResp struct { CommonCallbackResp - Nickname *string `json:"nickName"` - FaceURL *string `json:"faceURL"` + Nickname *wrapperspb.StringValue `json:"nickName"` + FaceURL *wrapperspb.StringValue `json:"faceURL"` Ex *wrapperspb.StringValue `json:"ex"` } type CallbackAfterUpdateUserInfoExReq struct { CallbackCommand `json:"callbackCommand"` UserID string `json:"userID"` - Nickname string `json:"nickName"` - FaceURL string `json:"faceURL"` + Nickname *wrapperspb.StringValue `json:"nickName"` + FaceURL *wrapperspb.StringValue `json:"faceURL"` Ex *wrapperspb.StringValue `json:"ex"` } type CallbackAfterUpdateUserInfoExResp struct {