From 7e937d7d293ebc53abe7792dbb8633c548c58caa Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Tue, 29 Mar 2022 16:04:54 +0800 Subject: [PATCH] tag --- internal/rpc/office/office.go | 2 +- internal/rpc/user/user.go | 1 + pkg/common/db/mysql_model/im_mysql_model/user_model.go | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 8f177abcb..ac691190a 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -165,7 +165,7 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR } groupUserIDList = append(groupUserIDList, userIDList...) } - log.NewDebug(req.OperationID, utils.GetSelfFuncName(), groupUserIDList, req.GroupList) + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), groupUserIDList, req.GroupList) var userIDList []string userIDList = append(userIDList, tagUserIDList...) userIDList = append(userIDList, groupUserIDList...) diff --git a/internal/rpc/user/user.go b/internal/rpc/user/user.go index c8a5d8f65..f83e0e551 100644 --- a/internal/rpc/user/user.go +++ b/internal/rpc/user/user.go @@ -93,6 +93,7 @@ func syncPeerUserConversation(conversation *pbUser.Conversation, operationID str log.NewError(operationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) return err } + chat.SetConversationNotification(operationID, conversation.UserID) } return nil 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 3a37062a7..ab367a5ff 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 @@ -379,10 +379,10 @@ func GetConversations(OwnerUserID string, conversationIDs []string) ([]db.Conver } func CreateConversationIfNotExist(conversation db.Conversation) error { - //dbConn, err := db.DB.MysqlDB.DefaultGormDB() - //if err != nil { - // return err - //} - //err = dbConn.Model(&db.Conversation{}).Where().Find().Error + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return err + } + err = dbConn.Model(&db.Conversation{}).Create(conversation).Error return nil }