fix: 최근 종료한 라이브 API 오류 수정
This commit is contained in:
		| @@ -4,6 +4,7 @@ import com.querydsl.core.types.Projections | |||||||
| import com.querydsl.core.types.dsl.CaseBuilder | import com.querydsl.core.types.dsl.CaseBuilder | ||||||
| import com.querydsl.core.types.dsl.Expressions | import com.querydsl.core.types.dsl.Expressions | ||||||
| import com.querydsl.core.types.dsl.NumberExpression | import com.querydsl.core.types.dsl.NumberExpression | ||||||
|  | import com.querydsl.jpa.JPAExpressions | ||||||
| import com.querydsl.jpa.impl.JPAQueryFactory | import com.querydsl.jpa.impl.JPAQueryFactory | ||||||
| import kr.co.vividnext.sodalive.can.use.CanUsage | import kr.co.vividnext.sodalive.can.use.CanUsage | ||||||
| import kr.co.vividnext.sodalive.can.use.QUseCan.useCan | import kr.co.vividnext.sodalive.can.use.QUseCan.useCan | ||||||
| @@ -383,6 +384,9 @@ class LiveRoomQueryRepositoryImpl( | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     override fun getLatestFinishedLive(offset: Long): List<GetLatestFinishedLiveQueryResponse> { |     override fun getLatestFinishedLive(offset: Long): List<GetLatestFinishedLiveQueryResponse> { | ||||||
|  |         val liveRoom = liveRoom | ||||||
|  |         val subLiveRoom = QLiveRoom.liveRoom | ||||||
|  |  | ||||||
|         return queryFactory |         return queryFactory | ||||||
|             .select( |             .select( | ||||||
|                 QGetLatestFinishedLiveQueryResponse( |                 QGetLatestFinishedLiveQueryResponse( | ||||||
| @@ -396,7 +400,13 @@ class LiveRoomQueryRepositoryImpl( | |||||||
|             .from(liveRoom) |             .from(liveRoom) | ||||||
|             .innerJoin(liveRoom.member, member) |             .innerJoin(liveRoom.member, member) | ||||||
|             .where( |             .where( | ||||||
|                 liveRoom.isActive.isFalse |                 liveRoom.updatedAt | ||||||
|  |                     .eq( | ||||||
|  |                         JPAExpressions.select(subLiveRoom.updatedAt.max()) | ||||||
|  |                             .from(subLiveRoom) | ||||||
|  |                             .where(subLiveRoom.member.eq(liveRoom.member)) | ||||||
|  |                     ) | ||||||
|  |                     .and(liveRoom.isActive.isFalse) | ||||||
|                     .and(liveRoom.channelName.isNotNull) |                     .and(liveRoom.channelName.isNotNull) | ||||||
|             ) |             ) | ||||||
|             .groupBy(member.id) |             .groupBy(member.id) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user