|
@@ -1180,6 +1180,8 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
//主讲人退出房间关闭录像
|
|
|
closeLive(speakerInfo);
|
|
|
|
|
|
+ syncLikeCount(roomUid);
|
|
|
+
|
|
|
//主讲人退出房间
|
|
|
speakerInfo.setExitRoomTime(now);
|
|
|
log.info("opsRoom>>>> exit speakerCache {}", JSONObject.toJSONString(speakerInfo));
|
|
@@ -2460,6 +2462,44 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
liveBroadcastRoomMemberDao.userWhetherMic(roomUid, userId, whetherMicStatus);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 同步直播间点赞数
|
|
|
+ *
|
|
|
+ * @param roomUid 直播间uid
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void syncLikeCount(String roomUid) {
|
|
|
+ ImLiveBroadcastRoom room = getById(roomUid);
|
|
|
+ if (room == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ImLiveBroadcastRoomDetailVo imLiveBroadcastRoomDetailVo = liveBroadcastRoomDataService.getDao()
|
|
|
+ .queryByRoomUid(roomUid);
|
|
|
+ if (imLiveBroadcastRoomDetailVo == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (room.getServiceProvider().equals(RongCloudLivePlugin.PLUGIN_NAME)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ LivePluginService pluginService = livePluginContext.getPluginService(room.getServiceProvider());
|
|
|
+ List<TencentWrapper.ChatRoomGroupCounter> chatRoomGroupCounters = null;
|
|
|
+ try {
|
|
|
+ chatRoomGroupCounters = pluginService.chatRoomGroupCounterDataList(
|
|
|
+ room.getRoomUid());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("同步直播间点赞数失败", e);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(chatRoomGroupCounters)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ chatRoomGroupCounters.stream().filter(a -> a.getKey().equals(EGroupDefinedDataType.LIKES.getCode()))
|
|
|
+ .findFirst().ifPresent(a -> {
|
|
|
+ imLiveBroadcastRoomDetailVo.setTotalLikeNum(Integer.parseInt(a.getValue()));
|
|
|
+ updateById(room);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询直播间所有用户信息
|