|
|
|
@ -78,9 +78,10 @@ func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupR
|
|
|
|
|
//Time stamp + MD5 to generate group chat id
|
|
|
|
|
groupId := utils.Md5(strconv.FormatInt(time.Now().UnixNano(), 10))
|
|
|
|
|
//to group
|
|
|
|
|
groupInfo := db.Group{GroupID: groupId}
|
|
|
|
|
groupInfo := db.Group{}
|
|
|
|
|
utils.CopyStructFields(&groupInfo, req.GroupInfo)
|
|
|
|
|
groupInfo.CreatorUserID = req.OpUserID
|
|
|
|
|
groupInfo.GroupID = groupId
|
|
|
|
|
err := imdb.InsertIntoGroup(groupInfo)
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.NewError(req.OperationID, "InsertIntoGroup failed, ", err.Error(), groupInfo)
|
|
|
|
|