diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt index b7de267..9f03a50 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt @@ -41,7 +41,7 @@ interface LiveRoomQueryRepository { fun getRecentRoomInfo(memberId: Long, cloudFrontHost: String): GetRecentRoomInfoResponse? fun getDonationTotal(roomId: Long): Int? fun getDonationList(roomId: Long, cloudFrontHost: String): List<GetLiveRoomDonationItem> - fun getRoomActiveAndChannelNameIsNotNull(): List<LiveRoom> + fun getRoomActiveAndChannelNameIsNotNull(memberId: Long): List<LiveRoom> } class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : LiveRoomQueryRepository { @@ -191,12 +191,13 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L .fetch() } - override fun getRoomActiveAndChannelNameIsNotNull(): List<LiveRoom> { + override fun getRoomActiveAndChannelNameIsNotNull(memberId: Long): List<LiveRoom> { return queryFactory .selectFrom(liveRoom) .where( liveRoom.isActive.isTrue .and(liveRoom.channelName.isNotNull) + .and(liveRoom.member.id.eq(memberId)) ) .fetch() } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt index 46577ed..09101b0 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt @@ -183,7 +183,7 @@ class LiveRoomService( } if (now == beginDateTime) { - val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull() + val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull(memberId = member.id!!) for (activeRoom in activeRooms) { activeRoom.isActive = false } @@ -410,7 +410,7 @@ class LiveRoomService( throw SodaException("$startAvailableDateTimeString 이후에 시작할 수 있습니다.") } - val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull() + val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull(memberId = member.id!!) for (activeRoom in activeRooms) { activeRoom.isActive = false }