diff --git a/domain/model/group_m/groupInfo.go b/domain/model/group_m/groupInfo.go index fe9b6f0f55f9876e92f234092335531efa051c44..3a0fb19f412cb00898b34ef6315168570dc82ace 100644 --- a/domain/model/group_m/groupInfo.go +++ b/domain/model/group_m/groupInfo.go @@ -68,6 +68,10 @@ func CreateGroup(model *domain.Model, groupInfo *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) { rows := make([]GroupInfo, 0) err := model.Db.Where(&GroupInfo{Owner: ownerId}).Find(&rows).Error diff --git a/domain/service/group_s/group_op.go b/domain/service/group_s/group_op.go index f9906a2c960adbd581746926213bad22f0768c8c..0a2e180be7699d43f65c8cf7f4053ed2b6708fbc 100644 --- a/domain/service/group_s/group_op.go +++ b/domain/service/group_s/group_op.go @@ -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 { return err } + // 新房间标记成trtc房间 + if err := group_m.CreateGroupTRTC(model, g); err != nil { + return err + } return nil }) }