diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index ac691190a..e96475773 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -163,6 +163,7 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMemberIDListByGroupID failed", err.Error()) continue } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), userIDList) groupUserIDList = append(groupUserIDList, userIDList...) } log.NewInfo(req.OperationID, utils.GetSelfFuncName(), groupUserIDList, req.GroupList) @@ -172,7 +173,7 @@ func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagR userIDList = append(userIDList, req.UserList...) userIDList = utils.RemoveUserIDRepByMap(userIDList) for i, userID := range userIDList { - if userID == req.SendID { + if userID == req.SendID || userID == "" { userIDList = append(userIDList[:i], userIDList[i+1:]...) } } diff --git a/pkg/base_info/office_struct.go b/pkg/base_info/office_struct.go index a13255032..ac22c2239 100644 --- a/pkg/base_info/office_struct.go +++ b/pkg/base_info/office_struct.go @@ -53,7 +53,6 @@ type SendMsg2TagReq struct { SenderPlatformID int32 `json:"senderPlatformID" binding:"required"` Content string `json:"content" binding:"required"` - ContentType int32 `json:"contentType" binding:"required"` OperationID string `json:"operationID" binding:"required"` } diff --git a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go index 2eb0b591f..90e0a26e7 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/group_member_model.go @@ -74,11 +74,15 @@ func GetGroupMemberIDListByGroupID(groupID string) ([]string, error) { return nil, err } dbConn.LogMode(true) - var groupMemberIDList []string - err = dbConn.Table("group_members").Select("user_id").Where("group_id=?", groupID).Find(&groupMemberIDList).Error + var groupMembers []db.GroupMember + err = dbConn.Table("group_members").Select("user_id").Where("group_id=?", groupID).Find(&groupMembers).Error if err != nil { return nil, err } + var groupMemberIDList []string + for _, v := range groupMembers { + groupMemberIDList = append(groupMemberIDList, v.UserID) + } return groupMemberIDList, nil }