mirror of
https://github.com/InsanusMokrassar/PlaguPoster.git
synced 2026-01-04 11:09:14 +00:00
add selector
This commit is contained in:
@@ -7,4 +7,6 @@ import kotlin.jvm.JvmInline
|
||||
@JvmInline
|
||||
value class Rating(
|
||||
val double: Double
|
||||
)
|
||||
) : Comparable<Rating> {
|
||||
override fun compareTo(other: Rating): Int = double.compareTo(other.double)
|
||||
}
|
||||
|
||||
@@ -4,4 +4,24 @@ import dev.inmo.micro_utils.repos.ReadKeyValueRepo
|
||||
import dev.inmo.plaguposter.posts.models.PostId
|
||||
import dev.inmo.plaguposter.ratings.models.Rating
|
||||
|
||||
interface ReadRatingsRepo : ReadKeyValueRepo<PostId, Rating>
|
||||
interface ReadRatingsRepo : ReadKeyValueRepo<PostId, Rating> {
|
||||
suspend fun getPosts(
|
||||
range: ClosedRange<Rating>,
|
||||
reversed: Boolean = false,
|
||||
count: Int? = null,
|
||||
exclude: List<PostId> = emptyList()
|
||||
): Map<PostId, Rating>
|
||||
|
||||
suspend fun getPostsWithRatingGreaterEq(
|
||||
then: Rating,
|
||||
reversed: Boolean = false,
|
||||
count: Int? = null,
|
||||
exclude: List<PostId> = emptyList()
|
||||
): Map<PostId, Rating>
|
||||
suspend fun getPostsWithRatingLessEq(
|
||||
then: Rating,
|
||||
reversed: Boolean = false,
|
||||
count: Int? = null,
|
||||
exclude: List<PostId> = emptyList()
|
||||
): Map<PostId, Rating>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user