{"action":"created","comment":{"url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/comments/112719341","pull_request_review_id":34058136,"id":112719341,"diff_hunk":"@@ -0,0 +1,72 @@\n+package ru.hh.resumebuilderbot.queryresults.generator;\n+\n+import org.telegram.telegrambots.api.objects.inlinequery.InlineQuery;\n+import org.telegram.telegrambots.api.objects.inlinequery.inputmessagecontent.InputTextMessageContent;\n+import org.telegram.telegrambots.api.objects.inlinequery.result.InlineQueryResult;\n+import org.telegram.telegrambots.api.objects.inlinequery.result.InlineQueryResultArticle;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.Map;\n+\n+/**\n+ * Created by Sergey on 20.04.2017.\n+ */\n+public class QueryResultsGenerator {\n+\n+    public static List<InlineQueryResult> getResults(InlineQuery inlineQuery) {\n+        Integer chatId = inlineQuery.getFrom().getId();\n+        String textForSearch = inlineQuery.getQuery();\n+        String currentState = \"3\"; //getCurrentState(chatId);\n+\n+        List<InlineQueryResult> queryResults = new ArrayList<>();\n+        switch (currentState) {\n+            case \"1\":\n+                queryResults = getResultsFromRowData(SuggestGenerator.getInstitutes(textForSearch));\n+                break;\n+            case \"2\":\n+                String instId = \"39144\"; //getCurrentInst(chatId)\n+                queryResults = getResultsFromRowData(SuggestGenerator.getFaculties(instId, textForSearch));\n+                break;\n+            case \"3\":\n+                queryResults = getResultsFromRowData(SuggestGenerator.getCompanies(textForSearch));\n+                break;\n+            case \"4\":\n+                queryResults = getResultsFromRowData(SuggestGenerator.getSpecializations(textForSearch));\n+                break;\n+            case \"5\":\n+                queryResults = getResultsFromRowData(SuggestGenerator.getSkills(textForSearch));\n+                break;\n+            case \"6\":\n+                queryResults = getResultsFromRowData(SuggestGenerator.getPositions(textForSearch));\n+                break;\n+            case \"7\":\n+                queryResults = getResultsFromRowData(SuggestGenerator.getAreas(textForSearch));\n+                break;\n+            default:\n+                break;\n+        }\n+        return queryResults;\n+    }\n+\n+    private static List<InlineQueryResult> getResultsFromRowData(List<Map<String, String>> rowData) {\n+        List<InlineQueryResult> queryResults = new ArrayList<>();\n+        for (int i = 0; i < rowData.size() && i < 50; i++) {\n+            Map<String, String> rowElement = rowData.get(i);\n+            InlineQueryResultArticle queryResult = new InlineQueryResultArticle();\n+            queryResult.setTitle(rowElement.get(\"title\"));","path":"src/main/java/ru/hh/resumebuilderbot/queryresults/generator/QueryResultsGenerator.java","position":57,"original_position":57,"commit_id":"bf9333b40e453e3945a2af1a90baf632ad28d6f6","original_commit_id":"bf9333b40e453e3945a2af1a90baf632ad28d6f6","user":{"login":"Trympyrym","id":22774375,"avatar_url":"https://avatars2.githubusercontent.com/u/22774375?v=3","gravatar_id":"","url":"https://api.github.com/users/Trympyrym","html_url":"https://github.com/Trympyrym","followers_url":"https://api.github.com/users/Trympyrym/followers","following_url":"https://api.github.com/users/Trympyrym/following{/other_user}","gists_url":"https://api.github.com/users/Trympyrym/gists{/gist_id}","starred_url":"https://api.github.com/users/Trympyrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Trympyrym/subscriptions","organizations_url":"https://api.github.com/users/Trympyrym/orgs","repos_url":"https://api.github.com/users/Trympyrym/repos","events_url":"https://api.github.com/users/Trympyrym/events{/privacy}","received_events_url":"https://api.github.com/users/Trympyrym/received_events","type":"User","site_admin":false},"body":"Внутренности цикла бы в отдельный метод вынести.","created_at":"2017-04-21T15:48:33Z","updated_at":"2017-04-21T16:00:05Z","html_url":"https://github.com/hh-school/bot-resume-builder/pull/29#discussion_r112719341","pull_request_url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/comments/112719341"},"html":{"href":"https://github.com/hh-school/bot-resume-builder/pull/29#discussion_r112719341"},"pull_request":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29","id":116977561,"html_url":"https://github.com/hh-school/bot-resume-builder/pull/29","diff_url":"https://github.com/hh-school/bot-resume-builder/pull/29.diff","patch_url":"https://github.com/hh-school/bot-resume-builder/pull/29.patch","issue_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/29","number":29,"state":"open","locked":false,"title":"42 inline mode","user":{"login":"savinsergey","id":24318842,"avatar_url":"https://avatars2.githubusercontent.com/u/24318842?v=3","gravatar_id":"","url":"https://api.github.com/users/savinsergey","html_url":"https://github.com/savinsergey","followers_url":"https://api.github.com/users/savinsergey/followers","following_url":"https://api.github.com/users/savinsergey/following{/other_user}","gists_url":"https://api.github.com/users/savinsergey/gists{/gist_id}","starred_url":"https://api.github.com/users/savinsergey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/savinsergey/subscriptions","organizations_url":"https://api.github.com/users/savinsergey/orgs","repos_url":"https://api.github.com/users/savinsergey/repos","events_url":"https://api.github.com/users/savinsergey/events{/privacy}","received_events_url":"https://api.github.com/users/savinsergey/received_events","type":"User","site_admin":false},"body":"Добавлены все подсказки в inline мод\r\nСлегка переделана структура класса Adapter\r\nКласс BotImpl перенесен в отдельный файл","created_at":"2017-04-21T12:47:10Z","updated_at":"2017-04-21T16:00:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80da468030b8209ecc1cd4837f722543d40bb2b7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29/commits","review_comments_url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29/comments","review_comment_url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/29/comments","statuses_url":"https://api.github.com/repos/hh-school/bot-resume-builder/statuses/bf9333b40e453e3945a2af1a90baf632ad28d6f6","head":{"label":"hh-school:42-inlineMode","ref":"42-inlineMode","sha":"bf9333b40e453e3945a2af1a90baf632ad28d6f6","user":{"login":"hh-school","id":26115588,"avatar_url":"https://avatars1.githubusercontent.com/u/26115588?v=3","gravatar_id":"","url":"https://api.github.com/users/hh-school","html_url":"https://github.com/hh-school","followers_url":"https://api.github.com/users/hh-school/followers","following_url":"https://api.github.com/users/hh-school/following{/other_user}","gists_url":"https://api.github.com/users/hh-school/gists{/gist_id}","starred_url":"https://api.github.com/users/hh-school/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hh-school/subscriptions","organizations_url":"https://api.github.com/users/hh-school/orgs","repos_url":"https://api.github.com/users/hh-school/repos","events_url":"https://api.github.com/users/hh-school/events{/privacy}","received_events_url":"https://api.github.com/users/hh-school/received_events","type":"Organization","site_admin":false},"repo":{"id":83558003,"name":"bot-resume-builder","full_name":"hh-school/bot-resume-builder","owner":{"login":"hh-school","id":26115588,"avatar_url":"https://avatars1.githubusercontent.com/u/26115588?v=3","gravatar_id":"","url":"https://api.github.com/users/hh-school","html_url":"https://github.com/hh-school","followers_url":"https://api.github.com/users/hh-school/followers","following_url":"https://api.github.com/users/hh-school/following{/other_user}","gists_url":"https://api.github.com/users/hh-school/gists{/gist_id}","starred_url":"https://api.github.com/users/hh-school/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hh-school/subscriptions","organizations_url":"https://api.github.com/users/hh-school/orgs","repos_url":"https://api.github.com/users/hh-school/repos","events_url":"https://api.github.com/users/hh-school/events{/privacy}","received_events_url":"https://api.github.com/users/hh-school/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hh-school/bot-resume-builder","description":null,"fork":false,"url":"https://api.github.com/repos/hh-school/bot-resume-builder","forks_url":"https://api.github.com/repos/hh-school/bot-resume-builder/forks","keys_url":"https://api.github.com/repos/hh-school/bot-resume-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hh-school/bot-resume-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hh-school/bot-resume-builder/teams","hooks_url":"https://api.github.com/repos/hh-school/bot-resume-builder/hooks","issue_events_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/events{/number}","events_url":"https://api.github.com/repos/hh-school/bot-resume-builder/events","assignees_url":"https://api.github.com/repos/hh-school/bot-resume-builder/assignees{/user}","branches_url":"https://api.github.com/repos/hh-school/bot-resume-builder/branches{/branch}","tags_url":"https://api.github.com/repos/hh-school/bot-resume-builder/tags","blobs_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hh-school/bot-resume-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/hh-school/bot-resume-builder/languages","stargazers_url":"https://api.github.com/repos/hh-school/bot-resume-builder/stargazers","contributors_url":"https://api.github.com/repos/hh-school/bot-resume-builder/contributors","subscribers_url":"https://api.github.com/repos/hh-school/bot-resume-builder/subscribers","subscription_url":"https://api.github.com/repos/hh-school/bot-resume-builder/subscription","commits_url":"https://api.github.com/repos/hh-school/bot-resume-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/hh-school/bot-resume-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/hh-school/bot-resume-builder/contents/{+path}","compare_url":"https://api.github.com/repos/hh-school/bot-resume-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hh-school/bot-resume-builder/merges","archive_url":"https://api.github.com/repos/hh-school/bot-resume-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hh-school/bot-resume-builder/downloads","issues_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues{/number}","pulls_url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/hh-school/bot-resume-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/hh-school/bot-resume-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hh-school/bot-resume-builder/labels{/name}","releases_url":"https://api.github.com/repos/hh-school/bot-resume-builder/releases{/id}","deployments_url":"https://api.github.com/repos/hh-school/bot-resume-builder/deployments","created_at":"2017-03-01T13:34:47Z","updated_at":"2017-03-15T05:44:38Z","pushed_at":"2017-04-21T15:40:26Z","git_url":"git://github.com/hh-school/bot-resume-builder.git","ssh_url":"git@github.com:hh-school/bot-resume-builder.git","clone_url":"https://github.com/hh-school/bot-resume-builder.git","svn_url":"https://github.com/hh-school/bot-resume-builder","homepage":null,"size":313,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"hh-school:master","ref":"master","sha":"966dfe848bdb101388699c9f75cb3b6c8d78dac5","user":{"login":"hh-school","id":26115588,"avatar_url":"https://avatars1.githubusercontent.com/u/26115588?v=3","gravatar_id":"","url":"https://api.github.com/users/hh-school","html_url":"https://github.com/hh-school","followers_url":"https://api.github.com/users/hh-school/followers","following_url":"https://api.github.com/users/hh-school/following{/other_user}","gists_url":"https://api.github.com/users/hh-school/gists{/gist_id}","starred_url":"https://api.github.com/users/hh-school/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hh-school/subscriptions","organizations_url":"https://api.github.com/users/hh-school/orgs","repos_url":"https://api.github.com/users/hh-school/repos","events_url":"https://api.github.com/users/hh-school/events{/privacy}","received_events_url":"https://api.github.com/users/hh-school/received_events","type":"Organization","site_admin":false},"repo":{"id":83558003,"name":"bot-resume-builder","full_name":"hh-school/bot-resume-builder","owner":{"login":"hh-school","id":26115588,"avatar_url":"https://avatars1.githubusercontent.com/u/26115588?v=3","gravatar_id":"","url":"https://api.github.com/users/hh-school","html_url":"https://github.com/hh-school","followers_url":"https://api.github.com/users/hh-school/followers","following_url":"https://api.github.com/users/hh-school/following{/other_user}","gists_url":"https://api.github.com/users/hh-school/gists{/gist_id}","starred_url":"https://api.github.com/users/hh-school/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hh-school/subscriptions","organizations_url":"https://api.github.com/users/hh-school/orgs","repos_url":"https://api.github.com/users/hh-school/repos","events_url":"https://api.github.com/users/hh-school/events{/privacy}","received_events_url":"https://api.github.com/users/hh-school/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hh-school/bot-resume-builder","description":null,"fork":false,"url":"https://api.github.com/repos/hh-school/bot-resume-builder","forks_url":"https://api.github.com/repos/hh-school/bot-resume-builder/forks","keys_url":"https://api.github.com/repos/hh-school/bot-resume-builder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hh-school/bot-resume-builder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hh-school/bot-resume-builder/teams","hooks_url":"https://api.github.com/repos/hh-school/bot-resume-builder/hooks","issue_events_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/events{/number}","events_url":"https://api.github.com/repos/hh-school/bot-resume-builder/events","assignees_url":"https://api.github.com/repos/hh-school/bot-resume-builder/assignees{/user}","branches_url":"https://api.github.com/repos/hh-school/bot-resume-builder/branches{/branch}","tags_url":"https://api.github.com/repos/hh-school/bot-resume-builder/tags","blobs_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/refs{/sha}","trees_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hh-school/bot-resume-builder/statuses/{sha}","languages_url":"https://api.github.com/repos/hh-school/bot-resume-builder/languages","stargazers_url":"https://api.github.com/repos/hh-school/bot-resume-builder/stargazers","contributors_url":"https://api.github.com/repos/hh-school/bot-resume-builder/contributors","subscribers_url":"https://api.github.com/repos/hh-school/bot-resume-builder/subscribers","subscription_url":"https://api.github.com/repos/hh-school/bot-resume-builder/subscription","commits_url":"https://api.github.com/repos/hh-school/bot-resume-builder/commits{/sha}","git_commits_url":"https://api.github.com/repos/hh-school/bot-resume-builder/git/commits{/sha}","comments_url":"https://api.github.com/repos/hh-school/bot-resume-builder/comments{/number}","issue_comment_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/comments{/number}","contents_url":"https://api.github.com/repos/hh-school/bot-resume-builder/contents/{+path}","compare_url":"https://api.github.com/repos/hh-school/bot-resume-builder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hh-school/bot-resume-builder/merges","archive_url":"https://api.github.com/repos/hh-school/bot-resume-builder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hh-school/bot-resume-builder/downloads","issues_url":"https://api.github.com/repos/hh-school/bot-resume-builder/issues{/number}","pulls_url":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls{/number}","milestones_url":"https://api.github.com/repos/hh-school/bot-resume-builder/milestones{/number}","notifications_url":"https://api.github.com/repos/hh-school/bot-resume-builder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hh-school/bot-resume-builder/labels{/name}","releases_url":"https://api.github.com/repos/hh-school/bot-resume-builder/releases{/id}","deployments_url":"https://api.github.com/repos/hh-school/bot-resume-builder/deployments","created_at":"2017-03-01T13:34:47Z","updated_at":"2017-03-15T05:44:38Z","pushed_at":"2017-04-21T15:40:26Z","git_url":"git://github.com/hh-school/bot-resume-builder.git","ssh_url":"git@github.com:hh-school/bot-resume-builder.git","clone_url":"https://github.com/hh-school/bot-resume-builder.git","svn_url":"https://github.com/hh-school/bot-resume-builder","homepage":null,"size":313,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29"},"html":{"href":"https://github.com/hh-school/bot-resume-builder/pull/29"},"issue":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/29"},"comments":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/hh-school/bot-resume-builder/statuses/bf9333b40e453e3945a2af1a90baf632ad28d6f6"}}}}
{"actor":{"display_login":"Trympyrym"}}