test #366

Merged
klaus merged 3 commits from test into main 2025-11-20 06:27:03 +00:00
3 changed files with 9 additions and 1 deletions
Showing only changes of commit b6eb13df06 - Show all commits

View File

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

View File

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

View File

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