From d90a872e797695f4e3bcbdd40155e7d05198d927 Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 6 Feb 2026 13:52:30 +0900 Subject: [PATCH] =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EB=B8=8C=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20-=20apple-test,=20google-test=20=EA=B3=84?= =?UTF-8?q?=EC=A0=95=EC=9D=80=20isAdult=EA=B0=80=20true=EC=9D=B8=20?= =?UTF-8?q?=EB=B0=A9=EC=9D=B4=20=ED=95=AD=EC=83=81=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=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 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 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 c64de8ab..849a1adc 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 @@ -89,11 +89,13 @@ class LiveRoomQueryRepositoryImpl( .and(liveRoom.isActive.isTrue) .and(liveRoom.member.isNotNull) - if (!isAdult) { + val isAdultRestricted = !isAdult || memberId == 17L || memberId == 16L + if (isAdultRestricted) { where = where.and(liveRoom.isAdult.isFalse) } - if (isCreator && memberId != null) { + val hasMemberId = memberId != null + if (isCreator && hasMemberId) { where = where.and( liveRoom.isAvailableJoinCreator.isTrue .or(liveRoom.member.id.eq(memberId)) @@ -106,7 +108,7 @@ class LiveRoomQueryRepositoryImpl( Gender.FEMALE -> liveRoom.genderRestriction.`in`(GenderRestriction.ALL, GenderRestriction.FEMALE_ONLY) Gender.NONE -> liveRoom.genderRestriction.isNotNull } - where = if (memberId != null) { + where = if (hasMemberId) { where.and(genderCondition.or(liveRoom.member.id.eq(memberId))) } else { where.and(genderCondition) @@ -118,7 +120,7 @@ class LiveRoomQueryRepositoryImpl( .innerJoin(liveRoom.member, member) .leftJoin(quarterLiveRankings).on(liveRoom.id.eq(quarterLiveRankings.roomId)) - if (memberId != null) { + if (hasMemberId) { val blockMemberCondition = blockMember.member.id.eq(member.id) .and(blockMember.blockedMember.id.eq(memberId)) .and(blockMember.isActive.isTrue) @@ -158,7 +160,8 @@ class LiveRoomQueryRepositoryImpl( .and(liveRoom.isActive.isTrue) .and(liveRoom.member.isNotNull) - if (!isAdult) { + val isAdultRestricted = !isAdult || memberId == 17L || memberId == 16L + if (isAdultRestricted) { where = where.and(liveRoom.isAdult.isFalse) } @@ -223,7 +226,8 @@ class LiveRoomQueryRepositoryImpl( .and(liveRoom.isActive.isTrue) .and(liveRoom.member.isNotNull) - if (!isAdult) { + val isAdultRestricted = !isAdult || memberId == 17L || memberId == 16L + if (isAdultRestricted) { where = where.and(liveRoom.isAdult.isFalse) }