From 44c38412cf209538b6613785baf73a51cb90f98d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 24 Feb 2023 11:57:01 +0100 Subject: [PATCH] WIP --- .../chat/backend/api/ChatBackendController.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 482e1f96..2c54afd7 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 @@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.util.Arrays; import java.util.UUID; @@ -21,7 +20,6 @@ public class ChatBackendController private final ChatHome chatHome; private final ChatRoomFactory factory; private final StorageStrategy storageStrategy; - private final int[] ownedShards; @PostMapping("create") @@ -34,11 +32,11 @@ public class ChatBackendController } - @GetMapping("list/{shard}") - public Flux list(@PathVariable int shard) + @GetMapping("list") + public Flux list() { return chatHome - .getChatRooms(shard) + .getChatRooms() .map(chatroom -> ChatRoomInfoTo.from(chatroom)); } @@ -136,8 +134,6 @@ public class ChatBackendController @PostMapping("/store") public void store() { - Arrays - .stream(ownedShards) - .forEach(i -> storageStrategy.write(chatHome.getChatRooms(i))); // TODO: Sharded Storage + storageStrategy.write(chatHome.getChatRooms()); } } -- 2.20.1