@GET @Path("/like/{reqUrl}") @Produces("application/plain-text") public Response likePoi(@PathParam("reqUrl") String req) { // Parse req String[] reqs = req.split("\\+"); PlusOne plus = new PlusOne(Long.valueOf(reqs[0]), reqs[1], Boolean.valueOf(reqs[2])); PoiData poidata = dao.findPoiById(plus.getPoId()); poidata.updateSum(plus.getBool()); return Response.ok().build(); }
@GET @Path("/poi/{requestUrl}") @Produces("application/json") public ResponseConverter getClosestPOI(@PathParam("requestUrl") String req) { // Parse requestUrl String[] reqs = req.split("\\+"); Double radius = Double.valueOf(reqs[2]); // String category = reqs[3]; PoiData poiData = new PoiData(); poiData.setLatitude(Double.valueOf(reqs[0])); poiData.setLongitude(Double.valueOf(reqs[1])); // find the closest neighbors List<ResponseData> responses = dao.findData(poiData, radius); ResponseConverter rc = new ResponseConverter(); rc.setPoiDatas(responses); return rc; }