|
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.microsvc.toolkit.middleware.live.impl.TencentCloudLivePlugin;
|
|
|
+import com.microsvc.toolkit.middleware.live.message.LiveRoomConfig;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.ImLiveBroadcastRoomDao;
|
|
@@ -92,6 +94,8 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
private ImLiveRoomReservationService imLiveRoomReservationService;
|
|
|
@Autowired
|
|
|
private ImLiveRoomBlackService imLiveRoomBlackService;
|
|
|
+ @Autowired
|
|
|
+ private TencentCloudLivePlugin tencentCloudLivePlugin;
|
|
|
|
|
|
//待替换的变量
|
|
|
public static final String USER_ID = "${userId}";
|
|
@@ -130,6 +134,7 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
SysUser sysUser = Optional.ofNullable(userId)
|
|
|
.map(this::getSysUser)
|
|
|
.orElseGet(this::getSysUser);
|
|
|
+ // 默认学生端查询
|
|
|
osType = Optional.ofNullable(osType).orElse(1);
|
|
|
if (osType == 1) {
|
|
|
//学生端
|
|
@@ -200,7 +205,21 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
if (count > 0) {
|
|
|
room.setBlacklistFlag(1);
|
|
|
}
|
|
|
- return room;
|
|
|
+
|
|
|
+ // 直播房间配置信息
|
|
|
+ String userSig = "";
|
|
|
+ try {
|
|
|
+ userSig = tencentCloudLivePlugin.register(String.valueOf(sysUser.getId()), sysUser.getUsername(),
|
|
|
+ sysUser.getAvatar());
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("直播房间用户注册失败: userId={}", sysUser.getId(), e);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 直播间配置信息
|
|
|
+ LiveRoomConfig liveRoomConfig = tencentCloudLivePlugin.getLiveRoomConfig();
|
|
|
+
|
|
|
+ return room.userSig(userSig).liveRoomConfig(liveRoomConfig);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -260,6 +279,9 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
continue;
|
|
|
}
|
|
|
record.setRoomReservationNum(imLiveBroadcastRoomVos.get(0).getRoomReservationNum());
|
|
|
+
|
|
|
+ // 设置直播间参数信息
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return PageUtil.pageInfo(page);
|