콘텐츠 메인 시리즈 탭

- 장르별 추천 시리즈 API
This commit is contained in:
Klaus 2025-02-14 04:50:13 +09:00
parent a8589ef4e7
commit 9c9aa33687
2 changed files with 29 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import org.springframework.data.domain.Pageable
import org.springframework.security.core.annotation.AuthenticationPrincipal import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController import org.springframework.web.bind.annotation.RestController
@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
)
)
}
} }

View File

@ -200,4 +200,16 @@ class AudioContentMainTabSeriesService(
return GetSeriesListResponse(totalCount, items) return GetSeriesListResponse(totalCount, items)
} }
fun getRecommendSeriesListByGenre(
genreId: Long,
memberId: Long,
isAdult: Boolean
): List<GetSeriesListResponse.SeriesListItem> {
return rankingService.getSeriesAllRankingByGenre(
memberId = memberId,
isAdult = isAdult,
genreId = genreId
)
}
} }