package ge.edu.freeuni.sdp.iot.simulator.bath.service;

import ge.edu.freeuni.sdp.iot.simulator.bath.jaxb.LightSwitchPostRequest;
import ge.edu.freeuni.sdp.iot.simulator.bath.model.Bathroom;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

public class BathroomService {

<<<<<<< HEAD

=======
    @POST
    @Path("/light-switch")
    @Consumes({MediaType.APPLICATION_JSON})
    public void switchLight(final LightSwitchPostRequest request) {
        if (request.status.equals("ON")) {
            Bathroom.getInstance().turnLightOn();
        }
        else if (request.status.equals("OFF")) {
            Bathroom.getInstance().turnLightOff();
        }
    }
>>>>>>> 0c1e898dfc032a39b0c4341cc8b950c38df481a7
}

@@ -279,29 +279,8 @@
  %7B%0A%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A%0A=======
 %0A   
@@ -648,55 +648,363 @@
   %7D%0A
-%3E%3E%3E%3E%3E%3E%3E 0c1e898dfc032a39b0c4341cc8b950c38df481a7
+%0A    @POST%0A    @Path(%22/%22)%0A    @Consumes(%7BMediaType.APPLICATION_JSON%7D)%0A    public void switchLight(final LightSwitchPostRequest request) %7B%0A        if (request.status.equals(%22ON%22)) %7B%0A            Bathroom.getInstance().turnLightOn();%0A        %7D%0A        else if (request.status.equals(%22OFF%22)) %7B%0A            Bathroom.getInstance().turnLightOff();%0A        %7D%0A    %7D
 %0A%7D%0A

add local changes