fix: 최근 종료한 라이브 API 오류 수정

This commit is contained in:
Klaus 2025-07-18 17:50:18 +09:00
parent 741a1282a3
commit 2192ddc8fa
1 changed files with 11 additions and 10 deletions

View File

@ -387,6 +387,15 @@ class LiveRoomQueryRepositoryImpl(
val liveRoom = liveRoom val liveRoom = liveRoom
val subLiveRoom = QLiveRoom.liveRoom val subLiveRoom = QLiveRoom.liveRoom
val subQuery = JPAExpressions
.select(subLiveRoom.member.id, subLiveRoom.updatedAt.max())
.from(subLiveRoom)
.where(
subLiveRoom.isActive.isFalse
.and(subLiveRoom.channelName.isNotNull)
)
.groupBy(subLiveRoom.member.id)
return queryFactory return queryFactory
.select( .select(
QGetLatestFinishedLiveQueryResponse( QGetLatestFinishedLiveQueryResponse(
@ -400,16 +409,8 @@ class LiveRoomQueryRepositoryImpl(
.from(liveRoom) .from(liveRoom)
.innerJoin(liveRoom.member, member) .innerJoin(liveRoom.member, member)
.where( .where(
liveRoom.updatedAt Expressions.list(liveRoom.member.id, liveRoom.updatedAt)
.eq( .`in`(subQuery)
JPAExpressions.select(subLiveRoom.updatedAt.max())
.from(subLiveRoom)
.where(
subLiveRoom.member.eq(liveRoom.member)
.and(subLiveRoom.isActive.isFalse)
.and(subLiveRoom.channelName.isNotNull)
)
)
) )
.orderBy(liveRoom.updatedAt.desc()) .orderBy(liveRoom.updatedAt.desc())
.offset(offset) .offset(offset)