|
@@ -76,7 +76,6 @@ public class RoomServiceImpl implements RoomService {
|
|
|
return baseResponse;
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
|
|
public void joinRoomSuccess(Long registrationId,String roomId,String userId) throws Exception {
|
|
|
StudentExamResultApiDto examResult = null;
|
|
|
log.info("joinRoomSuccess: roomId={}, isAudience={}, isDisableCamera={},isMusicMode={}", roomId);
|
|
@@ -286,7 +285,6 @@ public class RoomServiceImpl implements RoomService {
|
|
|
roomMemberDao.save(roomMember);
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
|
|
public void leaveRoomSuccess(Long registrationId,String roomId,String userId) throws Exception {
|
|
|
if(registrationId != null){
|
|
|
StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
|
|
@@ -444,7 +442,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
|
|
|
public void destroyRoom(Long roomId,String userId) throws Exception {
|
|
|
|
|
|
CheckUtils.checkArgument(roomId != null, "destroyRoom roomId must't be null");
|
|
@@ -481,7 +479,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
|
|
|
public Boolean kickMember(ReqUserData data) throws ApiException, Exception {
|
|
|
StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(data.getRegistrationId());
|
|
|
String roomId = examResult.getRoomId();
|
|
@@ -707,6 +705,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class,isolation = Isolation.SERIALIZABLE)
|
|
|
public Boolean controlDevice(String roomId, String userId, DeviceTypeEnum typeEnum, boolean enable) throws ApiException, Exception {
|
|
|
CheckUtils.checkArgument(roomId != null, "roomId must't be null");
|
|
|
CheckUtils.checkArgument(userId != null, "userId must't be null");
|
|
@@ -899,6 +898,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}*/
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
|
|
public Boolean approveSpeech(String roomId, String ticket) throws ApiException, Exception {
|
|
|
CheckUtils.checkArgument(roomId != null, "roomId must't be null");
|
|
|
CheckUtils.checkArgument(roomDao.existsByRid(roomId), "room not exist");
|
|
@@ -1116,6 +1116,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
|
|
public Boolean changeRole(String roomId, String targetUserId, int targetRole) throws ApiException, Exception {
|
|
|
|
|
|
CheckUtils.checkArgument(roomId != null, "roomId must't be null");
|
|
@@ -1259,31 +1260,6 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
- String body = "{\"members\":[{\"data\":{\"uris\":\"[{\\\"mediaType\\\":0,\\\"msid\\\":\\\"113_RongCloudRTC\\\",\\\"uri\\\":\\\"{\\\\\\\"clusterId\\\\\\\":\\\\\\\"rtc-data-bdcbj.ronghub.com:80\\\\\\\",\\\\\\\"serverId\\\\\\\":\\\\\\\"172.28.76.221:40080\\\\\\\",\\\\\\\"resourceId\\\\\\\":\\\\\\\"113_RongCloudRTC_0\\\\\\\",\\\\\\\"connectionId\\\\\\\":\\\\\\\"AAcxMDczNjg5AAMxMTMAAjMxAA==\\\\\\\",\\\\\\\"ssrc\\\\\\\":1152580707,\\\\\\\"serviceProvider\\\\\\\":\\\\\\\"bdc\\\\\\\",\\\\\\\"userTimestamp\\\\\\\":1598241638662}\\\",\\\"tag\\\":\\\"RongCloudRTC\\\",\\\"state\\\":1},{\\\"mediaType\\\":1,\\\"msid\\\":\\\"113_RongCloudRTC\\\",\\\"uri\\\":\\\"{\\\\\\\"clusterId\\\\\\\":\\\\\\\"rtc-data-bdcbj.ronghub.com:80\\\\\\\",\\\\\\\"serverId\\\\\\\":\\\\\\\"172.28.76.221:40080\\\\\\\",\\\\\\\"resourceId\\\\\\\":\\\\\\\"113_RongCloudRTC_1\\\\\\\",\\\\\\\"connectionId\\\\\\\":\\\\\\\"AAcxMDczNjg5AAMxMTMAAjMxAA==\\\\\\\",\\\\\\\"ssrc\\\\\\\":1388804240,\\\\\\\"serviceProvider\\\\\\\":\\\\\\\"bdc\\\\\\\",\\\\\\\"userTimestamp\\\\\\\":1598241638662}\\\",\\\"tag\\\":\\\"RongCloudRTC\\\",\\\"state\\\":1}]\"},\"userId\":\"113\"}],\"appKey\":\"mgb7ka1nme0yg\",\"sessionId\":\"9XmxCXVZQkArdnxcMyFN98\",\"event\":20,\"userId\":\"113\",\"channelId\":\"31\",\"timestamp\":1598241638774,\"token\":\"\"}";
|
|
|
- ChannelStateNotify notify = JSONObject.parseObject(body, ChannelStateNotify.class);
|
|
|
- boolean msidFlag = false;
|
|
|
- Integer state = null;
|
|
|
- List<Member> members = notify.getMembers();
|
|
|
- if(members != null && members.size() != 0){
|
|
|
- Object uris = JSONObject.parseObject(members.get(0).getData().toJSONString()).get("uris");
|
|
|
- if(uris != null){
|
|
|
- List<UrisDto> jsonArray = JSONObject.parseArray(uris.toString(),UrisDto.class);
|
|
|
- for (UrisDto urisDto : jsonArray) {
|
|
|
- //视频流
|
|
|
- if(urisDto.getMediaType() == 1){
|
|
|
- state = urisDto.getState();
|
|
|
- if(state == 1){
|
|
|
- msidFlag = true;
|
|
|
- }
|
|
|
- }else {
|
|
|
- //音频流
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.SERIALIZABLE)
|
|
|
public boolean statusSync(ChannelStateNotify notify) throws Exception {
|