initial commit

This commit is contained in:
2020-04-04 18:47:24 +02:00
commit 97b5923c1e
22 changed files with 1333 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
package com.kmalbz
import io.ktor.client.*
import io.ktor.client.request.*
/**
* Output Service - RDB Client
*
* This is the feature extraction interface of the Birbnetes system.
*/
open class OutputServiceRDBClient(val endpoint: String, val client: HttpClient = HttpClient()) {
/**
* Get all negative decision objects
*
* @return Array of decision objects
*/
suspend fun getallnegative(
): List<OutputObject> {
return client.get<List<OutputObject>>("$endpoint/output/filter/negative") {
}
}
/**
* Get positive decision objects
*
* @return Array of decision objects
*/
suspend fun getallpositive(
): List<OutputObject> {
return client.get<List<OutputObject>>("$endpoint/output/filter/positive") {
}
}
/**
* Get decision before a date
*
* @param dateAfter Date of filter
*
* @return Array of decision objects
*/
suspend fun getallafter(
dateAfter: Date // PATH
): List<OutputObject> {
return client.get<List<OutputObject>>("$endpoint/output/after/$dateAfter") {
}
}
/**
* Get decision before a date
*
* @param dateBefore Date of filter
*
* @return Array of decision objects
*/
suspend fun getallbefore(
dateBefore: Date // PATH
): List<OutputObject> {
return client.get<List<OutputObject>>("$endpoint/output/before/$dateBefore") {
}
}
/**
* Get decision by ID
*
* @param tagID ID of wave file
*
* @return Decision object
*/
suspend fun getDecision(
tagID: Int // PATH
): OutputObject {
return client.get<OutputObject>("$endpoint/output/$tagID") {
}
}
}