WIP
authorKai Moritz <kai@juplo.de>
Fri, 24 Feb 2023 10:57:01 +0000 (11:57 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 24 Feb 2023 10:57:01 +0000 (11:57 +0100)
src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java

index 482e1f9..2c54afd 100644 (file)
@@ -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<ChatRoomInfoTo> list(@PathVariable int shard)
+  @GetMapping("list")
+  public Flux<ChatRoomInfoTo> 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());
   }
 }