라이브 방

- 로그인 없이 조회 가능하도록 수정
This commit is contained in:
Klaus 2025-03-22 06:37:20 +09:00
parent 3ff84074bd
commit 3595c02e74
1 changed files with 12 additions and 6 deletions

View File

@ -176,18 +176,24 @@ class LiveRoomQueryRepositoryImpl(
) )
} }
return queryFactory val orderBy = if (memberId != null) {
.selectFrom(liveRoom) listOf(
.innerJoin(liveRoom.member, member)
.limit(10)
.where(where)
.orderBy(
CaseBuilder() CaseBuilder()
.`when`(member.id.eq(memberId)).then(1) .`when`(member.id.eq(memberId)).then(1)
.otherwise(2) .otherwise(2)
.asc(), .asc(),
liveRoom.beginDateTime.asc() liveRoom.beginDateTime.asc()
) )
} else {
listOf(liveRoom.beginDateTime.asc())
}
return queryFactory
.selectFrom(liveRoom)
.innerJoin(liveRoom.member, member)
.limit(10)
.where(where)
.orderBy(*orderBy.toTypedArray())
.fetch() .fetch()
} }