From ae4a79023655f41e86427bb6feb6b18e65b3961f Mon Sep 17 00:00:00 2001 From: Klaus Date: Tue, 14 May 2024 16:00:54 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EB=B0=A9=20?= =?UTF-8?q?=EC=A1=B0=ED=9A=8C=20-=20=EC=A1=B0=ED=9A=8C=ED=95=98=EB=8A=94?= =?UTF-8?q?=20=EC=82=AC=EB=9E=8C=EC=9D=B4=20=ED=81=AC=EB=A6=AC=EC=97=90?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EC=9D=B4=EB=A9=B4=20=EB=82=B4=EA=B0=80=20?= =?UTF-8?q?=EB=A7=8C=EB=93=A0=20=EB=9D=BC=EC=9D=B4=EB=B8=8C=EC=99=80=20?= =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0=EA=B0=80=20?= =?UTF-8?q?=EB=93=A4=EC=96=B4=EC=99=80=EB=8F=84=20=EB=90=9C=EB=8B=A4?= =?UTF-8?q?=EA=B3=A0=20=EC=84=A4=EC=A0=95=ED=95=9C=20=EB=B0=A9=EB=A7=8C=20?= =?UTF-8?q?=EB=B3=B4=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/live/room/LiveRoomRepository.kt | 19 ++++++++++++++++--- .../sodalive/live/room/LiveRoomService.kt | 6 ++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt index 3d9de88..9b19673 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomRepository.kt @@ -24,6 +24,7 @@ interface LiveRoomQueryRepository { offset: Long, limit: Long, timezone: String, + memberId: Long, isCreator: Boolean, isAdult: Boolean ): List @@ -32,6 +33,7 @@ interface LiveRoomQueryRepository { date: LocalDateTime, offset: Long, limit: Long, + memberId: Long, isCreator: Boolean, isAdult: Boolean ): List @@ -56,6 +58,7 @@ class LiveRoomQueryRepositoryImpl(private val queryFactory: JPAQueryFactory) : L offset: Long, limit: Long, timezone: String, + memberId: Long, isCreator: Boolean, isAdult: Boolean ): List { @@ -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 { @@ -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 diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt index fa090d4..66e9d38 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/live/room/LiveRoomService.kt @@ -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 { @@ -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 { @@ -225,6 +230,7 @@ class LiveRoomService( date = date, offset = pageable.offset, limit = pageable.pageSize.toLong(), + memberId = memberId, isCreator = isCreator, isAdult = isAdult )