콘텐츠 메인 시리즈 탭
- 완결 시리즈 전체보기 API
This commit is contained in:
@@ -37,4 +37,21 @@ class AudioContentMainTabSeriesController(private val service: AudioContentMainT
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@GetMapping("/completed-monthly-rank")
|
||||
fun getRankMonthlyCompletedSeriesList(
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||
pageable: Pageable
|
||||
) = run {
|
||||
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||
|
||||
ApiResponse.ok(
|
||||
service.getRankMonthlyCompletedSeriesList(
|
||||
memberId = member.id!!,
|
||||
isAdult = member.auth != null,
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@@ -166,4 +166,38 @@ class AudioContentMainTabSeriesService(
|
||||
|
||||
return GetSeriesListResponse(totalCount, items)
|
||||
}
|
||||
|
||||
fun getRankMonthlyCompletedSeriesList(
|
||||
memberId: Long,
|
||||
isAdult: Boolean,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
): GetSeriesListResponse {
|
||||
val monthlyRankingStartDate = LocalDateTime.now()
|
||||
.withDayOfMonth(1)
|
||||
.withHour(15)
|
||||
.withMinute(0)
|
||||
.withSecond(0)
|
||||
.minusDays(1)
|
||||
val monthlyRankingEndDate = monthlyRankingStartDate
|
||||
.plusMonths(1)
|
||||
|
||||
val totalCount = rankingService.getCompleteSeriesRankingTotalCount(
|
||||
memberId = memberId,
|
||||
isAdult = isAdult,
|
||||
startDate = monthlyRankingStartDate,
|
||||
endDate = monthlyRankingEndDate
|
||||
)
|
||||
|
||||
val items = rankingService.getCompleteSeriesRanking(
|
||||
memberId = memberId,
|
||||
isAdult = isAdult,
|
||||
startDate = monthlyRankingStartDate,
|
||||
endDate = monthlyRankingEndDate,
|
||||
offset = offset,
|
||||
limit = limit
|
||||
)
|
||||
|
||||
return GetSeriesListResponse(totalCount, items)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user