mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 18:36:19 +08:00
pull msg
This commit is contained in:
parent
5f7fa2a7a2
commit
6b612ec345
@ -116,7 +116,7 @@ func (m *Message) client() (msg.MsgClient, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Message) GetSeq(c *gin.Context) {
|
func (m *Message) GetSeq(c *gin.Context) {
|
||||||
a2r.Call(msg.MsgClient.GetMaxAndMinSeq, m.client, c)
|
a2r.Call(msg.MsgClient.GetMaxSeq, m.client, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Message) PullMsgBySeqs(c *gin.Context) {
|
func (m *Message) PullMsgBySeqs(c *gin.Context) {
|
||||||
|
@ -58,14 +58,14 @@ func NewGrpcHandler(validate *validator.Validate, msgRpcClient *rpcclient.MsgCli
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g GrpcHandler) GetSeq(context context.Context, data Req) ([]byte, error) {
|
func (g GrpcHandler) GetSeq(context context.Context, data Req) ([]byte, error) {
|
||||||
req := sdkws.GetMaxAndMinSeqReq{}
|
req := sdkws.GetMaxSeqReq{}
|
||||||
if err := proto.Unmarshal(data.Data, &req); err != nil {
|
if err := proto.Unmarshal(data.Data, &req); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err := g.validate.Struct(&req); err != nil {
|
if err := g.validate.Struct(&req); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
resp, err := g.msgRpcClient.GetMaxAndMinSeq(context, &req)
|
resp, err := g.msgRpcClient.GetMaxSeq(context, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -733,18 +733,17 @@ func (s *groupServer) QuitGroup(ctx context.Context, req *pbGroup.QuitGroupReq)
|
|||||||
|
|
||||||
func (s *groupServer) deleteMemberAndSetConversationSeq(ctx context.Context, groupID string, userIDs []string) error {
|
func (s *groupServer) deleteMemberAndSetConversationSeq(ctx context.Context, groupID string, userIDs []string) error {
|
||||||
conevrsationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
|
conevrsationID := utils.GetConversationIDBySessionType(constant.SuperGroupChatType, groupID)
|
||||||
resp, err := s.msgRpcClient.GetMaxAndMinSeq(ctx, &sdkws.GetMaxAndMinSeqReq{
|
resp, err := s.msgRpcClient.GetMaxSeq(ctx, &sdkws.GetMaxSeqReq{
|
||||||
ConversationIDs: []string{},
|
|
||||||
UserID: mcontext.GetOpUserID(ctx),
|
UserID: mcontext.GetOpUserID(ctx),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
seq, ok := resp.MaxAndMinSeqs[conevrsationID]
|
maxSeq, ok := resp.MaxSeqs[conevrsationID]
|
||||||
if !ok {
|
if !ok {
|
||||||
return errs.ErrInternalServer.Wrap("get max seq error")
|
return errs.ErrInternalServer.Wrap("get max seq error")
|
||||||
}
|
}
|
||||||
return s.conversationRpcClient.DelGroupChatConversations(ctx, userIDs, groupID, seq.MaxSeq)
|
return s.conversationRpcClient.DelGroupChatConversations(ctx, userIDs, groupID, maxSeq)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) {
|
func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInfoReq) (*pbGroup.SetGroupInfoResp, error) {
|
||||||
@ -764,10 +763,6 @@ func (s *groupServer) SetGroupInfo(ctx context.Context, req *pbGroup.SetGroupInf
|
|||||||
if group.Status == constant.GroupStatusDismissed {
|
if group.Status == constant.GroupStatusDismissed {
|
||||||
return nil, utils.Wrap(errs.ErrDismissedAlready, "")
|
return nil, utils.Wrap(errs.ErrDismissedAlready, "")
|
||||||
}
|
}
|
||||||
//userIDs, err := s.GroupDatabase.FindGroupMemberUserID(ctx, group.GroupID)
|
|
||||||
//if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
//}
|
|
||||||
resp := &pbGroup.SetGroupInfoResp{}
|
resp := &pbGroup.SetGroupInfoResp{}
|
||||||
data := UpdateGroupInfoMap(req.GroupInfoForSet)
|
data := UpdateGroupInfoMap(req.GroupInfoForSet)
|
||||||
if len(data) == 0 {
|
if len(data) == 0 {
|
||||||
|
@ -145,7 +145,7 @@ func (m *msgServer) messageVerification(ctx context.Context, data *msg.SendMsgRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
if revokeMessage.RevokerID != revokeMessage.SourceMessageSendID {
|
if revokeMessage.RevokerID != revokeMessage.SourceMessageSendID {
|
||||||
resp, err := m.MsgDatabase.GetSuperGroupMsgBySeqs(ctx, data.MsgData.GroupID, []int64{int64(revokeMessage.Seq)})
|
resp, err := m.MsgDatabase.GetMsgBySeqs(ctx, data.MsgData.GroupID, []int64{int64(revokeMessage.Seq)})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ func (m *msgServer) sendMsgSuperGroupChat(ctx context.Context, req *msg.SendMsgR
|
|||||||
resp.ClientMsgID = req.MsgData.ClientMsgID
|
resp.ClientMsgID = req.MsgData.ClientMsgID
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgServer) sendMsgNotification(ctx context.Context, req *msg.SendMsgReq) (resp *msg.SendMsgResp, err error) {
|
func (m *msgServer) sendMsgNotification(ctx context.Context, req *msg.SendMsgReq) (resp *msg.SendMsgResp, err error) {
|
||||||
err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.RecvID, req.MsgData)
|
err = m.MsgDatabase.MsgToMQ(ctx, req.MsgData.RecvID, req.MsgData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -16,7 +16,6 @@ import (
|
|||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -123,28 +122,12 @@ func (m *msgServer) SendMsg(ctx context.Context, req *msg.SendMsgReq) (resp *msg
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *msgServer) GetMaxAndMinSeq(ctx context.Context, req *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error) {
|
func (m *msgServer) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error) {
|
||||||
if err := tokenverify.CheckAccessV3(ctx, req.UserID); err != nil {
|
if err := tokenverify.CheckAccessV3(ctx, req.UserID); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
resp := new(sdkws.GetMaxSeqResp)
|
||||||
|
|
||||||
m2 := make(map[string]*sdkws.MaxAndMinSeq)
|
|
||||||
resp := new(sdkws.GetMaxAndMinSeqResp)
|
|
||||||
for _, conversationID := range req.ConversationIDs {
|
|
||||||
maxSeq, err := m.MsgDatabase.GetGroupMaxSeq(ctx, conversationID)
|
|
||||||
if err != nil && errs.Unwrap(err) != redis.Nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
minSeq, err := m.MsgDatabase.GetGroupMinSeq(ctx, conversationID)
|
|
||||||
if err != nil && errs.Unwrap(err) != redis.Nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
m2[conversationID] = &sdkws.MaxAndMinSeq{
|
|
||||||
MaxSeq: maxSeq,
|
|
||||||
MinSeq: minSeq,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resp.MaxAndMinSeqs = m2
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,10 +41,9 @@ type MsgDatabase interface {
|
|||||||
DelMsgBySeqs(ctx context.Context, userID string, seqs []int64) (totalUnExistSeqs []int64, err error)
|
DelMsgBySeqs(ctx context.Context, userID string, seqs []int64) (totalUnExistSeqs []int64, err error)
|
||||||
// 获取群ID或者UserID最新一条在mongo里面的消息
|
// 获取群ID或者UserID最新一条在mongo里面的消息
|
||||||
// 通过seqList获取mongo中写扩散消息
|
// 通过seqList获取mongo中写扩散消息
|
||||||
GetMsgBySeqs(ctx context.Context, userID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error)
|
|
||||||
GetMsgBySeqsRange(ctx context.Context, conversationID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error)
|
GetMsgBySeqsRange(ctx context.Context, conversationID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error)
|
||||||
// 通过seqList获取大群在 mongo里面的消息
|
// 通过seqList获取大群在 mongo里面的消息
|
||||||
GetSuperGroupMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error)
|
GetMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (seqMsg []*sdkws.MsgData, err error)
|
||||||
// 删除用户所有消息/redis/mongo然后重置seq
|
// 删除用户所有消息/redis/mongo然后重置seq
|
||||||
CleanUpUserMsg(ctx context.Context, userID string) error
|
CleanUpUserMsg(ctx context.Context, userID string) error
|
||||||
// 删除大群消息重置群成员最小群seq, remainTime为消息保留的时间单位秒,超时消息删除, 传0删除所有消息(此方法不删除 redis cache)
|
// 删除大群消息重置群成员最小群seq, remainTime为消息保留的时间单位秒,超时消息删除, 传0删除所有消息(此方法不删除 redis cache)
|
||||||
@ -450,7 +449,7 @@ func (db *msgDatabase) unmarshalMsg(msgInfo *unRelationTb.MsgInfoModel) (msgPb *
|
|||||||
return msgPb, nil
|
return msgPb, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *msgDatabase) getMsgBySeqs(ctx context.Context, conversationID string, seqs []int64, diffusionType int) (seqMsgs []*sdkws.MsgData, err error) {
|
func (db *msgDatabase) getMsgBySeqs(ctx context.Context, conversationID string, seqs []int64) (seqMsgs []*sdkws.MsgData, err error) {
|
||||||
var hasSeqs []int64
|
var hasSeqs []int64
|
||||||
singleCount := 0
|
singleCount := 0
|
||||||
m := db.msg.GetDocIDSeqsMap(conversationID, seqs)
|
m := db.msg.GetDocIDSeqsMap(conversationID, seqs)
|
||||||
@ -481,27 +480,45 @@ func (db *msgDatabase) getMsgBySeqs(ctx context.Context, conversationID string,
|
|||||||
var diff []int64
|
var diff []int64
|
||||||
var exceptionMsg []*sdkws.MsgData
|
var exceptionMsg []*sdkws.MsgData
|
||||||
diff = utils.Difference(hasSeqs, seqs)
|
diff = utils.Difference(hasSeqs, seqs)
|
||||||
if diffusionType == constant.WriteDiffusion {
|
|
||||||
exceptionMsg = db.msg.GenExceptionMessageBySeqs(diff)
|
|
||||||
} else if diffusionType == constant.ReadDiffusion {
|
|
||||||
exceptionMsg = db.msg.GenExceptionSuperGroupMessageBySeqs(diff, conversationID)
|
exceptionMsg = db.msg.GenExceptionSuperGroupMessageBySeqs(diff, conversationID)
|
||||||
}
|
|
||||||
seqMsgs = append(seqMsgs, exceptionMsg...)
|
seqMsgs = append(seqMsgs, exceptionMsg...)
|
||||||
}
|
}
|
||||||
return seqMsgs, nil
|
return seqMsgs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *msgDatabase) GetMsgBySeqs(ctx context.Context, userID string, seqs []int64) (successMsgs []*sdkws.MsgData, err error) {
|
func (db *msgDatabase) getMsgBySeqsRange(ctx context.Context, conversationID string, seqs []int64, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error) {
|
||||||
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, userID, seqs)
|
m := db.msg.GetDocIDSeqsMap(conversationID, seqs)
|
||||||
|
for {
|
||||||
|
|
||||||
|
if int64(len(seqMsg)) != num {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return seqMsg, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (db *msgDatabase) GetMsgBySeqsRange(ctx context.Context, conversationID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error) {
|
||||||
|
var seqs []int64
|
||||||
|
for i := end; i > end-num; i-- {
|
||||||
|
if i >= begin {
|
||||||
|
seqs = append(seqs, i)
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, conversationID, seqs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != redis.Nil {
|
if err != redis.Nil {
|
||||||
prome.Add(prome.MsgPullFromRedisFailedCounter, len(failedSeqs))
|
prome.Add(prome.MsgPullFromRedisFailedCounter, len(failedSeqs))
|
||||||
log.Error(mcontext.GetOperationID(ctx), "get message from redis exception", err.Error(), failedSeqs)
|
log.ZError(ctx, "get message from redis exception", err, conversationID, seqs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// get from cache or db
|
||||||
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
||||||
if len(failedSeqs) > 0 {
|
if len(failedSeqs) > 0 {
|
||||||
mongoMsgs, err := db.getMsgBySeqs(ctx, userID, seqs, constant.WriteDiffusion)
|
mongoMsgs, err := db.getMsgBySeqsRange(ctx, conversationID, failedSeqs, begin, end, num-int64(len(successMsgs)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
prome.Add(prome.MsgPullFromMongoFailedCounter, len(failedSeqs))
|
prome.Add(prome.MsgPullFromMongoFailedCounter, len(failedSeqs))
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -512,11 +529,7 @@ func (db *msgDatabase) GetMsgBySeqs(ctx context.Context, userID string, seqs []i
|
|||||||
return successMsgs, nil
|
return successMsgs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *msgDatabase) GetMsgBySeqsRange(ctx context.Context, conversationID string, begin, end, num int64) (seqMsg []*sdkws.MsgData, err error) {
|
func (db *msgDatabase) GetMsgBySeqs(ctx context.Context, conversationID string, seqs []int64) (successMsgs []*sdkws.MsgData, err error) {
|
||||||
var seqs []int64
|
|
||||||
for i := begin; i <= end; i++ {
|
|
||||||
seqs = append(seqs, i)
|
|
||||||
}
|
|
||||||
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, conversationID, seqs)
|
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, conversationID, seqs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != redis.Nil {
|
if err != redis.Nil {
|
||||||
@ -526,28 +539,7 @@ func (db *msgDatabase) GetMsgBySeqsRange(ctx context.Context, conversationID str
|
|||||||
}
|
}
|
||||||
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
||||||
if len(failedSeqs) > 0 {
|
if len(failedSeqs) > 0 {
|
||||||
mongoMsgs, err := db.getMsgBySeqs(ctx, conversationID, seqs, constant.ReadDiffusion)
|
mongoMsgs, err := db.getMsgBySeqs(ctx, conversationID, seqs)
|
||||||
if err != nil {
|
|
||||||
prome.Add(prome.MsgPullFromMongoFailedCounter, len(failedSeqs))
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
prome.Add(prome.MsgPullFromMongoSuccessCounter, len(mongoMsgs))
|
|
||||||
successMsgs = append(successMsgs, mongoMsgs...)
|
|
||||||
}
|
|
||||||
return successMsgs, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (db *msgDatabase) GetSuperGroupMsgBySeqs(ctx context.Context, groupID string, seqs []int64) (successMsgs []*sdkws.MsgData, err error) {
|
|
||||||
successMsgs, failedSeqs, err := db.cache.GetMessagesBySeq(ctx, groupID, seqs)
|
|
||||||
if err != nil {
|
|
||||||
if err != redis.Nil {
|
|
||||||
prome.Add(prome.MsgPullFromRedisFailedCounter, len(failedSeqs))
|
|
||||||
log.Error(mcontext.GetOperationID(ctx), "get message from redis exception", err.Error(), failedSeqs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prome.Add(prome.MsgPullFromRedisSuccessCounter, len(successMsgs))
|
|
||||||
if len(failedSeqs) > 0 {
|
|
||||||
mongoMsgs, err := db.getMsgBySeqs(ctx, groupID, seqs, constant.ReadDiffusion)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
prome.Add(prome.MsgPullFromMongoFailedCounter, len(failedSeqs))
|
prome.Add(prome.MsgPullFromMongoFailedCounter, len(failedSeqs))
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -571,7 +563,7 @@ func (db *msgDatabase) DeleteUserSuperGroupMsgsAndSetMinSeq(ctx context.Context,
|
|||||||
var delStruct delMsgRecursionStruct
|
var delStruct delMsgRecursionStruct
|
||||||
minSeq, err := db.deleteMsgRecursion(ctx, groupID, unRelationTb.OldestList, &delStruct, remainTime)
|
minSeq, err := db.deleteMsgRecursion(ctx, groupID, unRelationTb.OldestList, &delStruct, remainTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
//log.NewError(operationID, utils.GetSelfFuncName(), groupID, "deleteMsg failed")
|
log.ZError(ctx, "deleteMsgRecursion failed", err)
|
||||||
}
|
}
|
||||||
if minSeq == 0 {
|
if minSeq == 0 {
|
||||||
return nil
|
return nil
|
||||||
|
@ -17,8 +17,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type MsgDocModel struct {
|
type MsgDocModel struct {
|
||||||
DocID string `bson:"uid"`
|
DocID string `bson:"doc_id"`
|
||||||
Msg []MsgInfoModel `bson:"msg"`
|
Msg []MsgInfoModel `bson:"msgs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MsgInfoModel struct {
|
type MsgInfoModel struct {
|
||||||
@ -31,6 +31,7 @@ type MsgDocModelInterface interface {
|
|||||||
Create(ctx context.Context, model *MsgDocModel) error
|
Create(ctx context.Context, model *MsgDocModel) error
|
||||||
UpdateMsgStatusByIndexInOneDoc(ctx context.Context, docID string, msg *sdkws.MsgData, seqIndex int, status int32) error
|
UpdateMsgStatusByIndexInOneDoc(ctx context.Context, docID string, msg *sdkws.MsgData, seqIndex int, status int32) error
|
||||||
FindOneByDocID(ctx context.Context, docID string) (*MsgDocModel, error)
|
FindOneByDocID(ctx context.Context, docID string) (*MsgDocModel, error)
|
||||||
|
GetMsgBySeqIndexIn1Doc(ctx context.Context, conversationID string, begin, end int64) ([]*sdkws.MsgData, error)
|
||||||
GetNewestMsg(ctx context.Context, conversationID string) (*MsgInfoModel, error)
|
GetNewestMsg(ctx context.Context, conversationID string) (*MsgInfoModel, error)
|
||||||
GetOldestMsg(ctx context.Context, conversationID string) (*MsgInfoModel, error)
|
GetOldestMsg(ctx context.Context, conversationID string) (*MsgInfoModel, error)
|
||||||
Delete(ctx context.Context, docIDs []string) error
|
Delete(ctx context.Context, docIDs []string) error
|
||||||
@ -98,15 +99,15 @@ func (m MsgDocModel) GetDocIDSeqsMap(conversationID string, seqs []int64) map[st
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MsgDocModel) getMsgIndex(seq uint32) int {
|
func (m MsgDocModel) getMsgIndex(seq int64) int64 {
|
||||||
seqSuffix := seq / singleGocMsgNum
|
seqSuffix := seq / singleGocMsgNum
|
||||||
var index uint32
|
var index int64
|
||||||
if seqSuffix == 0 {
|
if seqSuffix == 0 {
|
||||||
index = (seq - seqSuffix*singleGocMsgNum) - 1
|
index = (seq - seqSuffix*singleGocMsgNum) - 1
|
||||||
} else {
|
} else {
|
||||||
index = seq - seqSuffix*singleGocMsgNum
|
index = seq - seqSuffix*singleGocMsgNum
|
||||||
}
|
}
|
||||||
return int(index)
|
return index
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m MsgDocModel) indexGen(conversationID string, seqSuffix int64) string {
|
func (m MsgDocModel) indexGen(conversationID string, seqSuffix int64) string {
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
table "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
table "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/unrelation"
|
||||||
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
||||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
"github.com/OpenIMSDK/Open-IM-Server/pkg/utils"
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
@ -132,3 +133,25 @@ func (m *MsgMongoDriver) UpdateOneDoc(ctx context.Context, msg *table.MsgDocMode
|
|||||||
_, err := m.MsgCollection.UpdateOne(ctx, bson.M{"uid": msg.DocID}, bson.M{"$set": bson.M{"msg": msg.Msg}})
|
_, err := m.MsgCollection.UpdateOne(ctx, bson.M{"uid": msg.DocID}, bson.M{"$set": bson.M{"msg": msg.Msg}})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MsgMongoDriver) GetMsgBySeqIndexIn1Doc(ctx context.Context, docID string, begin, end int64) ([]*sdkws.MsgData, error) {
|
||||||
|
// uid = getSeqUid(uid, seq)
|
||||||
|
// seqIndex := getMsgIndex(seq)
|
||||||
|
// m.msg.GetSeqDocIDList()
|
||||||
|
result, err := m.MsgCollection.Find(ctx, bson.M{"doc_id": docID, "msg": bson.M{"$slice": []int{seqIndex, 1}}})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var msgInfos []table.MsgInfoModel
|
||||||
|
if err := result.Decode(&msgInfos); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if len(msgInfos) < 1 {
|
||||||
|
return nil, errs.ErrRecordNotFound.Wrap("mongo GetMsgBySeqIndex failed, len is 0")
|
||||||
|
}
|
||||||
|
var msg sdkws.MsgData
|
||||||
|
if err := proto.Unmarshal(msgInfos[0].Msg, &msg); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return msg, nil
|
||||||
|
}
|
||||||
|
@ -2507,92 +2507,91 @@ var file_msg_msg_proto_rawDesc = []byte{
|
|||||||
0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x71, 0x73, 0x18,
|
0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x71, 0x73, 0x18,
|
||||||
0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x04, 0x73, 0x65, 0x71, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x44,
|
0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x04, 0x73, 0x65, 0x71, 0x73, 0x22, 0x0d, 0x0a, 0x0b, 0x44,
|
||||||
0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0x8b, 0x0a, 0x0a, 0x03, 0x6d,
|
0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0xf9, 0x09, 0x0a, 0x03, 0x6d,
|
||||||
0x73, 0x67, 0x12, 0x62, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x41, 0x6e, 0x64, 0x4d,
|
0x73, 0x67, 0x12, 0x50, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x71, 0x12,
|
||||||
0x69, 0x6e, 0x53, 0x65, 0x71, 0x12, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
|
0x20, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73,
|
||||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61,
|
0x64, 0x6b, 0x77, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x71, 0x52, 0x65,
|
||||||
0x78, 0x41, 0x6e, 0x64, 0x4d, 0x69, 0x6e, 0x53, 0x65, 0x71, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e,
|
0x71, 0x1a, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||||
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b,
|
0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x71,
|
||||||
0x77, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x41, 0x6e, 0x64, 0x4d, 0x69, 0x6e, 0x53,
|
0x52, 0x65, 0x73, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73,
|
||||||
0x65, 0x71, 0x52, 0x65, 0x73, 0x70, 0x12, 0x68, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x65,
|
0x61, 0x67, 0x65, 0x42, 0x79, 0x53, 0x65, 0x71, 0x73, 0x12, 0x28, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
|
||||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x53, 0x65, 0x71, 0x73, 0x12, 0x28, 0x2e, 0x4f, 0x70,
|
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x50,
|
||||||
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73,
|
0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x53, 0x65, 0x71, 0x73,
|
||||||
0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x53, 0x65,
|
0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
|
||||||
0x71, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x29, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
|
0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73,
|
||||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d,
|
0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x53, 0x65, 0x71, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46,
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x79, 0x53, 0x65, 0x71, 0x73, 0x52, 0x65, 0x73, 0x70,
|
0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
|
||||||
0x12, 0x46, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x2e, 0x4f, 0x70,
|
|
||||||
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53,
|
|
||||||
0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
|
|
||||||
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x6e,
|
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x6e,
|
||||||
0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x4d,
|
0x64, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
|
||||||
0x73, 0x67, 0x73, 0x12, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
|
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x4d,
|
||||||
0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65,
|
0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x07, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67,
|
||||||
0x71, 0x1a, 0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
0x73, 0x12, 0x1c, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||||
0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70,
|
0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a,
|
||||||
0x12, 0x61, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,
|
|
||||||
0x70, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72,
|
|
||||||
0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72,
|
|
||||||
0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70,
|
|
||||||
0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44,
|
|
||||||
0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52,
|
|
||||||
0x65, 0x73, 0x70, 0x12, 0x49, 0x0a, 0x08, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x12,
|
|
||||||
0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d,
|
0x1d, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d,
|
||||||
0x73, 0x67, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1e,
|
0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x4d, 0x73, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x61,
|
||||||
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73,
|
0x0a, 0x10, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d,
|
||||||
0x67, 0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x61,
|
0x73, 0x67, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
|
||||||
0x0a, 0x10, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74,
|
0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72,
|
||||||
0x75, 0x73, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
|
0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
|
||||||
0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67,
|
|
||||||
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
|
|
||||||
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74,
|
|
||||||
0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73,
|
|
||||||
0x70, 0x12, 0x61, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53,
|
|
||||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
|
|
||||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64,
|
|
||||||
0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f,
|
|
||||||
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e,
|
|
||||||
0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
|
||||||
0x52, 0x65, 0x73, 0x70, 0x12, 0x85, 0x01, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
|
||||||
0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e,
|
|
||||||
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65,
|
|
||||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73,
|
|
||||||
0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e,
|
|
||||||
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
|
|
||||||
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x4d,
|
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78,
|
|
||||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x88, 0x01, 0x0a,
|
|
||||||
0x1d, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63,
|
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32,
|
|
||||||
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73,
|
|
||||||
0x67, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61,
|
|
||||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
|
|
||||||
0x65, 0x71, 0x1a, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65,
|
|
||||||
0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
|
||||||
0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
|
|
||||||
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x8b, 0x01, 0x0a, 0x1c, 0x41, 0x64, 0x64, 0x4d,
|
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78,
|
|
||||||
0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x34, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49,
|
|
||||||
0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x69,
|
|
||||||
0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
|
||||||
0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x35,
|
|
||||||
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73,
|
|
||||||
0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52,
|
|
||||||
0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
|
||||||
0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x90, 0x01, 0x0a, 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
|
|
||||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45,
|
|
||||||
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x4f, 0x70, 0x65, 0x6e,
|
|
||||||
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c,
|
0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c,
|
||||||
0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74,
|
0x53, 0x75, 0x70, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x12, 0x49, 0x0a, 0x08, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x1d, 0x2e,
|
||||||
|
0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67,
|
||||||
|
0x2e, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x4f,
|
||||||
|
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e,
|
||||||
|
0x43, 0x6c, 0x65, 0x61, 0x72, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x12, 0x61, 0x0a, 0x10,
|
||||||
|
0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
||||||
|
0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||||
|
0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74,
|
||||||
|
0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x65,
|
||||||
|
0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12,
|
||||||
|
0x61, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61,
|
||||||
|
0x74, 0x75, 0x73, 0x12, 0x25, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
|
||||||
|
0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73,
|
||||||
|
0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x26, 0x2e, 0x4f, 0x70, 0x65,
|
||||||
|
0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65,
|
||||||
|
0x74, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x73, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65,
|
||||||
|
0x73, 0x70, 0x12, 0x85, 0x01, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
|
0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
|
||||||
|
0x6f, 0x6e, 0x73, 0x12, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76,
|
||||||
|
0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
|
0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
|
||||||
|
0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x32, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
|
||||||
|
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x73,
|
||||||
|
0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65,
|
||||||
|
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x88, 0x01, 0x0a, 0x1d, 0x47,
|
||||||
|
0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69,
|
||||||
|
0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x2e, 0x4f,
|
||||||
|
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e,
|
||||||
|
0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74,
|
||||||
0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71,
|
0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71,
|
||||||
0x1a, 0x36, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
0x1a, 0x33, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||||
0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
0x6d, 0x73, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52,
|
||||||
0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
|
0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68,
|
0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x8b, 0x01, 0x0a, 0x1c, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x73,
|
||||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b,
|
0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65,
|
||||||
0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f,
|
0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x34, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53,
|
||||||
0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x73, 0x67, 0x62, 0x06, 0x70,
|
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45,
|
||||||
|
0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x35, 0x2e, 0x4f,
|
||||||
|
0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e,
|
||||||
|
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61,
|
||||||
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
|
||||||
|
0x65, 0x73, 0x70, 0x12, 0x90, 0x01, 0x0a, 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65,
|
||||||
|
0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74,
|
||||||
|
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d,
|
||||||
|
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73, 0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
|
||||||
|
0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x36,
|
||||||
|
0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x6d, 0x73,
|
||||||
|
0x67, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
|
||||||
|
0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
|
||||||
|
0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||||
|
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x4f, 0x70, 0x65, 0x6e, 0x49, 0x4d, 0x53, 0x44, 0x4b, 0x2f, 0x4f,
|
||||||
|
0x70, 0x65, 0x6e, 0x2d, 0x49, 0x4d, 0x2d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x6b,
|
||||||
|
0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6d, 0x73, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -2654,9 +2653,9 @@ var file_msg_msg_proto_goTypes = []interface{}{
|
|||||||
(*sdkws.MsgData)(nil), // 42: OpenIMServer.sdkws.MsgData
|
(*sdkws.MsgData)(nil), // 42: OpenIMServer.sdkws.MsgData
|
||||||
(*wrapperspb.StringValue)(nil), // 43: OpenIMServer.protobuf.StringValue
|
(*wrapperspb.StringValue)(nil), // 43: OpenIMServer.protobuf.StringValue
|
||||||
(*sdkws.KeyValue)(nil), // 44: OpenIMServer.sdkws.KeyValue
|
(*sdkws.KeyValue)(nil), // 44: OpenIMServer.sdkws.KeyValue
|
||||||
(*sdkws.GetMaxAndMinSeqReq)(nil), // 45: OpenIMServer.sdkws.GetMaxAndMinSeqReq
|
(*sdkws.GetMaxSeqReq)(nil), // 45: OpenIMServer.sdkws.GetMaxSeqReq
|
||||||
(*sdkws.PullMessageBySeqsReq)(nil), // 46: OpenIMServer.sdkws.PullMessageBySeqsReq
|
(*sdkws.PullMessageBySeqsReq)(nil), // 46: OpenIMServer.sdkws.PullMessageBySeqsReq
|
||||||
(*sdkws.GetMaxAndMinSeqResp)(nil), // 47: OpenIMServer.sdkws.GetMaxAndMinSeqResp
|
(*sdkws.GetMaxSeqResp)(nil), // 47: OpenIMServer.sdkws.GetMaxSeqResp
|
||||||
(*sdkws.PullMessageBySeqsResp)(nil), // 48: OpenIMServer.sdkws.PullMessageBySeqsResp
|
(*sdkws.PullMessageBySeqsResp)(nil), // 48: OpenIMServer.sdkws.PullMessageBySeqsResp
|
||||||
}
|
}
|
||||||
var file_msg_msg_proto_depIdxs = []int32{
|
var file_msg_msg_proto_depIdxs = []int32{
|
||||||
@ -2689,7 +2688,7 @@ var file_msg_msg_proto_depIdxs = []int32{
|
|||||||
44, // 26: OpenIMServer.msg.SetMessageReactionExtensionsReq.ReactionExtensionsEntry.value:type_name -> OpenIMServer.sdkws.KeyValue
|
44, // 26: OpenIMServer.msg.SetMessageReactionExtensionsReq.ReactionExtensionsEntry.value:type_name -> OpenIMServer.sdkws.KeyValue
|
||||||
44, // 27: OpenIMServer.msg.SingleMessageExtensionResult.ReactionExtensionsEntry.value:type_name -> OpenIMServer.sdkws.KeyValue
|
44, // 27: OpenIMServer.msg.SingleMessageExtensionResult.ReactionExtensionsEntry.value:type_name -> OpenIMServer.sdkws.KeyValue
|
||||||
33, // 28: OpenIMServer.msg.ExtendMsg.ReactionExtensionsEntry.value:type_name -> OpenIMServer.msg.KeyValueResp
|
33, // 28: OpenIMServer.msg.ExtendMsg.ReactionExtensionsEntry.value:type_name -> OpenIMServer.msg.KeyValueResp
|
||||||
45, // 29: OpenIMServer.msg.msg.GetMaxAndMinSeq:input_type -> OpenIMServer.sdkws.GetMaxAndMinSeqReq
|
45, // 29: OpenIMServer.msg.msg.GetMaxSeq:input_type -> OpenIMServer.sdkws.GetMaxSeqReq
|
||||||
46, // 30: OpenIMServer.msg.msg.PullMessageBySeqs:input_type -> OpenIMServer.sdkws.PullMessageBySeqsReq
|
46, // 30: OpenIMServer.msg.msg.PullMessageBySeqs:input_type -> OpenIMServer.sdkws.PullMessageBySeqsReq
|
||||||
6, // 31: OpenIMServer.msg.msg.SendMsg:input_type -> OpenIMServer.msg.SendMsgReq
|
6, // 31: OpenIMServer.msg.msg.SendMsg:input_type -> OpenIMServer.msg.SendMsgReq
|
||||||
35, // 32: OpenIMServer.msg.msg.DelMsgs:input_type -> OpenIMServer.msg.DelMsgsReq
|
35, // 32: OpenIMServer.msg.msg.DelMsgs:input_type -> OpenIMServer.msg.DelMsgsReq
|
||||||
@ -2701,7 +2700,7 @@ var file_msg_msg_proto_depIdxs = []int32{
|
|||||||
25, // 38: OpenIMServer.msg.msg.GetMessagesReactionExtensions:input_type -> OpenIMServer.msg.GetMessagesReactionExtensionsReq
|
25, // 38: OpenIMServer.msg.msg.GetMessagesReactionExtensions:input_type -> OpenIMServer.msg.GetMessagesReactionExtensionsReq
|
||||||
22, // 39: OpenIMServer.msg.msg.AddMessageReactionExtensions:input_type -> OpenIMServer.msg.ModifyMessageReactionExtensionsReq
|
22, // 39: OpenIMServer.msg.msg.AddMessageReactionExtensions:input_type -> OpenIMServer.msg.ModifyMessageReactionExtensionsReq
|
||||||
29, // 40: OpenIMServer.msg.msg.DeleteMessageReactionExtensions:input_type -> OpenIMServer.msg.DeleteMessagesReactionExtensionsReq
|
29, // 40: OpenIMServer.msg.msg.DeleteMessageReactionExtensions:input_type -> OpenIMServer.msg.DeleteMessagesReactionExtensionsReq
|
||||||
47, // 41: OpenIMServer.msg.msg.GetMaxAndMinSeq:output_type -> OpenIMServer.sdkws.GetMaxAndMinSeqResp
|
47, // 41: OpenIMServer.msg.msg.GetMaxSeq:output_type -> OpenIMServer.sdkws.GetMaxSeqResp
|
||||||
48, // 42: OpenIMServer.msg.msg.PullMessageBySeqs:output_type -> OpenIMServer.sdkws.PullMessageBySeqsResp
|
48, // 42: OpenIMServer.msg.msg.PullMessageBySeqs:output_type -> OpenIMServer.sdkws.PullMessageBySeqsResp
|
||||||
7, // 43: OpenIMServer.msg.msg.SendMsg:output_type -> OpenIMServer.msg.SendMsgResp
|
7, // 43: OpenIMServer.msg.msg.SendMsg:output_type -> OpenIMServer.msg.SendMsgResp
|
||||||
36, // 44: OpenIMServer.msg.msg.DelMsgs:output_type -> OpenIMServer.msg.DelMsgsResp
|
36, // 44: OpenIMServer.msg.msg.DelMsgs:output_type -> OpenIMServer.msg.DelMsgsResp
|
||||||
@ -3216,7 +3215,7 @@ const _ = grpc.SupportPackageIsVersion6
|
|||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||||
type MsgClient interface {
|
type MsgClient interface {
|
||||||
// 获取最小最大seq(包括用户的,以及指定群组的)
|
// 获取最小最大seq(包括用户的,以及指定群组的)
|
||||||
GetMaxAndMinSeq(ctx context.Context, in *sdkws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxAndMinSeqResp, error)
|
GetMaxSeq(ctx context.Context, in *sdkws.GetMaxSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxSeqResp, error)
|
||||||
// 拉取历史消息(包括用户的,以及指定群组的)
|
// 拉取历史消息(包括用户的,以及指定群组的)
|
||||||
PullMessageBySeqs(ctx context.Context, in *sdkws.PullMessageBySeqsReq, opts ...grpc.CallOption) (*sdkws.PullMessageBySeqsResp, error)
|
PullMessageBySeqs(ctx context.Context, in *sdkws.PullMessageBySeqsReq, opts ...grpc.CallOption) (*sdkws.PullMessageBySeqsResp, error)
|
||||||
// 发送消息
|
// 发送消息
|
||||||
@ -3246,9 +3245,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
|
|||||||
return &msgClient{cc}
|
return &msgClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *msgClient) GetMaxAndMinSeq(ctx context.Context, in *sdkws.GetMaxAndMinSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxAndMinSeqResp, error) {
|
func (c *msgClient) GetMaxSeq(ctx context.Context, in *sdkws.GetMaxSeqReq, opts ...grpc.CallOption) (*sdkws.GetMaxSeqResp, error) {
|
||||||
out := new(sdkws.GetMaxAndMinSeqResp)
|
out := new(sdkws.GetMaxSeqResp)
|
||||||
err := c.cc.Invoke(ctx, "/OpenIMServer.msg.msg/GetMaxAndMinSeq", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/OpenIMServer.msg.msg/GetMaxSeq", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -3357,7 +3356,7 @@ func (c *msgClient) DeleteMessageReactionExtensions(ctx context.Context, in *Del
|
|||||||
// MsgServer is the server API for Msg service.
|
// MsgServer is the server API for Msg service.
|
||||||
type MsgServer interface {
|
type MsgServer interface {
|
||||||
// 获取最小最大seq(包括用户的,以及指定群组的)
|
// 获取最小最大seq(包括用户的,以及指定群组的)
|
||||||
GetMaxAndMinSeq(context.Context, *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error)
|
GetMaxSeq(context.Context, *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error)
|
||||||
// 拉取历史消息(包括用户的,以及指定群组的)
|
// 拉取历史消息(包括用户的,以及指定群组的)
|
||||||
PullMessageBySeqs(context.Context, *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error)
|
PullMessageBySeqs(context.Context, *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error)
|
||||||
// 发送消息
|
// 发送消息
|
||||||
@ -3383,8 +3382,8 @@ type MsgServer interface {
|
|||||||
type UnimplementedMsgServer struct {
|
type UnimplementedMsgServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*UnimplementedMsgServer) GetMaxAndMinSeq(context.Context, *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error) {
|
func (*UnimplementedMsgServer) GetMaxSeq(context.Context, *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetMaxAndMinSeq not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetMaxSeq not implemented")
|
||||||
}
|
}
|
||||||
func (*UnimplementedMsgServer) PullMessageBySeqs(context.Context, *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) {
|
func (*UnimplementedMsgServer) PullMessageBySeqs(context.Context, *sdkws.PullMessageBySeqsReq) (*sdkws.PullMessageBySeqsResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method PullMessageBySeqs not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method PullMessageBySeqs not implemented")
|
||||||
@ -3424,20 +3423,20 @@ func RegisterMsgServer(s *grpc.Server, srv MsgServer) {
|
|||||||
s.RegisterService(&_Msg_serviceDesc, srv)
|
s.RegisterService(&_Msg_serviceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Msg_GetMaxAndMinSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Msg_GetMaxSeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(sdkws.GetMaxAndMinSeqReq)
|
in := new(sdkws.GetMaxSeqReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(MsgServer).GetMaxAndMinSeq(ctx, in)
|
return srv.(MsgServer).GetMaxSeq(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/OpenIMServer.msg.msg/GetMaxAndMinSeq",
|
FullMethod: "/OpenIMServer.msg.msg/GetMaxSeq",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(MsgServer).GetMaxAndMinSeq(ctx, req.(*sdkws.GetMaxAndMinSeqReq))
|
return srv.(MsgServer).GetMaxSeq(ctx, req.(*sdkws.GetMaxSeqReq))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -3645,8 +3644,8 @@ var _Msg_serviceDesc = grpc.ServiceDesc{
|
|||||||
HandlerType: (*MsgServer)(nil),
|
HandlerType: (*MsgServer)(nil),
|
||||||
Methods: []grpc.MethodDesc{
|
Methods: []grpc.MethodDesc{
|
||||||
{
|
{
|
||||||
MethodName: "GetMaxAndMinSeq",
|
MethodName: "GetMaxSeq",
|
||||||
Handler: _Msg_GetMaxAndMinSeq_Handler,
|
Handler: _Msg_GetMaxSeq_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "PullMessageBySeqs",
|
MethodName: "PullMessageBySeqs",
|
||||||
|
@ -201,7 +201,7 @@ message DelMsgsResp{
|
|||||||
|
|
||||||
service msg {
|
service msg {
|
||||||
//获取最小最大seq(包括用户的,以及指定群组的)
|
//获取最小最大seq(包括用户的,以及指定群组的)
|
||||||
rpc GetMaxAndMinSeq(sdkws.GetMaxAndMinSeqReq) returns(sdkws.GetMaxAndMinSeqResp);
|
rpc GetMaxSeq(sdkws.GetMaxSeqReq) returns(sdkws.GetMaxSeqResp);
|
||||||
//拉取历史消息(包括用户的,以及指定群组的)
|
//拉取历史消息(包括用户的,以及指定群组的)
|
||||||
rpc PullMessageBySeqs(sdkws.PullMessageBySeqsReq) returns(sdkws.PullMessageBySeqsResp);
|
rpc PullMessageBySeqs(sdkws.PullMessageBySeqsReq) returns(sdkws.PullMessageBySeqsResp);
|
||||||
//发送消息
|
//发送消息
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -130,8 +130,7 @@ message SeqRange {
|
|||||||
string conversationID = 1;
|
string conversationID = 1;
|
||||||
int64 begin = 2;
|
int64 begin = 2;
|
||||||
int64 end = 3;
|
int64 end = 3;
|
||||||
bool isNotification = 4;
|
int64 num = 4;
|
||||||
int64 num = 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -145,16 +144,12 @@ message PullMessageBySeqsResp {
|
|||||||
repeated PullMsgs msgs = 1;
|
repeated PullMsgs msgs = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetMaxAndMinSeqReq {
|
message GetMaxSeqReq {
|
||||||
repeated string conversationIDs = 1;
|
string userID = 1;
|
||||||
string userID = 2;
|
|
||||||
}
|
}
|
||||||
message MaxAndMinSeq{
|
|
||||||
int64 maxSeq = 1;
|
message GetMaxSeqResp {
|
||||||
int64 minSeq = 2;
|
map<string, int64> maxSeqs = 1;
|
||||||
}
|
|
||||||
message GetMaxAndMinSeqResp {
|
|
||||||
map<string, MaxAndMinSeq> MaxAndMinSeqs = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message UserSendMsgResp {
|
message UserSendMsgResp {
|
||||||
|
@ -116,12 +116,12 @@ func (m *MsgClient) SendMsg(ctx context.Context, req *msg.SendMsgReq) (*msg.Send
|
|||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MsgClient) GetMaxAndMinSeq(ctx context.Context, req *sdkws.GetMaxAndMinSeqReq) (*sdkws.GetMaxAndMinSeqResp, error) {
|
func (m *MsgClient) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sdkws.GetMaxSeqResp, error) {
|
||||||
cc, err := m.getConn()
|
cc, err := m.getConn()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
resp, err := msg.NewMsgClient(cc).GetMaxAndMinSeq(ctx, req)
|
resp, err := msg.NewMsgClient(cc).GetMaxSeq(ctx, req)
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user