{"action":"created","comment":{"url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/comments/297451821","pull_request_review_id":254339473,"id":297451821,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI5NzQ1MTgyMQ==","diff_hunk":"@@ -0,0 +1,73 @@\n+package com.google.codeu.servlets;\n+\n+import java.io.IOException;\n+import javax.servlet.annotation.WebServlet;\n+import javax.servlet.http.HttpServlet;\n+import javax.servlet.http.HttpServletRequest;\n+import javax.servlet.http.HttpServletResponse;\n+import com.google.appengine.api.datastore.DatastoreService;\n+import com.google.appengine.api.datastore.DatastoreServiceFactory;\n+import com.google.appengine.api.datastore.Entity;\n+import com.google.appengine.api.datastore.PreparedQuery;\n+import com.google.appengine.api.datastore.Query;\n+import com.google.codeu.data.Marker;\n+import com.google.gson.Gson;\n+import java.util.ArrayList;\n+import java.util.List;\n+import org.jsoup.Jsoup;\n+import org.jsoup.safety.Whitelist;\n+\n+@WebServlet(\"/markers\")\n+public class MarkerServlet extends HttpServlet {\n+  private DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n+\n+  /** Responds with a JSON array containing marker data. */\n+  @Override\n+  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n+    response.setContentType(\"application/json\");\n+\n+    List<Marker> markers = getMarkers();\n+    Gson gson = new Gson();\n+    String json = gson.toJson(markers);\n+\n+    response.getOutputStream().println(json);\n+  }\n+\n+  /** Accepts a POST request containing a new marker. */\n+  @Override\n+  public void doPost(HttpServletRequest request, HttpServletResponse response) {\n+    double lat = Double.parseDouble(request.getParameter(\"lat\"));\n+    double lng = Double.parseDouble(request.getParameter(\"lng\"));\n+    String content = Jsoup.clean(request.getParameter(\"content\"), Whitelist.none());\n+\n+    Marker marker = new Marker(lat, lng, content);\n+    storeMarker(marker);\n+  }\n+\n+  /** Fetches markers from Datastore. */\n+  private List<Marker> getMarkers() {\n+    List<Marker> markers = new ArrayList<>();\n+    Query query = new Query(\"Marker\");\n+    PreparedQuery results = datastore.prepare(query);\n+\n+    for (Entity entity : results.asIterable()) {\n+      double lat = (double) entity.getProperty(\"lat\");\n+      double lng = (double) entity.getProperty(\"lng\");\n+      String content = (String) entity.getProperty(\"content\");\n+\n+      Marker marker = new Marker(lat, lng, content);\n+      markers.add(marker);\n+    }\n+    return markers;\n+  }\n+\n+  /** Stores a marker in Datastore. */\n+  public void storeMarker(Marker marker) {\n+    Entity markerEntity = new Entity(\"Marker\");","path":"src/main/java/com/google/codeu/servlets/MarkerServlet.java","position":66,"original_position":66,"commit_id":"8c8b56461cf2e077cf58a20fd3d2fb87ea66f0dd","original_commit_id":"8c8b56461cf2e077cf58a20fd3d2fb87ea66f0dd","user":{"login":"potay","id":2226407,"node_id":"MDQ6VXNlcjIyMjY0MDc=","avatar_url":"https://avatars1.githubusercontent.com/u/2226407?v=4","gravatar_id":"","url":"https://api.github.com/users/potay","html_url":"https://github.com/potay","followers_url":"https://api.github.com/users/potay/followers","following_url":"https://api.github.com/users/potay/following{/other_user}","gists_url":"https://api.github.com/users/potay/gists{/gist_id}","starred_url":"https://api.github.com/users/potay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/potay/subscriptions","organizations_url":"https://api.github.com/users/potay/orgs","repos_url":"https://api.github.com/users/potay/repos","events_url":"https://api.github.com/users/potay/events{/privacy}","received_events_url":"https://api.github.com/users/potay/received_events","type":"User","site_admin":false},"body":"Suggestion: make `\"Marker\"` a class constant: `Marker.ENTITY_KIND`","created_at":"2019-06-26T01:17:32Z","updated_at":"2019-06-26T01:30:32Z","html_url":"https://github.com/Reine0017/team-36-codeu/pull/18#discussion_r297451821","pull_request_url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/comments/297451821"},"html":{"href":"https://github.com/Reine0017/team-36-codeu/pull/18#discussion_r297451821"},"pull_request":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18","id":290822501,"node_id":"MDExOlB1bGxSZXF1ZXN0MjkwODIyNTAx","html_url":"https://github.com/Reine0017/team-36-codeu/pull/18","diff_url":"https://github.com/Reine0017/team-36-codeu/pull/18.diff","patch_url":"https://github.com/Reine0017/team-36-codeu/pull/18.patch","issue_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/18","number":18,"state":"open","locked":false,"title":"Add editable markers to map (maps3)","user":{"login":"jiangyue12392","id":35633013,"node_id":"MDQ6VXNlcjM1NjMzMDEz","avatar_url":"https://avatars2.githubusercontent.com/u/35633013?v=4","gravatar_id":"","url":"https://api.github.com/users/jiangyue12392","html_url":"https://github.com/jiangyue12392","followers_url":"https://api.github.com/users/jiangyue12392/followers","following_url":"https://api.github.com/users/jiangyue12392/following{/other_user}","gists_url":"https://api.github.com/users/jiangyue12392/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangyue12392/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangyue12392/subscriptions","organizations_url":"https://api.github.com/users/jiangyue12392/orgs","repos_url":"https://api.github.com/users/jiangyue12392/repos","events_url":"https://api.github.com/users/jiangyue12392/events{/privacy}","received_events_url":"https://api.github.com/users/jiangyue12392/received_events","type":"User","site_admin":false},"body":"","created_at":"2019-06-22T13:07:56Z","updated_at":"2019-06-26T01:30:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ff7ed46cce3e14dcec10e7b18f7d91fb7928a926","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Reine0017","id":26247692,"node_id":"MDQ6VXNlcjI2MjQ3Njky","avatar_url":"https://avatars2.githubusercontent.com/u/26247692?v=4","gravatar_id":"","url":"https://api.github.com/users/Reine0017","html_url":"https://github.com/Reine0017","followers_url":"https://api.github.com/users/Reine0017/followers","following_url":"https://api.github.com/users/Reine0017/following{/other_user}","gists_url":"https://api.github.com/users/Reine0017/gists{/gist_id}","starred_url":"https://api.github.com/users/Reine0017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reine0017/subscriptions","organizations_url":"https://api.github.com/users/Reine0017/orgs","repos_url":"https://api.github.com/users/Reine0017/repos","events_url":"https://api.github.com/users/Reine0017/events{/privacy}","received_events_url":"https://api.github.com/users/Reine0017/received_events","type":"User","site_admin":false},{"login":"Meg1456","id":35777374,"node_id":"MDQ6VXNlcjM1Nzc3Mzc0","avatar_url":"https://avatars2.githubusercontent.com/u/35777374?v=4","gravatar_id":"","url":"https://api.github.com/users/Meg1456","html_url":"https://github.com/Meg1456","followers_url":"https://api.github.com/users/Meg1456/followers","following_url":"https://api.github.com/users/Meg1456/following{/other_user}","gists_url":"https://api.github.com/users/Meg1456/gists{/gist_id}","starred_url":"https://api.github.com/users/Meg1456/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meg1456/subscriptions","organizations_url":"https://api.github.com/users/Meg1456/orgs","repos_url":"https://api.github.com/users/Meg1456/repos","events_url":"https://api.github.com/users/Meg1456/events{/privacy}","received_events_url":"https://api.github.com/users/Meg1456/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18/commits","review_comments_url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18/comments","review_comment_url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/18/comments","statuses_url":"https://api.github.com/repos/Reine0017/team-36-codeu/statuses/8c8b56461cf2e077cf58a20fd3d2fb87ea66f0dd","head":{"label":"Reine0017:maps3","ref":"maps3","sha":"8c8b56461cf2e077cf58a20fd3d2fb87ea66f0dd","user":{"login":"Reine0017","id":26247692,"node_id":"MDQ6VXNlcjI2MjQ3Njky","avatar_url":"https://avatars2.githubusercontent.com/u/26247692?v=4","gravatar_id":"","url":"https://api.github.com/users/Reine0017","html_url":"https://github.com/Reine0017","followers_url":"https://api.github.com/users/Reine0017/followers","following_url":"https://api.github.com/users/Reine0017/following{/other_user}","gists_url":"https://api.github.com/users/Reine0017/gists{/gist_id}","starred_url":"https://api.github.com/users/Reine0017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reine0017/subscriptions","organizations_url":"https://api.github.com/users/Reine0017/orgs","repos_url":"https://api.github.com/users/Reine0017/repos","events_url":"https://api.github.com/users/Reine0017/events{/privacy}","received_events_url":"https://api.github.com/users/Reine0017/received_events","type":"User","site_admin":false},"repo":{"id":186204883,"node_id":"MDEwOlJlcG9zaXRvcnkxODYyMDQ4ODM=","name":"team-36-codeu","full_name":"Reine0017/team-36-codeu","private":false,"owner":{"login":"Reine0017","id":26247692,"node_id":"MDQ6VXNlcjI2MjQ3Njky","avatar_url":"https://avatars2.githubusercontent.com/u/26247692?v=4","gravatar_id":"","url":"https://api.github.com/users/Reine0017","html_url":"https://github.com/Reine0017","followers_url":"https://api.github.com/users/Reine0017/followers","following_url":"https://api.github.com/users/Reine0017/following{/other_user}","gists_url":"https://api.github.com/users/Reine0017/gists{/gist_id}","starred_url":"https://api.github.com/users/Reine0017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reine0017/subscriptions","organizations_url":"https://api.github.com/users/Reine0017/orgs","repos_url":"https://api.github.com/users/Reine0017/repos","events_url":"https://api.github.com/users/Reine0017/events{/privacy}","received_events_url":"https://api.github.com/users/Reine0017/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Reine0017/team-36-codeu","description":null,"fork":false,"url":"https://api.github.com/repos/Reine0017/team-36-codeu","forks_url":"https://api.github.com/repos/Reine0017/team-36-codeu/forks","keys_url":"https://api.github.com/repos/Reine0017/team-36-codeu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Reine0017/team-36-codeu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Reine0017/team-36-codeu/teams","hooks_url":"https://api.github.com/repos/Reine0017/team-36-codeu/hooks","issue_events_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/events{/number}","events_url":"https://api.github.com/repos/Reine0017/team-36-codeu/events","assignees_url":"https://api.github.com/repos/Reine0017/team-36-codeu/assignees{/user}","branches_url":"https://api.github.com/repos/Reine0017/team-36-codeu/branches{/branch}","tags_url":"https://api.github.com/repos/Reine0017/team-36-codeu/tags","blobs_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/refs{/sha}","trees_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Reine0017/team-36-codeu/statuses/{sha}","languages_url":"https://api.github.com/repos/Reine0017/team-36-codeu/languages","stargazers_url":"https://api.github.com/repos/Reine0017/team-36-codeu/stargazers","contributors_url":"https://api.github.com/repos/Reine0017/team-36-codeu/contributors","subscribers_url":"https://api.github.com/repos/Reine0017/team-36-codeu/subscribers","subscription_url":"https://api.github.com/repos/Reine0017/team-36-codeu/subscription","commits_url":"https://api.github.com/repos/Reine0017/team-36-codeu/commits{/sha}","git_commits_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/commits{/sha}","comments_url":"https://api.github.com/repos/Reine0017/team-36-codeu/comments{/number}","issue_comment_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/comments{/number}","contents_url":"https://api.github.com/repos/Reine0017/team-36-codeu/contents/{+path}","compare_url":"https://api.github.com/repos/Reine0017/team-36-codeu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Reine0017/team-36-codeu/merges","archive_url":"https://api.github.com/repos/Reine0017/team-36-codeu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Reine0017/team-36-codeu/downloads","issues_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues{/number}","pulls_url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls{/number}","milestones_url":"https://api.github.com/repos/Reine0017/team-36-codeu/milestones{/number}","notifications_url":"https://api.github.com/repos/Reine0017/team-36-codeu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Reine0017/team-36-codeu/labels{/name}","releases_url":"https://api.github.com/repos/Reine0017/team-36-codeu/releases{/id}","deployments_url":"https://api.github.com/repos/Reine0017/team-36-codeu/deployments","created_at":"2019-05-12T03:06:09Z","updated_at":"2019-06-25T09:55:43Z","pushed_at":"2019-06-25T14:17:21Z","git_url":"git://github.com/Reine0017/team-36-codeu.git","ssh_url":"git@github.com:Reine0017/team-36-codeu.git","clone_url":"https://github.com/Reine0017/team-36-codeu.git","svn_url":"https://github.com/Reine0017/team-36-codeu","homepage":null,"size":495,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":11,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"Reine0017:master","ref":"master","sha":"22de32a596ae94a6b3c8da8ef22f2d80e74a08dc","user":{"login":"Reine0017","id":26247692,"node_id":"MDQ6VXNlcjI2MjQ3Njky","avatar_url":"https://avatars2.githubusercontent.com/u/26247692?v=4","gravatar_id":"","url":"https://api.github.com/users/Reine0017","html_url":"https://github.com/Reine0017","followers_url":"https://api.github.com/users/Reine0017/followers","following_url":"https://api.github.com/users/Reine0017/following{/other_user}","gists_url":"https://api.github.com/users/Reine0017/gists{/gist_id}","starred_url":"https://api.github.com/users/Reine0017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reine0017/subscriptions","organizations_url":"https://api.github.com/users/Reine0017/orgs","repos_url":"https://api.github.com/users/Reine0017/repos","events_url":"https://api.github.com/users/Reine0017/events{/privacy}","received_events_url":"https://api.github.com/users/Reine0017/received_events","type":"User","site_admin":false},"repo":{"id":186204883,"node_id":"MDEwOlJlcG9zaXRvcnkxODYyMDQ4ODM=","name":"team-36-codeu","full_name":"Reine0017/team-36-codeu","private":false,"owner":{"login":"Reine0017","id":26247692,"node_id":"MDQ6VXNlcjI2MjQ3Njky","avatar_url":"https://avatars2.githubusercontent.com/u/26247692?v=4","gravatar_id":"","url":"https://api.github.com/users/Reine0017","html_url":"https://github.com/Reine0017","followers_url":"https://api.github.com/users/Reine0017/followers","following_url":"https://api.github.com/users/Reine0017/following{/other_user}","gists_url":"https://api.github.com/users/Reine0017/gists{/gist_id}","starred_url":"https://api.github.com/users/Reine0017/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reine0017/subscriptions","organizations_url":"https://api.github.com/users/Reine0017/orgs","repos_url":"https://api.github.com/users/Reine0017/repos","events_url":"https://api.github.com/users/Reine0017/events{/privacy}","received_events_url":"https://api.github.com/users/Reine0017/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Reine0017/team-36-codeu","description":null,"fork":false,"url":"https://api.github.com/repos/Reine0017/team-36-codeu","forks_url":"https://api.github.com/repos/Reine0017/team-36-codeu/forks","keys_url":"https://api.github.com/repos/Reine0017/team-36-codeu/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Reine0017/team-36-codeu/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Reine0017/team-36-codeu/teams","hooks_url":"https://api.github.com/repos/Reine0017/team-36-codeu/hooks","issue_events_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/events{/number}","events_url":"https://api.github.com/repos/Reine0017/team-36-codeu/events","assignees_url":"https://api.github.com/repos/Reine0017/team-36-codeu/assignees{/user}","branches_url":"https://api.github.com/repos/Reine0017/team-36-codeu/branches{/branch}","tags_url":"https://api.github.com/repos/Reine0017/team-36-codeu/tags","blobs_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/refs{/sha}","trees_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Reine0017/team-36-codeu/statuses/{sha}","languages_url":"https://api.github.com/repos/Reine0017/team-36-codeu/languages","stargazers_url":"https://api.github.com/repos/Reine0017/team-36-codeu/stargazers","contributors_url":"https://api.github.com/repos/Reine0017/team-36-codeu/contributors","subscribers_url":"https://api.github.com/repos/Reine0017/team-36-codeu/subscribers","subscription_url":"https://api.github.com/repos/Reine0017/team-36-codeu/subscription","commits_url":"https://api.github.com/repos/Reine0017/team-36-codeu/commits{/sha}","git_commits_url":"https://api.github.com/repos/Reine0017/team-36-codeu/git/commits{/sha}","comments_url":"https://api.github.com/repos/Reine0017/team-36-codeu/comments{/number}","issue_comment_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/comments{/number}","contents_url":"https://api.github.com/repos/Reine0017/team-36-codeu/contents/{+path}","compare_url":"https://api.github.com/repos/Reine0017/team-36-codeu/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Reine0017/team-36-codeu/merges","archive_url":"https://api.github.com/repos/Reine0017/team-36-codeu/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Reine0017/team-36-codeu/downloads","issues_url":"https://api.github.com/repos/Reine0017/team-36-codeu/issues{/number}","pulls_url":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls{/number}","milestones_url":"https://api.github.com/repos/Reine0017/team-36-codeu/milestones{/number}","notifications_url":"https://api.github.com/repos/Reine0017/team-36-codeu/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Reine0017/team-36-codeu/labels{/name}","releases_url":"https://api.github.com/repos/Reine0017/team-36-codeu/releases{/id}","deployments_url":"https://api.github.com/repos/Reine0017/team-36-codeu/deployments","created_at":"2019-05-12T03:06:09Z","updated_at":"2019-06-25T09:55:43Z","pushed_at":"2019-06-25T14:17:21Z","git_url":"git://github.com/Reine0017/team-36-codeu.git","ssh_url":"git@github.com:Reine0017/team-36-codeu.git","clone_url":"https://github.com/Reine0017/team-36-codeu.git","svn_url":"https://github.com/Reine0017/team-36-codeu","homepage":null,"size":495,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":11,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18"},"html":{"href":"https://github.com/Reine0017/team-36-codeu/pull/18"},"issue":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/18"},"comments":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/Reine0017/team-36-codeu/statuses/8c8b56461cf2e077cf58a20fd3d2fb87ea66f0dd"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"potay"}}