Refactor code

pull/141/head
wenxu12345 3 years ago
parent 109e8b53a1
commit 9f6fd3ee6a

@ -405,24 +405,25 @@ func (s *friendServer) GetFriendApplyList(ctx context.Context, req *pbFriend.Get
var appleUserList []*sdkws.FriendRequest var appleUserList []*sdkws.FriendRequest
for _, applyUserInfo := range ApplyUsersInfo { for _, applyUserInfo := range ApplyUsersInfo {
var userInfo sdkws.FriendRequest var userInfo sdkws.FriendRequest
utils.CopyStructFields(&userInfo, applyUserInfo) cp.FriendRequestDBCopyOpenIM(&userInfo, &applyUserInfo)
u, err := imdb.GetUserByUserID(userInfo.FromUserID) // utils.CopyStructFields(&userInfo, applyUserInfo)
if err != nil { // u, err := imdb.GetUserByUserID(userInfo.FromUserID)
log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.FromUserID) // if err != nil {
continue // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.FromUserID)
} // continue
userInfo.FromNickname = u.Nickname // }
userInfo.FromFaceURL = u.FaceURL // userInfo.FromNickname = u.Nickname
userInfo.FromGender = u.Gender // userInfo.FromFaceURL = u.FaceURL
// userInfo.FromGender = u.Gender
u, err = imdb.GetUserByUserID(userInfo.ToUserID) //
if err != nil { // u, err = imdb.GetUserByUserID(userInfo.ToUserID)
log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.ToUserID) // if err != nil {
continue // log.Error(req.CommID.OperationID, "GetUserByUserID", userInfo.ToUserID)
} // continue
userInfo.ToNickname = u.Nickname // }
userInfo.ToFaceURL = u.FaceURL // userInfo.ToNickname = u.Nickname
userInfo.ToGender = u.Gender // userInfo.ToFaceURL = u.FaceURL
// userInfo.ToGender = u.Gender
appleUserList = append(appleUserList, &userInfo) appleUserList = append(appleUserList, &userInfo)
} }

Loading…
Cancel
Save