diff --git a/build.sbt b/build.sbt index 7dd1a4d..6ab419a 100644 --- a/build.sbt +++ b/build.sbt @@ -31,7 +31,7 @@ ThisBuild / organization := "app.softnetwork" name := "generic-sequence-api" -ThisBuild / version := "0.2.0.1" +ThisBuild / version := "0.3.0" ThisBuild / scalaVersion := "2.12.15" @@ -54,9 +54,9 @@ val scalatest = Seq( ThisBuild / libraryDependencies ++= Seq( "com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf", "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.1", - "app.softnetwork.api" %% "generic-server-api" % Versions.server, - "app.softnetwork.api" %% "generic-server-api-testkit" % Versions.server % Test, - "app.softnetwork.protobuf" %% "scalapb-extensions" % "0.1.6" + "app.softnetwork.api" %% "generic-server-api" % Versions.genericPersistence, + "app.softnetwork.api" %% "generic-server-api-testkit" % Versions.genericPersistence % Test, + "app.softnetwork.protobuf" %% "scalapb-extensions" % "0.1.7" ) ++ scalatest Compile / unmanagedResourceDirectories += baseDirectory.value / "src/main/protobuf" diff --git a/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala b/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala index c5705c6..635a2a1 100644 --- a/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala +++ b/project/src/main/scala/app/softnetwork/sbt/build/Versions.scala @@ -2,9 +2,7 @@ package app.softnetwork.sbt.build object Versions { - val genericPersistence = "0.3.0.3" - - val server = "0.3.0.3" + val genericPersistence = "0.3.5" val scalatest = "3.1.1" } diff --git a/src/main/scala/app/softnetwork/sequence/launch/SequenceRoutes.scala b/src/main/scala/app/softnetwork/sequence/launch/SequenceRoutes.scala index ebc6851..2579fd2 100644 --- a/src/main/scala/app/softnetwork/sequence/launch/SequenceRoutes.scala +++ b/src/main/scala/app/softnetwork/sequence/launch/SequenceRoutes.scala @@ -1,14 +1,13 @@ package app.softnetwork.sequence.launch import akka.actor.typed.ActorSystem -import akka.http.scaladsl.server.Route -import app.softnetwork.api.server.ApiRoutes +import app.softnetwork.api.server.{ApiRoute, ApiRoutes} import app.softnetwork.sequence.service.SequenceService /** Created by smanciot on 07/04/2022. */ trait SequenceRoutes extends ApiRoutes { - override def apiRoutes(system: ActorSystem[_]): Route = SequenceService(system).route - + override def apiRoutes: ActorSystem[_] => List[ApiRoute] = + system => List(SequenceService(system)) } diff --git a/src/main/scala/app/softnetwork/sequence/service/SequenceService.scala b/src/main/scala/app/softnetwork/sequence/service/SequenceService.scala index 9a1af61..cc4e206 100644 --- a/src/main/scala/app/softnetwork/sequence/service/SequenceService.scala +++ b/src/main/scala/app/softnetwork/sequence/service/SequenceService.scala @@ -4,7 +4,7 @@ import akka.actor.typed.ActorSystem import akka.http.scaladsl.model.ContentTypes._ import akka.http.scaladsl.model.{HttpEntity, HttpResponse, StatusCodes} import akka.http.scaladsl.server.{Directives, Route} -import app.softnetwork.api.server.DefaultComplete +import app.softnetwork.api.server.{ApiRoute, DefaultComplete} import app.softnetwork.persistence.service.Service import app.softnetwork.sequence.handlers.{GenericSequenceHandler, SequenceHandler} import app.softnetwork.sequence.message._ @@ -17,8 +17,8 @@ import org.slf4j.{Logger, LoggerFactory} trait GenericSequenceService extends Service[SequenceCommand, SequenceResult] with Directives - with DefaultComplete { - _: GenericSequenceHandler => + with DefaultComplete + with ApiRoute { _: GenericSequenceHandler => implicit def formats: Formats = commonFormats