aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala')
-rw-r--r--src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala
index 1b8c943..a352053 100644
--- a/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala
+++ b/src/main/scala/xyz/driver/pdsuidomain/services/rest/RestHypothesisService.scala
@@ -1,14 +1,13 @@
package xyz.driver.pdsuidomain.services.rest
import scala.concurrent.{ExecutionContext, Future}
-
import akka.http.scaladsl.model._
import akka.stream.Materializer
import xyz.driver.core.rest._
import xyz.driver.pdsuicommon.auth._
import xyz.driver.pdsuicommon.db._
-import xyz.driver.pdsuidomain.formats.json.ListResponse
-import xyz.driver.pdsuidomain.formats.json.hypothesis.ApiHypothesis
+import xyz.driver.pdsuidomain.ListResponse
+import xyz.driver.pdsuidomain.entities.Hypothesis
import xyz.driver.pdsuidomain.services.HypothesisService
class RestHypothesisService(transport: ServiceTransport, baseUri: Uri)(
@@ -16,7 +15,9 @@ class RestHypothesisService(transport: ServiceTransport, baseUri: Uri)(
protected val exec: ExecutionContext)
extends HypothesisService with RestHelper {
- import xyz.driver.pdsuicommon.serialization.PlayJsonSupport._
+ import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport._
+ import xyz.driver.pdsuidomain.formats.json.listresponse._
+ import xyz.driver.pdsuidomain.formats.json.hypothesis._
import xyz.driver.pdsuidomain.services.HypothesisService._
def getAll(sorting: Option[Sorting] = None)(
@@ -24,9 +25,9 @@ class RestHypothesisService(transport: ServiceTransport, baseUri: Uri)(
val request = HttpRequest(HttpMethods.GET, endpointUri(baseUri, "/v1/hypothesis", sortingQuery(sorting)))
for {
response <- transport.sendRequestGetResponse(requestContext)(request)
- reply <- apiResponse[ListResponse[ApiHypothesis]](response)
+ reply <- apiResponse[ListResponse[Hypothesis]](response)
} yield {
- GetListReply.EntityList(reply.items.map(_.toDomain), reply.meta.itemsCount)
+ GetListReply.EntityList(reply.items, reply.meta.itemsCount)
}
}