feat(content-sort-type): 콘텐츠 정렬 타입 인기순(POPULARITY) 추가

This commit is contained in:
2025-11-20 00:05:33 +09:00
parent a6b815ad05
commit b6eb13df06
3 changed files with 9 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ enum class PurchaseOption {
}
enum class SortType {
NEWEST, PRICE_HIGH, PRICE_LOW
NEWEST, PRICE_HIGH, PRICE_LOW, POPULARITY
}
@Entity

View File

@@ -241,6 +241,7 @@ class AudioContentQueryRepositoryImpl(
SortType.NEWEST -> audioContent.releaseDate.desc()
SortType.PRICE_HIGH -> audioContent.price.desc()
SortType.PRICE_LOW -> audioContent.price.asc()
SortType.POPULARITY -> audioContent.playCount.desc()
}
var where = audioContent.member.id.eq(creatorId)
@@ -462,6 +463,12 @@ class AudioContentQueryRepositoryImpl(
audioContent.releaseDate.asc(),
audioContent.id.asc()
)
SortType.POPULARITY -> listOf(
audioContent.playCount.desc(),
audioContent.releaseDate.asc(),
audioContent.id.asc()
)
}
var where = audioContent.isActive.isTrue

View File

@@ -58,6 +58,7 @@ class AudioContentCurationQueryRepository(private val queryFactory: JPAQueryFact
SortType.NEWEST -> audioContent.createdAt.desc()
SortType.PRICE_HIGH -> audioContent.price.desc()
SortType.PRICE_LOW -> audioContent.price.asc()
SortType.POPULARITY -> audioContent.playCount.desc()
}
var where = audioContent.isActive.isTrue