This commit is contained in:
wangchuxiao
2023-02-10 19:45:24 +08:00
parent 00e43cc955
commit 85ebf24325
3 changed files with 78 additions and 37 deletions
+25 -1
View File
@@ -1,6 +1,10 @@
package unrelation
import "strconv"
import (
"Open_IM/pkg/common/constant"
"Open_IM/pkg/proto/sdkws"
"strconv"
)
const (
singleGocMsgNum = 5000
@@ -77,3 +81,23 @@ func (UserMsgDocModel) getMsgIndex(seq uint32) int {
func (UserMsgDocModel) indexGen(uid string, seqSuffix uint32) string {
return uid + ":" + strconv.FormatInt(int64(seqSuffix), 10)
}
func (UserMsgDocModel) genExceptionMessageBySeqList(seqList []uint32) (exceptionMsg []*sdkws.MsgData) {
for _, v := range seqList {
msg := new(sdkws.MsgData)
msg.Seq = v
exceptionMsg = append(exceptionMsg, msg)
}
return exceptionMsg
}
func (UserMsgDocModel) genExceptionSuperGroupMessageBySeqList(seqList []uint32, groupID string) (exceptionMsg []*sdkws.MsgData) {
for _, v := range seqList {
msg := new(sdkws.MsgData)
msg.Seq = v
msg.GroupID = groupID
msg.SessionType = constant.SuperGroupChatType
exceptionMsg = append(exceptionMsg, msg)
}
return exceptionMsg
}