|
@@ -476,6 +476,15 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
|
|
|
|
|
|
@Override
|
|
|
public void dissolveTheRoom(String roomId) {
|
|
|
+ this.changRoomStatus(roomId,2);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void openTheRoom(String roomId) {
|
|
|
+ this.changRoomStatus(roomId,1);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void changRoomStatus(String roomId,Integer status ){
|
|
|
Room room = this.getById(roomId);
|
|
|
if(room == null){
|
|
|
throw new BusinessException(ResultCode.ROOM_MISS);
|
|
@@ -485,7 +494,7 @@ public class RoomServiceImpl extends ServiceImpl<IRoomMapper, Room> implements I
|
|
|
}
|
|
|
LambdaUpdateWrapper<Room> wrapper = new LambdaUpdateWrapper<>();
|
|
|
wrapper.eq(Room::getRoomId,room.getRoomId());
|
|
|
- wrapper.set(Room::getRoomStatus,2);
|
|
|
+ wrapper.set(Room::getRoomStatus,status);
|
|
|
this.update(wrapper);
|
|
|
}
|
|
|
}
|