|
@@ -16,6 +16,7 @@ import com.microsvc.toolkit.middleware.live.message.LiveRoomMessage;
|
|
|
import com.microsvc.toolkit.middleware.live.message.LiveRoomUser;
|
|
|
import com.microsvc.toolkit.middleware.live.message.RTCRequest;
|
|
|
import com.microsvc.toolkit.middleware.live.message.RTCRoom;
|
|
|
+import com.microsvc.toolkit.middleware.live.message.TencentRequest;
|
|
|
import com.microsvc.toolkit.middleware.live.message.TencentWrapper;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
@@ -1151,6 +1152,9 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
.eq(ImLiveBroadcastRoom::getSpeakerId, Integer.parseInt(userid))
|
|
|
.update(room);
|
|
|
|
|
|
+ // 设置直播群组自定义数据
|
|
|
+ setGroupDefinedData(roomVo,false);
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -1195,9 +1199,29 @@ public class ImLiveBroadcastRoomServiceImpl extends ServiceImpl<ImLiveBroadcastR
|
|
|
.set(ImLiveBroadcastRoom::getSpeakerStatus, 1)
|
|
|
.update();
|
|
|
|
|
|
+ // 设置直播群组自定义数据
|
|
|
+ setGroupDefinedData(roomVo,true);
|
|
|
+
|
|
|
return roomVo;
|
|
|
}
|
|
|
|
|
|
+ private void setGroupDefinedData( ImLiveBroadcastRoomVo roomVo,Boolean onlineStatus) {
|
|
|
+ List<TencentRequest.ChatRoomGroupDefinedData> appDefinedData = new ArrayList<>();
|
|
|
+ appDefinedData.add(TencentRequest.ChatRoomGroupDefinedData.builder()
|
|
|
+ .key("ANCHOR_STATUS")
|
|
|
+ .value(onlineStatus?"ONLINE":"OFFLINE")
|
|
|
+ .build());
|
|
|
+ try {
|
|
|
+ livePluginContext.getPluginService(roomVo.getServiceProvider())
|
|
|
+ .chatRoomGroupDefinedData(TencentRequest.ChatRoomGroup.builder()
|
|
|
+ .groupId(roomVo.getRoomUid())
|
|
|
+ .appDefinedData(appDefinedData)
|
|
|
+ .build());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("设置直播群配置失败", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 进入房间-修改用户对应的房间号信息
|
|
|
*
|