Commit 540a8c2b authored by chenweijian's avatar chenweijian

trtc

parent 2b288475
...@@ -566,3 +566,12 @@ func GetFamilyRooms(model *domain.Model, familyId uint64, pageSize, pageIndex in ...@@ -566,3 +566,12 @@ func GetFamilyRooms(model *domain.Model, familyId uint64, pageSize, pageIndex in
return res, nextIdx, hasNext, nil return res, nextIdx, hasNext, nil
} }
func IsUseTRTC(model *domain.Model, imGroupId string) bool {
var count int64
if err := model.DB().Table("group_trtc").Where("im_group_id=?", imGroupId).Count(&count).Error; err != nil {
model.Log.Errorf("IsUseTRTC err:%v, groupId:%s", err, imGroupId)
return false
}
return count > 0
}
-CREATE TABLE `group_trtc` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`im_group_id` char(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `im_group_id` (`im_group_id`),
KEY `created_time` (`created_time`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='使用trtc的群组';
\ No newline at end of file
...@@ -1752,8 +1752,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -1752,8 +1752,7 @@ func GroupIn(c *gin.Context) (*mycontext.MyContext, error) {
model.Log.Infof("GroupIn ip userId:%v,imGroupId:%v,ip:%v,imei:%v", userId, groupId, ip, imei) model.Log.Infof("GroupIn ip userId:%v,imGroupId:%v,ip:%v,imei:%v", userId, groupId, ip, imei)
provider := group_e.GroupProvider_SW provider := group_e.GroupProvider_SW
roomImGroupIdMap := map[string]bool{"@TGS#3TMXOFJHC": true, "@TGS#3I57DMRIB": true} if group_m.IsUseTRTC(model, groupId) {
if _, ok := roomImGroupIdMap[gi.ImGroupId]; ok {
provider = group_e.GroupProvider_TRTC provider = group_e.GroupProvider_TRTC
} }
......
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