test #99

Merged
klaus merged 2 commits from test into main 2023-12-10 12:34:52 +00:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 80930ebd3d - Show all commits

View File

@ -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()
}

View File

@ -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
}