X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2Fapi%2FChatBackendController.java;h=17d2b1f53d67c130ca1c976cba5d7ab82fe5a0f5;hb=0daa9d1a4d6f6b95ffdb42fcf1350ff26a9166e0;hp=437ff1f746c4ba4ab006e116c7022f618cf7c321;hpb=f0113ff34d7a4147ce54116680b611061244f39a;p=demos%2Fkafka%2Fchat diff --git a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java index 437ff1f7..17d2b1f5 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java +++ b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java @@ -1,6 +1,7 @@ package de.juplo.kafka.chat.backend.api; import de.juplo.kafka.chat.backend.domain.Chatroom; +import de.juplo.kafka.chat.backend.domain.PersistenceStrategy; import lombok.RequiredArgsConstructor; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.*; @@ -20,13 +21,14 @@ import java.util.UUID; public class ChatBackendController { private final Map chatrooms = new HashMap<>(); + private final PersistenceStrategy persistenceStrategy; private final Clock clock; @PostMapping("create") public Chatroom create(@RequestBody String name) { - Chatroom chatroom = new Chatroom(UUID.randomUUID(), name); + Chatroom chatroom = new Chatroom(UUID.randomUUID(), name, persistenceStrategy); chatrooms.put(chatroom.getId(), chatroom); return chatroom; }