From ae2342353f454b30be89962ab8503d245104beb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AC=A7=E9=98=B3=E6=B0=8F?= Date: Mon, 15 Aug 2022 20:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E7=A6=81=E7=94=A8=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/cms_api/user/user.go | 4 ++++ internal/rpc/user/user.go | 8 ++++++++ .../db/mysql_model/im_mysql_model/user_model.go | 16 ++++++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/internal/cms_api/user/user.go b/internal/cms_api/user/user.go index a0e5dc188..c6af846fe 100644 --- a/internal/cms_api/user/user.go +++ b/internal/cms_api/user/user.go @@ -246,6 +246,10 @@ func GetBlockUsers(c *gin.Context) { ProfilePhoto: v.User.ProfilePhoto, Nickname: v.User.Nickname, IsBlock: v.User.IsBlock, + Birth: v.User.Birth, + PhoneNumber: v.User.PhoneNumber, + Email: v.User.Email, + Gender: int(v.User.Gender), CreateTime: v.User.CreateTime, }, BeginDisableTime: v.BeginDisableTime, diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index 7be310063..af7a8725a 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -559,6 +559,10 @@ func (s *userServer) GetBlockUsers(ctx context.Context, req *pbUser.GetBlockUser Nickname: v.User.Nickname, UserId: v.User.UserID, IsBlock: true, + Birth: v.User.Birth.Format("2006-01-02"), + PhoneNumber: v.User.PhoneNumber, + Email: v.User.Email, + Gender: v.User.Gender, }, BeginDisableTime: (v.BeginDisableTime).String(), EndDisableTime: (v.EndDisableTime).String(), @@ -590,6 +594,10 @@ func (s *userServer) GetBlockUserById(_ context.Context, req *pbUser.GetBlockUse Nickname: user.User.Nickname, UserId: user.User.UserID, IsBlock: true, + Birth: user.User.Birth.Format("2006-01-02"), + PhoneNumber: user.User.PhoneNumber, + Email: user.User.Email, + Gender: user.User.Gender, }, BeginDisableTime: (user.BeginDisableTime).String(), EndDisableTime: (user.EndDisableTime).String(), diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index 5b198b046..d3d0a81ec 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -248,8 +248,12 @@ func GetBlockUserById(userId string) (BlockUserInfo, error) { return blockUserInfo, err } blockUserInfo.User.UserID = user.UserID - blockUserInfo.User.FaceURL = user.UserID + blockUserInfo.User.FaceURL = user.FaceURL blockUserInfo.User.Nickname = user.Nickname + blockUserInfo.User.Birth = user.Birth + blockUserInfo.User.PhoneNumber = user.PhoneNumber + blockUserInfo.User.Email = user.Email + blockUserInfo.User.Gender = user.Gender blockUserInfo.BeginDisableTime = blockUser.BeginDisableTime blockUserInfo.EndDisableTime = blockUser.EndDisableTime return blockUserInfo, nil @@ -271,9 +275,13 @@ func GetBlockUsers(showNumber, pageNumber int32) ([]BlockUserInfo, error) { if err := dbConn.Table("users").Where("user_id=?", blockUser.UserId).First(&user).Error; err == nil { blockUserInfos = append(blockUserInfos, BlockUserInfo{ User: db.User{ - UserID: user.UserID, - Nickname: user.Nickname, - FaceURL: user.FaceURL, + UserID: user.UserID, + Nickname: user.Nickname, + FaceURL: user.FaceURL, + Birth: user.Birth, + PhoneNumber: user.PhoneNumber, + Email: user.Email, + Gender: user.Gender, }, BeginDisableTime: blockUser.BeginDisableTime, EndDisableTime: blockUser.EndDisableTime,