From c4d0836ae3baaae8ff97e4d347b77755f8399d05 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Mon, 24 Apr 2023 14:39:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=9A=84=E6=96=B0=E6=88=BF?= =?UTF-8?q?=E5=B0=B1=E9=83=BD=E6=A0=87=E8=AE=B0=E6=88=90trtc=E6=88=BF?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/model/group_m/groupInfo.go | 4 ++++ domain/service/group_s/group_op.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/domain/model/group_m/groupInfo.go b/domain/model/group_m/groupInfo.go index fe9b6f0..3a0fb19 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 f9906a2..0a2e180 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 }) } -- 2.22.0