package com.beauchef.rest;

import com.beauchef.service.CalculatorService;
import com.beauchef.service.CounterService;

import javax.inject.Inject;
import javax.naming.NamingException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by jean- on 2016-03-06.
 */
@Path("/count")
public class CounterResource {

    @Inject
    CounterService counter;

    @GET
    @Path("/inc/{n}")
    @Produces({ "application/json" })
    public Response inc(@PathParam("n") int n) {
        try {
            return Response.status(200).entity(counter.inc(n)).build();
        } catch (NamingException nex) {
            return Response.serverError().build();
        }
    }

    @GET
    @Path("/dec/{n}")
    @Produces({ "application/json" })
    public Response dec(@PathParam("n") int n) {
        try {
            return Response.status(200).entity(counter.dec(n)).build();
        } catch (NamingException nex) {
            return Response.serverError().build();
        }
    }

}

@@ -27,56 +27,8 @@
 %0D%0A%0D%0A
-import com.beauchef.service.CalculatorService;%0D%0A
 impo
@@ -287,61 +287,8 @@
 se;%0D
-%0Aimport java.util.ArrayList;%0D%0Aimport java.util.List;%0D
 %0A%0D%0A/

Clean up