Skip to content

Commit 4703808

Browse files
chore: call create room service from api
1 parent e334afc commit 4703808

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/kotlin/infrastructure/api/APIController.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88

99
package infrastructure.api
1010

11+
import application.controller.RoomController
1112
import application.presenter.api.deserializer.ApiDeserializer.toRoom
1213
import application.presenter.api.model.RoomApiDto
14+
import application.service.Service
15+
import infrastructure.provider.ManagerProvider
1316
import io.ktor.serialization.kotlinx.json.json
1417
import io.ktor.server.application.Application
1518
import io.ktor.server.application.call
@@ -27,8 +30,9 @@ import io.ktor.server.routing.routing
2730

2831
/**
2932
* It manages the REST-API of the microservice.
33+
* @param[provider] the provider of managers.
3034
*/
31-
class APIController {
35+
class APIController(private val provider: ManagerProvider) {
3236
/**
3337
* Starts the http server to serve the client requests.
3438
*/
@@ -69,6 +73,7 @@ class APIController {
6973
2. creo il digital twin su Azure Digital Twins
7074
*/
7175
val room = call.receive<RoomApiDto>().toRoom()
76+
Service.CreateRoom(room, RoomController(provider.roomDigitalTwinManager))
7277
call.respondText("[${Thread.currentThread().name}] Room POST! \n$room")
7378
}
7479
get("$apiPath/rooms/{roomId}") {

0 commit comments

Comments
 (0)