diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryService.kt index bd09bc8a..3301359a 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryService.kt @@ -58,7 +58,7 @@ class CreatorChannelLiveQueryService( validateCreatorRole(creator) val canViewAdultContent = memberContentPreferenceService.canViewAdultContent(viewer) - val isViewerCreator = viewerId == creatorId + val isViewerCreator = viewer.role == MemberRole.CREATOR val effectiveViewerGender = viewer.effectiveGender() val fetchedContents = queryPort.findLiveReplayAudioContents( creatorId = creatorId, diff --git a/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryServiceTest.kt b/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryServiceTest.kt index b631c0e5..9d462af7 100644 --- a/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryServiceTest.kt +++ b/src/test/kotlin/kr/co/vividnext/sodalive/v2/creator/channel/live/application/CreatorChannelLiveQueryServiceTest.kt @@ -62,6 +62,25 @@ class CreatorChannelLiveQueryServiceTest { assertEquals("https://cdn.test/audio/1.png", tab.liveReplayContents.first().imageUrl) } + @Test + @DisplayName("다른 크리에이터가 조회하면 현재 라이브 조회에 크리에이터 여부를 전달한다") + fun shouldPassCreatorViewerStatusToCurrentLiveQuery() { + val port = FakeCreatorChannelLiveQueryPort() + val service = createService(port) + val viewer = createMember(id = 10L, role = MemberRole.CREATOR) + + service.getLiveTab( + creatorId = 1L, + viewer = viewer, + sort = ContentSort.LATEST, + page = 0, + size = 20, + now = LocalDateTime.of(2026, 6, 17, 10, 0) + ) + + assertTrue(port.currentLiveIsViewerCreator == true) + } + @Test @DisplayName("라이브 탭 서비스는 size + 1개 조회 결과를 응답 size로 제한하고 hasNext를 true로 반환한다") fun shouldAssembleLiveTabWithHasNextWhenFetchedMoreThanRequestedSize() { @@ -236,7 +255,8 @@ class CreatorChannelLiveQueryServiceTest { private fun createMember( id: Long, gender: Gender = Gender.NONE, - authGender: Int? = null + authGender: Int? = null, + role: MemberRole = MemberRole.USER ): Member { val member = Member( email = "member$id@test.com", @@ -246,6 +266,7 @@ class CreatorChannelLiveQueryServiceTest { gender = gender ) member.id = id + member.role = role authGender?.let { Auth( name = "name",