remove unneeded memes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-08-13 14:24:37 +02:00
parent 1ac8eaa49c
commit c6d2b85876
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 0 additions and 61 deletions

View File

@ -5,12 +5,4 @@ import api.ApiObject
interface IResultObjectService{
fun addOne(apiObject: ApiObject)
suspend fun getAllResultObjects(): List<ApiObject>
suspend fun getResultObjectbyTag(tag: String): ApiObject?
suspend fun getResultObjectbyDate(date: LocalDate): List<ApiObject>?
suspend fun getResultObjectbeforeDate(date: LocalDate): List<ApiObject>?
suspend fun getResultObjectafterDate(date: LocalDate): List<ApiObject>?
suspend fun getResultObjecGreaterthanProbability(probability: Double): List<ApiObject>?
suspend fun getResultObjecLessthanProbability(probability: Double): List<ApiObject>?
suspend fun getResultObjecEqualsProbability(probability: Double): List<ApiObject>?
}

View File

@ -20,57 +20,4 @@ class ResultObjectService : IResultObjectService {
}
}
}
override suspend fun getAllResultObjects(): List<ApiObject> = dbQuery {
ResultObjects.selectAll().map { toResultObject(it) }
}
override suspend fun getResultObjectbyTag(tag: String): ApiObject? = dbQuery {
ResultObjects.select {
(ResultObjects.tag eq tag)
}.mapNotNull { toResultObject(it) }
.singleOrNull()
}
override suspend fun getResultObjectbyDate(date: LocalDate): List<ApiObject>? = dbQuery {
ResultObjects.select {
(ResultObjects.date eq date)
}.mapNotNull { toResultObject(it) }
}
override suspend fun getResultObjectbeforeDate(date: LocalDate): List<ApiObject>? = dbQuery {
ResultObjects.select {
(ResultObjects.date less date)
}.mapNotNull { toResultObject(it) }
}
override suspend fun getResultObjectafterDate(date: LocalDate): List<ApiObject>? = dbQuery {
ResultObjects.select {
(ResultObjects.date greater date)
}.mapNotNull { toResultObject(it) }
}
override suspend fun getResultObjecGreaterthanProbability(probability: Double): List<ApiObject>? = dbQuery {
ResultObjects.select {
(ResultObjects.probability greater probability)
}.mapNotNull { toResultObject(it) }
}
override suspend fun getResultObjecLessthanProbability(probability: Double): List<ApiObject>? = dbQuery {
ResultObjects.select {
(ResultObjects.probability less probability)
}.mapNotNull { toResultObject(it) }
}
override suspend fun getResultObjecEqualsProbability(probability: Double): List<ApiObject>? = dbQuery {
ResultObjects.select {
(ResultObjects.probability eq probability)
}.mapNotNull { toResultObject(it) }
}
private fun toResultObject(row: ResultRow): ApiObject =
ApiObject(
tag = row[ResultObjects.tag],
probability = row[ResultObjects.probability]
)
}