|
@@ -0,0 +1,23 @@
|
|
|
+package microfolie.entry.rest;
|
|
|
+
|
|
|
+import javax.ws.rs.GET;
|
|
|
+import javax.ws.rs.Path;
|
|
|
+import javax.ws.rs.PathParam;
|
|
|
+import javax.ws.rs.Produces;
|
|
|
+
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
+@Path("/badge")
|
|
|
+@Produces("application/json")
|
|
|
+public class BadgeController {
|
|
|
+
|
|
|
+ @GET
|
|
|
+ @Path("/{espace}/{code}")
|
|
|
+ public String scanner(@PathParam("espace") String espace, @PathParam("code") String code) {
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("espace", espace);
|
|
|
+ json.put("code", code);
|
|
|
+ return json.toString(2);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|