|
@@ -4,9 +4,11 @@ import java.util.List;
|
|
|
|
|
|
import javax.ws.rs.GET;
|
|
|
import javax.ws.rs.Path;
|
|
|
+import javax.ws.rs.PathParam;
|
|
|
import javax.ws.rs.Produces;
|
|
|
|
|
|
import org.json.JSONArray;
|
|
|
+import org.json.JSONObject;
|
|
|
|
|
|
import microfolie.service.EspaceService;
|
|
|
import microfolie.service.dto.EspaceDTO;
|
|
@@ -25,5 +27,13 @@ public class EspaceController {
|
|
|
JSONArray data = new JSONArray(espaces);
|
|
|
return JsonUtils.success(data).toString();
|
|
|
}
|
|
|
+
|
|
|
+ @GET
|
|
|
+ @Path("/get/{code}")
|
|
|
+ public String getByCode(@PathParam("code") String code) {
|
|
|
+ EspaceDTO espace = service.getByCode(code);
|
|
|
+ JSONObject data = new JSONObject(espace);
|
|
|
+ return JsonUtils.success(data).toString();
|
|
|
+ }
|
|
|
|
|
|
}
|