{"action":"created","comment":{"url":"https://api.github.com/repos/autoschool/weather/pulls/comments/60574782","id":60574782,"diff_hunk":"@@ -52,35 +59,47 @@ public Weather getIndex(@NotNull @QueryParam(\"city\") String city,\n     }\n \n     /**\n-     * Suggest for city\n-     *\n-     * @param query query to search (more than 2 symb)\n+     * Init of all cities\n      *\n      * @return cities list\n      */\n     @GET\n-    @Path(\"/suggest\")\n-    public String suggest(@QueryParam(\"query\") String query) {\n-        if (isBlank(query) || length(query) < 2) {\n-            return Collections.emptyList().toString();\n+    @Path(\"/init\")\n+    @SuppressWarnings(\"unchecked\")\n+    public List<City> init() {\n+        if (cityRepository.count() != 0) {\n+            return Collections.emptyList();\n         }\n \n-        String path = getClass().getClassLoader().getResource(\"data/suggest.json\").getFile();\n-\n+        String path = getClass().getClassLoader().getResource(\"data/cities.json\").getFile();\n         try (Stream<String> lines = lines(Paths.get(path))) {\n-            return lines.filter(line -> contains(line, query))\n-                    .limit(5)\n-                    .collect(toList()).toString();\n+            Gson gson = new GsonBuilder().create();","path":"weather-app/src/main/java/ru/yandex/autoschool/weather/resources/IndexResource.java","position":79,"original_position":79,"commit_id":"597b066f8dde94d60d3ce4ea3dcc7c2cf8bc6ed9","original_commit_id":"597b066f8dde94d60d3ce4ea3dcc7c2cf8bc6ed9","user":{"login":"eroshenkoam","id":781455,"avatar_url":"https://avatars.githubusercontent.com/u/781455?v=3","gravatar_id":"","url":"https://api.github.com/users/eroshenkoam","html_url":"https://github.com/eroshenkoam","followers_url":"https://api.github.com/users/eroshenkoam/followers","following_url":"https://api.github.com/users/eroshenkoam/following{/other_user}","gists_url":"https://api.github.com/users/eroshenkoam/gists{/gist_id}","starred_url":"https://api.github.com/users/eroshenkoam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroshenkoam/subscriptions","organizations_url":"https://api.github.com/users/eroshenkoam/orgs","repos_url":"https://api.github.com/users/eroshenkoam/repos","events_url":"https://api.github.com/users/eroshenkoam/events{/privacy}","received_events_url":"https://api.github.com/users/eroshenkoam/received_events","type":"User","site_admin":false},"body":"ок","created_at":"2016-04-21T13:00:35Z","updated_at":"2016-04-21T13:00:35Z","html_url":"https://github.com/autoschool/weather/pull/15#discussion_r60574782","pull_request_url":"https://api.github.com/repos/autoschool/weather/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/autoschool/weather/pulls/comments/60574782"},"html":{"href":"https://github.com/autoschool/weather/pull/15#discussion_r60574782"},"pull_request":{"href":"https://api.github.com/repos/autoschool/weather/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/autoschool/weather/pulls/15","id":67336731,"html_url":"https://github.com/autoschool/weather/pull/15","diff_url":"https://github.com/autoschool/weather/pull/15.diff","patch_url":"https://github.com/autoschool/weather/pull/15.patch","issue_url":"https://api.github.com/repos/autoschool/weather/issues/15","number":15,"state":"open","locked":false,"title":"Add database logic","user":{"login":"eroshenkoam","id":781455,"avatar_url":"https://avatars.githubusercontent.com/u/781455?v=3","gravatar_id":"","url":"https://api.github.com/users/eroshenkoam","html_url":"https://github.com/eroshenkoam","followers_url":"https://api.github.com/users/eroshenkoam/followers","following_url":"https://api.github.com/users/eroshenkoam/following{/other_user}","gists_url":"https://api.github.com/users/eroshenkoam/gists{/gist_id}","starred_url":"https://api.github.com/users/eroshenkoam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroshenkoam/subscriptions","organizations_url":"https://api.github.com/users/eroshenkoam/orgs","repos_url":"https://api.github.com/users/eroshenkoam/repos","events_url":"https://api.github.com/users/eroshenkoam/events{/privacy}","received_events_url":"https://api.github.com/users/eroshenkoam/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-21T11:15:50Z","updated_at":"2016-04-21T13:00:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc2740d23c2f7a63bad5c1dc00f8b0e8c7139379","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/autoschool/weather/pulls/15/commits","review_comments_url":"https://api.github.com/repos/autoschool/weather/pulls/15/comments","review_comment_url":"https://api.github.com/repos/autoschool/weather/pulls/comments{/number}","comments_url":"https://api.github.com/repos/autoschool/weather/issues/15/comments","statuses_url":"https://api.github.com/repos/autoschool/weather/statuses/597b066f8dde94d60d3ce4ea3dcc7c2cf8bc6ed9","head":{"label":"eroshenkoam:db","ref":"db","sha":"597b066f8dde94d60d3ce4ea3dcc7c2cf8bc6ed9","user":{"login":"eroshenkoam","id":781455,"avatar_url":"https://avatars.githubusercontent.com/u/781455?v=3","gravatar_id":"","url":"https://api.github.com/users/eroshenkoam","html_url":"https://github.com/eroshenkoam","followers_url":"https://api.github.com/users/eroshenkoam/followers","following_url":"https://api.github.com/users/eroshenkoam/following{/other_user}","gists_url":"https://api.github.com/users/eroshenkoam/gists{/gist_id}","starred_url":"https://api.github.com/users/eroshenkoam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroshenkoam/subscriptions","organizations_url":"https://api.github.com/users/eroshenkoam/orgs","repos_url":"https://api.github.com/users/eroshenkoam/repos","events_url":"https://api.github.com/users/eroshenkoam/events{/privacy}","received_events_url":"https://api.github.com/users/eroshenkoam/received_events","type":"User","site_admin":false},"repo":{"id":56767315,"name":"weather","full_name":"eroshenkoam/weather","owner":{"login":"eroshenkoam","id":781455,"avatar_url":"https://avatars.githubusercontent.com/u/781455?v=3","gravatar_id":"","url":"https://api.github.com/users/eroshenkoam","html_url":"https://github.com/eroshenkoam","followers_url":"https://api.github.com/users/eroshenkoam/followers","following_url":"https://api.github.com/users/eroshenkoam/following{/other_user}","gists_url":"https://api.github.com/users/eroshenkoam/gists{/gist_id}","starred_url":"https://api.github.com/users/eroshenkoam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eroshenkoam/subscriptions","organizations_url":"https://api.github.com/users/eroshenkoam/orgs","repos_url":"https://api.github.com/users/eroshenkoam/repos","events_url":"https://api.github.com/users/eroshenkoam/events{/privacy}","received_events_url":"https://api.github.com/users/eroshenkoam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eroshenkoam/weather","description":"","fork":true,"url":"https://api.github.com/repos/eroshenkoam/weather","forks_url":"https://api.github.com/repos/eroshenkoam/weather/forks","keys_url":"https://api.github.com/repos/eroshenkoam/weather/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eroshenkoam/weather/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eroshenkoam/weather/teams","hooks_url":"https://api.github.com/repos/eroshenkoam/weather/hooks","issue_events_url":"https://api.github.com/repos/eroshenkoam/weather/issues/events{/number}","events_url":"https://api.github.com/repos/eroshenkoam/weather/events","assignees_url":"https://api.github.com/repos/eroshenkoam/weather/assignees{/user}","branches_url":"https://api.github.com/repos/eroshenkoam/weather/branches{/branch}","tags_url":"https://api.github.com/repos/eroshenkoam/weather/tags","blobs_url":"https://api.github.com/repos/eroshenkoam/weather/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eroshenkoam/weather/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eroshenkoam/weather/git/refs{/sha}","trees_url":"https://api.github.com/repos/eroshenkoam/weather/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eroshenkoam/weather/statuses/{sha}","languages_url":"https://api.github.com/repos/eroshenkoam/weather/languages","stargazers_url":"https://api.github.com/repos/eroshenkoam/weather/stargazers","contributors_url":"https://api.github.com/repos/eroshenkoam/weather/contributors","subscribers_url":"https://api.github.com/repos/eroshenkoam/weather/subscribers","subscription_url":"https://api.github.com/repos/eroshenkoam/weather/subscription","commits_url":"https://api.github.com/repos/eroshenkoam/weather/commits{/sha}","git_commits_url":"https://api.github.com/repos/eroshenkoam/weather/git/commits{/sha}","comments_url":"https://api.github.com/repos/eroshenkoam/weather/comments{/number}","issue_comment_url":"https://api.github.com/repos/eroshenkoam/weather/issues/comments{/number}","contents_url":"https://api.github.com/repos/eroshenkoam/weather/contents/{+path}","compare_url":"https://api.github.com/repos/eroshenkoam/weather/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eroshenkoam/weather/merges","archive_url":"https://api.github.com/repos/eroshenkoam/weather/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eroshenkoam/weather/downloads","issues_url":"https://api.github.com/repos/eroshenkoam/weather/issues{/number}","pulls_url":"https://api.github.com/repos/eroshenkoam/weather/pulls{/number}","milestones_url":"https://api.github.com/repos/eroshenkoam/weather/milestones{/number}","notifications_url":"https://api.github.com/repos/eroshenkoam/weather/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eroshenkoam/weather/labels{/name}","releases_url":"https://api.github.com/repos/eroshenkoam/weather/releases{/id}","deployments_url":"https://api.github.com/repos/eroshenkoam/weather/deployments","created_at":"2016-04-21T11:13:28Z","updated_at":"2016-04-21T11:13:30Z","pushed_at":"2016-04-21T11:15:40Z","git_url":"git://github.com/eroshenkoam/weather.git","ssh_url":"git@github.com:eroshenkoam/weather.git","clone_url":"https://github.com/eroshenkoam/weather.git","svn_url":"https://github.com/eroshenkoam/weather","homepage":null,"size":95,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"autoschool:master","ref":"master","sha":"597ccd7d7430ea87fd6d7a975680f975ef28d4a5","user":{"login":"autoschool","id":9036536,"avatar_url":"https://avatars.githubusercontent.com/u/9036536?v=3","gravatar_id":"","url":"https://api.github.com/users/autoschool","html_url":"https://github.com/autoschool","followers_url":"https://api.github.com/users/autoschool/followers","following_url":"https://api.github.com/users/autoschool/following{/other_user}","gists_url":"https://api.github.com/users/autoschool/gists{/gist_id}","starred_url":"https://api.github.com/users/autoschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autoschool/subscriptions","organizations_url":"https://api.github.com/users/autoschool/orgs","repos_url":"https://api.github.com/users/autoschool/repos","events_url":"https://api.github.com/users/autoschool/events{/privacy}","received_events_url":"https://api.github.com/users/autoschool/received_events","type":"Organization","site_admin":false},"repo":{"id":25985883,"name":"weather","full_name":"autoschool/weather","owner":{"login":"autoschool","id":9036536,"avatar_url":"https://avatars.githubusercontent.com/u/9036536?v=3","gravatar_id":"","url":"https://api.github.com/users/autoschool","html_url":"https://github.com/autoschool","followers_url":"https://api.github.com/users/autoschool/followers","following_url":"https://api.github.com/users/autoschool/following{/other_user}","gists_url":"https://api.github.com/users/autoschool/gists{/gist_id}","starred_url":"https://api.github.com/users/autoschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autoschool/subscriptions","organizations_url":"https://api.github.com/users/autoschool/orgs","repos_url":"https://api.github.com/users/autoschool/repos","events_url":"https://api.github.com/users/autoschool/events{/privacy}","received_events_url":"https://api.github.com/users/autoschool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/autoschool/weather","description":"","fork":false,"url":"https://api.github.com/repos/autoschool/weather","forks_url":"https://api.github.com/repos/autoschool/weather/forks","keys_url":"https://api.github.com/repos/autoschool/weather/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autoschool/weather/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autoschool/weather/teams","hooks_url":"https://api.github.com/repos/autoschool/weather/hooks","issue_events_url":"https://api.github.com/repos/autoschool/weather/issues/events{/number}","events_url":"https://api.github.com/repos/autoschool/weather/events","assignees_url":"https://api.github.com/repos/autoschool/weather/assignees{/user}","branches_url":"https://api.github.com/repos/autoschool/weather/branches{/branch}","tags_url":"https://api.github.com/repos/autoschool/weather/tags","blobs_url":"https://api.github.com/repos/autoschool/weather/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autoschool/weather/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autoschool/weather/git/refs{/sha}","trees_url":"https://api.github.com/repos/autoschool/weather/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autoschool/weather/statuses/{sha}","languages_url":"https://api.github.com/repos/autoschool/weather/languages","stargazers_url":"https://api.github.com/repos/autoschool/weather/stargazers","contributors_url":"https://api.github.com/repos/autoschool/weather/contributors","subscribers_url":"https://api.github.com/repos/autoschool/weather/subscribers","subscription_url":"https://api.github.com/repos/autoschool/weather/subscription","commits_url":"https://api.github.com/repos/autoschool/weather/commits{/sha}","git_commits_url":"https://api.github.com/repos/autoschool/weather/git/commits{/sha}","comments_url":"https://api.github.com/repos/autoschool/weather/comments{/number}","issue_comment_url":"https://api.github.com/repos/autoschool/weather/issues/comments{/number}","contents_url":"https://api.github.com/repos/autoschool/weather/contents/{+path}","compare_url":"https://api.github.com/repos/autoschool/weather/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autoschool/weather/merges","archive_url":"https://api.github.com/repos/autoschool/weather/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autoschool/weather/downloads","issues_url":"https://api.github.com/repos/autoschool/weather/issues{/number}","pulls_url":"https://api.github.com/repos/autoschool/weather/pulls{/number}","milestones_url":"https://api.github.com/repos/autoschool/weather/milestones{/number}","notifications_url":"https://api.github.com/repos/autoschool/weather/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autoschool/weather/labels{/name}","releases_url":"https://api.github.com/repos/autoschool/weather/releases{/id}","deployments_url":"https://api.github.com/repos/autoschool/weather/deployments","created_at":"2014-10-30T19:13:26Z","updated_at":"2016-03-31T11:50:24Z","pushed_at":"2016-04-21T11:15:51Z","git_url":"git://github.com/autoschool/weather.git","ssh_url":"git@github.com:autoschool/weather.git","clone_url":"https://github.com/autoschool/weather.git","svn_url":"https://github.com/autoschool/weather","homepage":null,"size":104,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":1,"forks":11,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/autoschool/weather/pulls/15"},"html":{"href":"https://github.com/autoschool/weather/pull/15"},"issue":{"href":"https://api.github.com/repos/autoschool/weather/issues/15"},"comments":{"href":"https://api.github.com/repos/autoschool/weather/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/autoschool/weather/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/autoschool/weather/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/autoschool/weather/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/autoschool/weather/statuses/597b066f8dde94d60d3ce4ea3dcc7c2cf8bc6ed9"}}}}