라이브 방 조회
- 조회하는 사람이 크리에이터이면 내가 만든 라이브와 크리에이터가 들어와도 된다고 설정한 방만 보이도록 수정
This commit is contained in:
parent
33130140fd
commit
ae4a790236
|
@ -24,6 +24,7 @@ interface LiveRoomQueryRepository {
|
|||
offset: Long,
|
||||
limit: Long,
|
||||
timezone: String,
|
||||
memberId: Long,
|
||||
isCreator: Boolean,
|
||||
isAdult: Boolean
|
||||
): List<LiveRoom>
|
||||
|
@ -32,6 +33,7 @@ interface LiveRoomQueryRepository {
|
|||
date: LocalDateTime,
|
||||
offset: Long,
|
||||
limit: Long,
|
||||
memberId: Long,
|
||||
isCreator: Boolean,
|
||||
isAdult: Boolean
|
||||
): List<LiveRoom>
|
||||
|
@ -56,6 +58,7 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
|||
offset: Long,
|
||||
limit: Long,
|
||||
timezone: String,
|
||||
memberId: Long,
|
||||
isCreator: Boolean,
|
||||
isAdult: Boolean
|
||||
): List<LiveRoom> {
|
||||
|
@ -69,7 +72,10 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
|||
}
|
||||
|
||||
if (isCreator) {
|
||||
where = where.and(liveRoom.isAvailableJoinCreator.isTrue)
|
||||
where = where.and(
|
||||
liveRoom.isAvailableJoinCreator.isTrue
|
||||
.or(liveRoom.member.id.eq(memberId))
|
||||
)
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
|
@ -92,6 +98,7 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
|||
date: LocalDateTime,
|
||||
offset: Long,
|
||||
limit: Long,
|
||||
memberId: Long,
|
||||
isCreator: Boolean,
|
||||
isAdult: Boolean
|
||||
): List<LiveRoom> {
|
||||
|
@ -109,7 +116,10 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
|||
}
|
||||
|
||||
if (isCreator) {
|
||||
where = where.and(liveRoom.isAvailableJoinCreator.isTrue)
|
||||
where = where.and(
|
||||
liveRoom.isAvailableJoinCreator.isTrue
|
||||
.or(liveRoom.member.id.eq(memberId))
|
||||
)
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
|
@ -146,7 +156,10 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L
|
|||
}
|
||||
|
||||
if (isCreator) {
|
||||
where = where.and(liveRoom.isAvailableJoinCreator.isTrue)
|
||||
where = where.and(
|
||||
liveRoom.isAvailableJoinCreator.isTrue
|
||||
.or(liveRoom.member.id.eq(memberId))
|
||||
)
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
|
|
|
@ -121,6 +121,7 @@ class LiveRoomService(
|
|||
getLiveRoomListNow(
|
||||
pageable,
|
||||
timezone,
|
||||
memberId = member.id!!,
|
||||
isCreator = member.role == MemberRole.CREATOR,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
|
@ -129,6 +130,7 @@ class LiveRoomService(
|
|||
dateString,
|
||||
pageable,
|
||||
timezone,
|
||||
memberId = member.id!!,
|
||||
isCreator = member.role == MemberRole.CREATOR,
|
||||
isAdult = member.auth != null
|
||||
)
|
||||
|
@ -196,6 +198,7 @@ class LiveRoomService(
|
|||
private fun getLiveRoomListNow(
|
||||
pageable: Pageable,
|
||||
timezone: String,
|
||||
memberId: Long,
|
||||
isCreator: Boolean,
|
||||
isAdult: Boolean
|
||||
): List<LiveRoom> {
|
||||
|
@ -203,6 +206,7 @@ class LiveRoomService(
|
|||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong(),
|
||||
timezone = timezone,
|
||||
memberId = memberId,
|
||||
isCreator = isCreator,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
@ -212,6 +216,7 @@ class LiveRoomService(
|
|||
dateString: String,
|
||||
pageable: Pageable,
|
||||
timezone: String,
|
||||
memberId: Long,
|
||||
isCreator: Boolean,
|
||||
isAdult: Boolean
|
||||
): List<LiveRoom> {
|
||||
|
@ -225,6 +230,7 @@ class LiveRoomService(
|
|||
date = date,
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong(),
|
||||
memberId = memberId,
|
||||
isCreator = isCreator,
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue