Compare commits

..

2 Commits

Author SHA1 Message Date
Klaus 60ce64d3e1 콘텐츠 메인 시리즈 탭 - 오리지널 콘텐츠 API
- id 내림차순 정렬
2025-02-14 04:57:41 +09:00
Klaus 9c9aa33687 콘텐츠 메인 시리즈 탭
- 장르별 추천 시리즈 API
2025-02-14 04:50:13 +09:00
3 changed files with 30 additions and 1 deletions

View File

@ -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
)
)
}
}

View File

@ -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
)
}
}

View File

@ -162,7 +162,7 @@ class ContentSeriesQueryRepositoryImpl(
.innerJoin(series.member, member)
.leftJoin(blockMember).on(blockMemberCondition)
.where(where)
.orderBy(Expressions.numberTemplate(Double::class.java, "function('rand')").asc())
.orderBy(series.id.desc())
.offset(offset)
.limit(limit)
.fetch()