From b398ec98e13d2e932f0f03727334cf4ecd737250 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 2 Jul 2021 18:10:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/chat/send_msg.go | 2 +- src/rpc/friend/friend/add_friend_response.go | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/api/chat/send_msg.go b/src/api/chat/send_msg.go index 1ed48f3e1..c39f4a74f 100644 --- a/src/api/chat/send_msg.go +++ b/src/api/chat/send_msg.go @@ -17,7 +17,7 @@ type paramsUserSendMsg struct { ReqIdentifier int32 `json:"reqIdentifier" binding:"required"` PlatformID int32 `json:"platformID" binding:"required"` SendID string `json:"sendID" binding:"required"` - SenderNickName string `json:"senderNickName" binding:"required"` + SenderNickName string `json:"senderNickName"` SenderFaceURL string `json:"senderFaceUrl"` OperationID string `json:"operationID" binding:"required"` Data struct { diff --git a/src/rpc/friend/friend/add_friend_response.go b/src/rpc/friend/friend/add_friend_response.go index e8a0b1189..f372f03a6 100644 --- a/src/rpc/friend/friend/add_friend_response.go +++ b/src/rpc/friend/friend/add_friend_response.go @@ -51,19 +51,19 @@ func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddF log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) } //Push message when establish friends successfully - senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) - if errSend == nil { - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: req.Uid, - Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), - SendTime: utils.GetCurrentTimestampBySecond(), - MsgFrom: constant.UserMsgType, //Notification message identification - ContentType: constant.AcceptFriendApplicationTip, //Add friend flag - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - }) - } + //senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) + //if errSend == nil { + // logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + // SendID: claims.UID, + // RecvID: req.Uid, + // Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), + // SendTime: utils.GetCurrentTimestampBySecond(), + // MsgFrom: constant.UserMsgType, //Notification message identification + // ContentType: constant.AcceptFriendApplicationTip, //Add friend flag + // SessionType: constant.SingleChatType, + // OperationID: req.OperationID, + // }) + //} } if req.Flag == constant.RefuseFriendFlag { senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) From ba0ac9b604724a0f2e5cbe17d805b23b2b78ca73 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 2 Jul 2021 18:11:33 +0800 Subject: [PATCH 2/3] Revert "friend modify" This reverts commit b398ec98 --- src/api/chat/send_msg.go | 2 +- src/rpc/friend/friend/add_friend_response.go | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/api/chat/send_msg.go b/src/api/chat/send_msg.go index c39f4a74f..1ed48f3e1 100644 --- a/src/api/chat/send_msg.go +++ b/src/api/chat/send_msg.go @@ -17,7 +17,7 @@ type paramsUserSendMsg struct { ReqIdentifier int32 `json:"reqIdentifier" binding:"required"` PlatformID int32 `json:"platformID" binding:"required"` SendID string `json:"sendID" binding:"required"` - SenderNickName string `json:"senderNickName"` + SenderNickName string `json:"senderNickName" binding:"required"` SenderFaceURL string `json:"senderFaceUrl"` OperationID string `json:"operationID" binding:"required"` Data struct { diff --git a/src/rpc/friend/friend/add_friend_response.go b/src/rpc/friend/friend/add_friend_response.go index f372f03a6..e8a0b1189 100644 --- a/src/rpc/friend/friend/add_friend_response.go +++ b/src/rpc/friend/friend/add_friend_response.go @@ -51,19 +51,19 @@ func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddF log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) } //Push message when establish friends successfully - //senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) - //if errSend == nil { - // logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - // SendID: claims.UID, - // RecvID: req.Uid, - // Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), - // SendTime: utils.GetCurrentTimestampBySecond(), - // MsgFrom: constant.UserMsgType, //Notification message identification - // ContentType: constant.AcceptFriendApplicationTip, //Add friend flag - // SessionType: constant.SingleChatType, - // OperationID: req.OperationID, - // }) - //} + senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) + if errSend == nil { + logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + SendID: claims.UID, + RecvID: req.Uid, + Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), + SendTime: utils.GetCurrentTimestampBySecond(), + MsgFrom: constant.UserMsgType, //Notification message identification + ContentType: constant.AcceptFriendApplicationTip, //Add friend flag + SessionType: constant.SingleChatType, + OperationID: req.OperationID, + }) + } } if req.Flag == constant.RefuseFriendFlag { senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) From af23a84f26dc2db76ae369e6c10acbbf702338a2 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Fri, 2 Jul 2021 18:13:31 +0800 Subject: [PATCH 3/3] friend push modify --- src/api/chat/send_msg.go | 2 +- src/rpc/friend/friend/add_friend_response.go | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/api/chat/send_msg.go b/src/api/chat/send_msg.go index 1ed48f3e1..c39f4a74f 100644 --- a/src/api/chat/send_msg.go +++ b/src/api/chat/send_msg.go @@ -17,7 +17,7 @@ type paramsUserSendMsg struct { ReqIdentifier int32 `json:"reqIdentifier" binding:"required"` PlatformID int32 `json:"platformID" binding:"required"` SendID string `json:"sendID" binding:"required"` - SenderNickName string `json:"senderNickName" binding:"required"` + SenderNickName string `json:"senderNickName"` SenderFaceURL string `json:"senderFaceUrl"` OperationID string `json:"operationID" binding:"required"` Data struct { diff --git a/src/rpc/friend/friend/add_friend_response.go b/src/rpc/friend/friend/add_friend_response.go index e8a0b1189..f372f03a6 100644 --- a/src/rpc/friend/friend/add_friend_response.go +++ b/src/rpc/friend/friend/add_friend_response.go @@ -51,19 +51,19 @@ func (s *friendServer) AddFriendResponse(ctx context.Context, req *pbFriend.AddF log.Error(req.Token, req.OperationID, "err=%s,create friendship failed", err.Error()) } //Push message when establish friends successfully - senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) - if errSend == nil { - logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ - SendID: claims.UID, - RecvID: req.Uid, - Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), - SendTime: utils.GetCurrentTimestampBySecond(), - MsgFrom: constant.UserMsgType, //Notification message identification - ContentType: constant.AcceptFriendApplicationTip, //Add friend flag - SessionType: constant.SingleChatType, - OperationID: req.OperationID, - }) - } + //senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID) + //if errSend == nil { + // logic.SendMsgByWS(&pbChat.WSToMsgSvrChatMsg{ + // SendID: claims.UID, + // RecvID: req.Uid, + // Content: content_struct.NewContentStructString(1, "", senderInfo.Name+" agreed to add you as a friend."), + // SendTime: utils.GetCurrentTimestampBySecond(), + // MsgFrom: constant.UserMsgType, //Notification message identification + // ContentType: constant.AcceptFriendApplicationTip, //Add friend flag + // SessionType: constant.SingleChatType, + // OperationID: req.OperationID, + // }) + //} } if req.Flag == constant.RefuseFriendFlag { senderInfo, errSend := im_mysql_model.FindUserByUID(claims.UID)