feat(content-sort-type): 콘텐츠 정렬 타입 인기순(POPULARITY) 추가
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user