parent
a8589ef4e7
commit
9c9aa33687
|
@ -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
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -200,4 +200,16 @@ class AudioContentMainTabSeriesService(
|
|||
|
||||
return GetSeriesListResponse(totalCount, items)
|
||||
}
|
||||
|
||||
fun getRecommendSeriesListByGenre(
|
||||
genreId: Long,
|
||||
memberId: Long,
|
||||
isAdult: Boolean
|
||||
): List<GetSeriesListResponse.SeriesListItem> {
|
||||
return rankingService.getSeriesAllRankingByGenre(
|
||||
memberId = memberId,
|
||||
isAdult = isAdult,
|
||||
genreId = genreId
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue