heihei
This commit is contained in:
@@ -133,6 +133,16 @@ func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName strin
|
||||
db = dao.GetDB()
|
||||
groupID int
|
||||
)
|
||||
for {
|
||||
groupID = jxutils.GenRand6()
|
||||
temp := &model.MessageGroup{
|
||||
GroupID: groupID,
|
||||
}
|
||||
dao.GetEntity(db, temp, "GroupID")
|
||||
if temp.UserID == "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
if userID2 != "" {
|
||||
messageGroups, err := dao.GetMessageGroups(db, userID, 0, model.GroupTypeSingle, true, userID2)
|
||||
if len(messageGroups) > 0 && len(messageGroups[0].MessageGroupMembers) > 0 {
|
||||
@@ -145,16 +155,6 @@ func CreateMessageGroup(ctx *jxcontext.Context, userID, userID2, groupName strin
|
||||
if user == nil {
|
||||
return nil, fmt.Errorf("无法找到要联系的用户!")
|
||||
}
|
||||
for {
|
||||
groupID = jxutils.GenRand6()
|
||||
temp := &model.MessageGroup{
|
||||
GroupID: groupID,
|
||||
}
|
||||
dao.GetEntity(db, temp, "GroupID")
|
||||
if temp.UserID == "" {
|
||||
break
|
||||
}
|
||||
}
|
||||
messageGroup := &model.MessageGroup{
|
||||
GroupID: groupID,
|
||||
UserID: userID,
|
||||
|
||||
Reference in New Issue
Block a user