|
|
|
@ -32,13 +32,14 @@ func InsertIntoGroup(groupInfo db.Group) error {
|
|
|
|
|
groupInfo.GroupName = "Group Chat"
|
|
|
|
|
}
|
|
|
|
|
groupInfo.CreateTime = time.Now()
|
|
|
|
|
if groupInfo.NotificationUpdateTime.Unix() < 0 {
|
|
|
|
|
groupInfo.NotificationUpdateTime = utils.UnixSecondToTime(0)
|
|
|
|
|
}
|
|
|
|
|
err = dbConn.Table("groups").Create(groupInfo).Error
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if groupInfo.NotificationUpdateTime.Unix() < 0 {
|
|
|
|
|
groupInfo.NotificationUpdateTime = time.Now()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|