From 9c9aa336876f9ab88a690e5facb34d832c6f9f6d Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 14 Feb 2025 04:50:13 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=98=ED=85=90=EC=B8=A0=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=EC=8B=9C=EB=A6=AC=EC=A6=88=20=ED=83=AD=20-=20?= =?UTF-8?q?=EC=9E=A5=EB=A5=B4=EB=B3=84=20=EC=B6=94=EC=B2=9C=20=EC=8B=9C?= =?UTF-8?q?=EB=A6=AC=EC=A6=88=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AudioContentMainTabSeriesController.kt | 17 +++++++++++++++++ .../series/AudioContentMainTabSeriesService.kt | 12 ++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesController.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesController.kt index 3b753f5..4a4d2e0 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesController.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesController.kt @@ -7,6 +7,7 @@ import org.springframework.data.domain.Pageable import org.springframework.security.core.annotation.AuthenticationPrincipal import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController @RestController @@ -54,4 +55,20 @@ class AudioContentMainTabSeriesController(private val service: AudioContentMainT ) ) } + + @GetMapping("/recommend-by-genre") + fun getRecommendSeriesListByGenre( + @RequestParam genreId: Long, + @AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member? + ) = run { + if (member == null) throw SodaException("로그인 정보를 확인해주세요.") + + ApiResponse.ok( + service.getRecommendSeriesListByGenre( + genreId, + memberId = member.id!!, + isAdult = member.auth != null + ) + ) + } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesService.kt index bd7093b..48f2497 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/main/tab/series/AudioContentMainTabSeriesService.kt @@ -200,4 +200,16 @@ class AudioContentMainTabSeriesService( return GetSeriesListResponse(totalCount, items) } + + fun getRecommendSeriesListByGenre( + genreId: Long, + memberId: Long, + isAdult: Boolean + ): List { + return rankingService.getSeriesAllRankingByGenre( + memberId = memberId, + isAdult = isAdult, + genreId = genreId + ) + } }