Skip to content

Commit 7d3b4e8

Browse files
committed
update api endpoints
1 parent bd858b2 commit 7d3b4e8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

server/src/main/scala/app/softnetwork/api/server/ApiEndpoints.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ package app.softnetwork.api.server
22

33
import akka.actor.typed.ActorSystem
44
import akka.http.scaladsl.server.Route
5+
import sttp.tapir.server.ServerEndpoint
56

6-
import scala.concurrent.ExecutionContext
7+
import scala.concurrent.{ExecutionContext, Future}
78

8-
trait ApiEndpoints extends ApiEndpoint with ApiRoutes {
9+
trait ApiEndpoints extends ApiRoutes {
10+
11+
import ApiEndpoint._
12+
13+
def endPoints: ActorSystem[_] => List[ServerEndpoint[Any, Future]]
914

1015
override def apiRoutes(system: ActorSystem[_]): Route = {
1116
implicit def ec: ExecutionContext = system.executionContext
12-
apiRoute ~ swaggerRoute
17+
val routes = endPoints(system)
18+
routes ++ endpointsToSwaggerEndpoints(routes)
1319
}
1420

1521
}

0 commit comments

Comments
 (0)