diff --git a/src/main/java/com/ntlab/irisserver/resources/RoomsRest.java b/src/main/java/com/ntlab/irisserver/resources/RoomsRest.java new file mode 100644 index 0000000..5343568 --- /dev/null +++ b/src/main/java/com/ntlab/irisserver/resources/RoomsRest.java @@ -0,0 +1,34 @@ +package com.ntlab.irisserver.resources; +import org.springframework.stereotype.Component; +import com.ntlab.irisserver.entities.Room; +import com.ntlab.irisserver.models.RoomManager; + +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; + +@Component +@Path("/rooms") +@Produces(MediaType.APPLICATION_JSON) + +public class RoomsRest { + + @POST + @Path("/") + public Room makeRooms(@FormParam("nickname") String ownername){ + RoomManager rm = RoomManager.getInstance(); + Room room = rm.createRoom(ownername); + + return room; + } + + @GET + @Path("/{rid}") + public Room getRoomMenber(@PathParam("rid") String rid){ + RoomManager rm = RoomManager.getInstance(); + Room room = rm.getRoom(rid); + + return room; + } + +} +