diff --git a/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java b/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java index 0e04dd8..0dc1498 100644 --- a/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java +++ b/src/main/java/org/example/tampoposerverdtram/resources/ChatRooms.java @@ -80,4 +80,19 @@ Entity
entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED); String result = client.target("http://localhost:8080").path("/roomId").request().post(entity, String.class); } + @Path("/{chatRoomId}") + @POST + public void addChatRoomMember(@PathParam("chatRoomId") String chatRoomId, @FormParam("userId") String userId) { + Map> users_json = client.target("http://localhost:8080").path("/users").request().get(HashMap.class); + Map> users = new HashMap<>(); + users = users_json; + Map temp_if28; + if (users.containsKey(userId)) { + temp_if28 = this.value.get(chatRoomId); + temp_if28.put(userId,null); + } else { + temp_if28 = this.value.get(chatRoomId); + } + this.value.put(chatRoomId,temp_if28); + } } \ No newline at end of file