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 getRecentRoomInfo(memberId: Long, cloudFrontHost: String): GetRecentRoomInfoResponse?
fun getDonationTotal(roomId: Long): Int? fun getDonationTotal(roomId: Long): Int?
fun getDonationList(roomId: Long, cloudFrontHost: String): List<GetLiveRoomDonationItem> 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 { class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : LiveRoomQueryRepository {
@ -191,12 +191,13 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
.fetch() .fetch()
} }
override fun getRoomActiveAndChannelNameIsNotNull(): List<LiveRoom> { override fun getRoomActiveAndChannelNameIsNotNull(memberId: Long): List<LiveRoom> {
return queryFactory return queryFactory
.selectFrom(liveRoom) .selectFrom(liveRoom)
.where( .where(
liveRoom.isActive.isTrue liveRoom.isActive.isTrue
.and(liveRoom.channelName.isNotNull) .and(liveRoom.channelName.isNotNull)
.and(liveRoom.member.id.eq(memberId))
) )
.fetch() .fetch()
} }

View File

@ -183,7 +183,7 @@ class LiveRoomService(
} }
if (now == beginDateTime) { if (now == beginDateTime) {
val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull() val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull(memberId = member.id!!)
for (activeRoom in activeRooms) { for (activeRoom in activeRooms) {
activeRoom.isActive = false activeRoom.isActive = false
} }
@ -410,7 +410,7 @@ class LiveRoomService(
throw SodaException("$startAvailableDateTimeString 이후에 시작할 수 있습니다.") throw SodaException("$startAvailableDateTimeString 이후에 시작할 수 있습니다.")
} }
val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull() val activeRooms = repository.getRoomActiveAndChannelNameIsNotNull(memberId = member.id!!)
for (activeRoom in activeRooms) { for (activeRoom in activeRooms) {
activeRoom.isActive = false activeRoom.isActive = false
} }