graphql: Update meeting duration when breakout duration is updated
This commit is contained in:
parent
31c853f801
commit
5c8bbe6c06
@ -4,7 +4,7 @@ import org.bigbluebutton.common2.msgs._
|
||||
import org.bigbluebutton.core.api.{ SendTimeRemainingAuditInternalMsg, UpdateBreakoutRoomTimeInternalMsg }
|
||||
import org.bigbluebutton.core.apps.{ PermissionCheck, RightsManagementTrait }
|
||||
import org.bigbluebutton.core.bus.BigBlueButtonEvent
|
||||
import org.bigbluebutton.core.db.BreakoutRoomDAO
|
||||
import org.bigbluebutton.core.db.{ BreakoutRoomDAO, MeetingDAO }
|
||||
import org.bigbluebutton.core.domain.MeetingState2x
|
||||
import org.bigbluebutton.core.running.{ MeetingActor, OutMsgRouter }
|
||||
import org.bigbluebutton.core2.message.senders.{ MsgBuilder, Sender }
|
||||
@ -78,6 +78,7 @@ trait UpdateBreakoutRoomsTimeMsgHdlr extends RightsManagementTrait {
|
||||
|
||||
log.debug("Updating {} minutes for breakout rooms time in meeting {}", msg.body.timeInMinutes, props.meetingProp.intId)
|
||||
BreakoutRoomDAO.updateRoomsDuration(props.meetingProp.intId, newDurationInSeconds)
|
||||
MeetingDAO.updateMeetingDurationByParentMeeting(props.meetingProp.intId, newDurationInSeconds)
|
||||
breakoutModel.setTime(newDurationInSeconds)
|
||||
}
|
||||
}
|
||||
|
@ -175,10 +175,11 @@ object BreakoutRoomDAO {
|
||||
}
|
||||
}
|
||||
|
||||
def updateRoomsDuration(meetingId: String, newDurationInSeconds: Int) = {
|
||||
def updateRoomsDuration(parentMeetingId: String, newDurationInSeconds: Int) = {
|
||||
DatabaseConnection.db.run(
|
||||
TableQuery[BreakoutRoomDbTableDef]
|
||||
.filter(_.parentMeetingId === meetingId)
|
||||
.filter(_.parentMeetingId === parentMeetingId)
|
||||
.filter(_.endedAt.isEmpty)
|
||||
.map(u => u.durationInSeconds)
|
||||
.update(newDurationInSeconds)
|
||||
).onComplete {
|
||||
|
@ -93,6 +93,23 @@ object MeetingDAO {
|
||||
}
|
||||
}
|
||||
|
||||
def updateMeetingDurationByParentMeeting(parentMeetingId: String, newDurationInSeconds: Int) = {
|
||||
val subqueryBreakoutRooms = TableQuery[BreakoutRoomDbTableDef]
|
||||
.filter(_.parentMeetingId === parentMeetingId)
|
||||
.filter(_.endedAt.isEmpty)
|
||||
.map(_.externalId)
|
||||
|
||||
DatabaseConnection.db.run(
|
||||
TableQuery[MeetingDbTableDef]
|
||||
.filter(_.extId in subqueryBreakoutRooms)
|
||||
.map(u => u.duration)
|
||||
.update(newDurationInSeconds)
|
||||
).onComplete {
|
||||
case Success(rowsAffected) => DatabaseConnection.logger.debug(s"$rowsAffected row(s) updated duration on Meeting table")
|
||||
case Failure(e) => DatabaseConnection.logger.debug(s"Error updating duration on Meeting: $e")
|
||||
}
|
||||
}
|
||||
|
||||
def delete(meetingId: String) = {
|
||||
DatabaseConnection.db.run(
|
||||
TableQuery[MeetingDbTableDef]
|
||||
|
Loading…
Reference in New Issue
Block a user