|
@@ -118,7 +118,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
return Integer.parseInt(roomId);
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
@Override
|
|
|
public RoomResult joinRoom(String roomId) throws Exception {
|
|
|
CheckUtils.checkArgument(roomId != null, "roomId must't be null");
|
|
@@ -236,7 +236,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
return roomResult;
|
|
|
}
|
|
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
@Override
|
|
|
public void joinRoomSuccess(String roomId,String userId) throws Exception {
|
|
|
RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
|
|
@@ -319,7 +319,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void saveRoom(String roomId, String roomName, Date createTime, String display) {
|
|
|
+ public void saveRoom(String roomId, String roomName, Date createTime, String display) {
|
|
|
Room room = new Room();
|
|
|
room.setRid(roomId);
|
|
|
room.setName(roomName);
|
|
@@ -329,7 +329,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
roomDao.save(room);
|
|
|
}
|
|
|
|
|
|
- private RoomMember saveRoomMember(String userId, String headUrl, String userName, String roomId, int role, Date joinTime) {
|
|
|
+ public RoomMember saveRoomMember(String userId, String headUrl, String userName, String roomId, int role, Date joinTime) {
|
|
|
RoomMember roomMember = new RoomMember();
|
|
|
roomMember.setUid(userId);
|
|
|
roomMember.setName(userName);
|
|
@@ -343,7 +343,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
return roomMember;
|
|
|
}
|
|
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
@Override
|
|
|
public void leaveRoomSuccess(String roomId,String userId) throws Exception {
|
|
|
RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
|
|
@@ -388,7 +388,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
userDao.deleteByUid(userId);
|
|
|
}
|
|
|
|
|
|
- private void deleteWhiteboardByUser(String roomId, String userId) throws Exception {
|
|
|
+ public void deleteWhiteboardByUser(String roomId, String userId) throws Exception {
|
|
|
List<Whiteboard> whiteboardList = whiteboardDao.findByRidAndCreator(roomId, userId);
|
|
|
if (!whiteboardList.isEmpty()) {
|
|
|
whiteboardDao.deleteByRidAndCreator(roomId, userId);
|
|
@@ -398,7 +398,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
@Override
|
|
|
public void destroyRoom(String roomId) {
|
|
|
whiteboardDao.deleteByRid(roomId);
|
|
@@ -471,7 +471,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class,isolation = Isolation.READ_COMMITTED)
|
|
|
public Boolean kickMember(String roomId) throws Exception {
|
|
|
SysUser authUser = sysUserFeignService.queryUserInfo();
|
|
|
String userId = authUser.getId().toString();
|
|
@@ -961,7 +961,7 @@ public class RoomServiceImpl implements RoomService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void checkOverMax(String roomId, RoomMember targetUser, int targetRole) {
|
|
|
+ public void checkOverMax(String roomId, RoomMember targetUser, int targetRole) {
|
|
|
if (RoleEnum.getEnumByValue(targetUser.getRole()).equals(RoleEnum.RoleAudience)) {
|
|
|
int count = roomMemberDao.countByRidAndExcludeRole(roomId, RoleEnum.RoleAudience.getValue());
|
|
|
if (count == roomProperties.getMaxCount()) {
|
|
@@ -1276,14 +1276,13 @@ public class RoomServiceImpl implements RoomService {
|
|
|
return courseScheduleStudentPaymentDao.queryNoJoinStu(roomId,roomId.substring(1));
|
|
|
}
|
|
|
|
|
|
- @Transactional(rollbackFor = Exception.class)
|
|
|
- private void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {
|
|
|
+ public void updateDisplay(String roomId, String senderId, String display, Integer isIncludeSender) throws Exception {
|
|
|
roomDao.updateDisplayByRid(roomId, display);
|
|
|
DisplayMessage displayMessage = new DisplayMessage(display);
|
|
|
imHelper.publishMessage(senderId, roomId, displayMessage, isIncludeSender);
|
|
|
}
|
|
|
|
|
|
- private boolean isUserDisplay(Room room, String userId) {
|
|
|
+ public boolean isUserDisplay(Room room, String userId) {
|
|
|
boolean result = false;
|
|
|
if (!room.getDisplay().isEmpty() && room.getDisplay().contains("userId=" + userId)) {
|
|
|
if (room.getDisplay().contains("type=0") || room.getDisplay().contains("type=1") || room.getDisplay().contains("type=3")) {
|