Commit c4d0836a authored by chenweijian's avatar chenweijian

创建的新房就都标记成trtc房间

parent 8dcec28d
...@@ -68,6 +68,10 @@ func CreateGroup(model *domain.Model, groupInfo *GroupInfo) error { ...@@ -68,6 +68,10 @@ func CreateGroup(model *domain.Model, groupInfo *GroupInfo) error {
return model.Db.Create(groupInfo).Error return model.Db.Create(groupInfo).Error
} }
func CreateGroupTRTC(model *domain.Model, groupInfo *GroupInfo) error {
return model.DB().Exec("INSERT INTO hilo.group_trtc (im_group_id) VALUES(?);", groupInfo.ImGroupId).Error
}
func FindGroupByOwner(model *domain.Model, ownerId uint64) ([]GroupInfo, error) { func FindGroupByOwner(model *domain.Model, ownerId uint64) ([]GroupInfo, error) {
rows := make([]GroupInfo, 0) rows := make([]GroupInfo, 0)
err := model.Db.Where(&GroupInfo{Owner: ownerId}).Find(&rows).Error err := model.Db.Where(&GroupInfo{Owner: ownerId}).Find(&rows).Error
......
...@@ -42,6 +42,10 @@ func (s *GroupService) CreateGroup(userId uint64, g *group_m.GroupInfo) error { ...@@ -42,6 +42,10 @@ func (s *GroupService) CreateGroup(userId uint64, g *group_m.GroupInfo) error {
if err := group_m.CreateGroupRole(model, g.ImGroupId, userId, group_e.GROUP_OWNER); err != nil { if err := group_m.CreateGroupRole(model, g.ImGroupId, userId, group_e.GROUP_OWNER); err != nil {
return err return err
} }
// 新房间标记成trtc房间
if err := group_m.CreateGroupTRTC(model, g); err != nil {
return err
}
return nil return nil
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment