test #332
| @@ -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,25 +1298,16 @@ class LiveRoomService( | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     fun getLatestFinishedLive(member: Member?): List<GetLatestFinishedLiveResponse> { |     fun getLatestFinishedLive(member: Member?): List<GetLatestFinishedLiveResponse> { | ||||||
|         val result = mutableListOf<GetLatestFinishedLiveResponse>() |         return repository.getLatestFinishedLive() | ||||||
|         var retry = 0L |             .filter { | ||||||
|  |                 if (member?.id != null) { | ||||||
|         do { |                     !blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it.memberId) | ||||||
|             result.addAll( |                 } else { | ||||||
|                 repository.getLatestFinishedLive(offset = retry) |                     true | ||||||
|                     .filter { |                 } | ||||||
|                         if (member?.id != null) { |             } | ||||||
|                             !blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it.memberId) |             .map { | ||||||
|                         } else { |                 GetLatestFinishedLiveResponse(response = it) | ||||||
|                             true |             } | ||||||
|                         } |  | ||||||
|                     } |  | ||||||
|                     .map { |  | ||||||
|                         GetLatestFinishedLiveResponse(response = it) |  | ||||||
|                     } |  | ||||||
|             ) |  | ||||||
|         } while (result.size < 20 && retry++ < 3) |  | ||||||
|  |  | ||||||
|         return result.take(20) |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user