diff --git a/src/common/db/mongoModel.go b/src/common/db/mongoModel.go index d7bcd45e6..5742042bf 100644 --- a/src/common/db/mongoModel.go +++ b/src/common/db/mongoModel.go @@ -5,7 +5,6 @@ import ( "Open_IM/src/common/constant" "Open_IM/src/common/log" pbMsg "Open_IM/src/proto/chat" - "Open_IM/src/utils" "errors" "github.com/golang/protobuf/proto" "gopkg.in/mgo.v2/bson" @@ -125,7 +124,7 @@ func (d *DataBases) GetMsgBySeqList(uid string, seqList []int64) (SingleMsg []*p log.NewError("", "not find seqUid", seqUid, value, uid, seqList) return nil, nil, MaxSeq, MinSeq, err } - if utils.IsContainInt64(pChat.RecvSeq, value) { + if isContainInt64(pChat.RecvSeq, value) { temp.SendID = pChat.SendID temp.RecvID = pChat.RecvID temp.MsgFrom = pChat.MsgFrom @@ -319,3 +318,14 @@ func getSeqUid(uid string, seq int64) string { seqSuffix := seq / singleGocMsgNum return uid + ":" + strconv.FormatInt(seqSuffix, 10) } +func isContainInt64(target int64, List []int64) bool { + + for _, element := range List { + + if target == element { + return true + } + } + return false + +} diff --git a/src/utils/strings.go b/src/utils/strings.go index 69141a6df..39c797859 100644 --- a/src/utils/strings.go +++ b/src/utils/strings.go @@ -37,17 +37,7 @@ func IsContain(target string, List []string) bool { return false } -func IsContainInt64(target int64, List []int64) bool { - for _, element := range List { - - if target == element { - return true - } - } - return false - -} func InterfaceArrayToStringArray(data []interface{}) (i []string) { for _, param := range data { i = append(i, param.(string))