fix: 최근 종료한 라이브 API 오류 수정
This commit is contained in:
parent
2192ddc8fa
commit
a99260209b
|
@ -61,7 +61,7 @@ interface LiveRoomQueryRepository {
|
||||||
fun getTotalHeartCount(roomId: Long): Int?
|
fun getTotalHeartCount(roomId: Long): Int?
|
||||||
fun getLiveRoomCreatorId(roomId: Long): Long?
|
fun getLiveRoomCreatorId(roomId: Long): Long?
|
||||||
fun getHeartList(roomId: Long): List<GetLiveRoomHeartListItem>
|
fun getHeartList(roomId: Long): List<GetLiveRoomHeartListItem>
|
||||||
fun getLatestFinishedLive(offset: Long): List<GetLatestFinishedLiveQueryResponse>
|
fun getLatestFinishedLive(): List<GetLatestFinishedLiveQueryResponse>
|
||||||
}
|
}
|
||||||
|
|
||||||
class LiveRoomQueryRepositoryImpl(
|
class LiveRoomQueryRepositoryImpl(
|
||||||
|
@ -383,7 +383,7 @@ class LiveRoomQueryRepositoryImpl(
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getLatestFinishedLive(offset: Long): List<GetLatestFinishedLiveQueryResponse> {
|
override fun getLatestFinishedLive(): List<GetLatestFinishedLiveQueryResponse> {
|
||||||
val liveRoom = liveRoom
|
val liveRoom = liveRoom
|
||||||
val subLiveRoom = QLiveRoom.liveRoom
|
val subLiveRoom = QLiveRoom.liveRoom
|
||||||
|
|
||||||
|
@ -413,7 +413,6 @@ class LiveRoomQueryRepositoryImpl(
|
||||||
.`in`(subQuery)
|
.`in`(subQuery)
|
||||||
)
|
)
|
||||||
.orderBy(liveRoom.updatedAt.desc())
|
.orderBy(liveRoom.updatedAt.desc())
|
||||||
.offset(offset)
|
|
||||||
.limit(20)
|
.limit(20)
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1298,12 +1298,7 @@ class LiveRoomService(
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getLatestFinishedLive(member: Member?): List<GetLatestFinishedLiveResponse> {
|
fun getLatestFinishedLive(member: Member?): List<GetLatestFinishedLiveResponse> {
|
||||||
val result = mutableListOf<GetLatestFinishedLiveResponse>()
|
return repository.getLatestFinishedLive()
|
||||||
var retry = 0L
|
|
||||||
|
|
||||||
do {
|
|
||||||
result.addAll(
|
|
||||||
repository.getLatestFinishedLive(offset = retry)
|
|
||||||
.filter {
|
.filter {
|
||||||
if (member?.id != null) {
|
if (member?.id != null) {
|
||||||
!blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it.memberId)
|
!blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it.memberId)
|
||||||
|
@ -1314,9 +1309,5 @@ class LiveRoomService(
|
||||||
.map {
|
.map {
|
||||||
GetLatestFinishedLiveResponse(response = it)
|
GetLatestFinishedLiveResponse(response = it)
|
||||||
}
|
}
|
||||||
)
|
|
||||||
} while (result.size < 20 && retry++ < 3)
|
|
||||||
|
|
||||||
return result.take(20)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue