{"action":"created","comment":{"url":"https://api.github.com/repos/ikoamu/Zaseki/pulls/comments/203648015","pull_request_review_id":138575504,"id":203648015,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzY0ODAxNQ==","diff_hunk":"@@ -23,42 +24,46 @@\n     return memberList;\n   }\n \n-  @RequestMapping(\"/{furigana}\")\n-  public List<Member> index(@PathVariable String furigana) {\n-    List<Member> memberList = makeMemberList();\n-    List<Member> qualifiedMember = new ArrayList<Member>();\n+  @RequestMapping(value = \"/member\", method = RequestMethod.GET)\n+  public List<Member> member(@RequestParam(defaultValue = \"all\") String furigana,\n+      @RequestParam(defaultValue = \"all\") String div) {\n \n-    for (Member member : memberList) {\n-      if (member.getFurigana().equals(furigana)) {\n-        qualifiedMember.add(member);\n-      }\n+    List<Member> qualifiedMemberList = makeQualifiedMemberList(furigana, div);\n+\n+    return qualifiedMemberList;\n+  }\n+\n+  private List<Member> makeMemberList() {\n+    List<Member> memberList = new ArrayList<Member>();\n+    Iterable<Member> list = repository.findAll();\n+\n+    for (Member zaseki : list) {\n+      memberList.add(zaseki);\n     }\n \n-    return qualifiedMember;\n+    return memberList;\n   }\n \n-  @RequestMapping(\"/{furigana}/{keyWord}\")\n-  public List<Member> index(@PathVariable String furigana, @PathVariable String keyWord) {\n+  private List<Member> makeQualifiedMemberList(String furigana, String div) {\n     List<Member> memberList = makeMemberList();\n-    List<Member> qualifiedMember = new ArrayList<Member>();\n+    List<Member> qualifiedMemberList = new ArrayList<Member>();\n \n     for (Member member : memberList) {\n-      if (member.getFurigana().equals(furigana) && member.getDivision().equals(Division.from(keyWord).toString())) {\n-        qualifiedMember.add(member);\n+      if (isValidMember(member, furigana, div)) {\n+        qualifiedMemberList.add(member);\n       }\n     }\n \n-    return qualifiedMember;\n+    return qualifiedMemberList;\n   }\n \n-  private List<Member> makeMemberList() {\n-    List<Member> memberList = new ArrayList<Member>();\n-    Iterable<Member> list = repository.findAll();\n-\n-    for (Member zaseki : list) {\n-      memberList.add(zaseki);\n+  private boolean isValidMember(Member member, String yomigana, String div) {\n+    if (yomigana.equals(\"all\") || yomigana.equals(member.getFurigana())) {\n+      if (div.equals(\"all\") || Division.from(div).toString().equals(member.getDivision())) {","path":"src/main/java/com/zaseki/ZasekiController.java","position":71,"original_position":71,"commit_id":"90dd7cd28e9ed167d97184904bc2d0f10322f9e9","original_commit_id":"90dd7cd28e9ed167d97184904bc2d0f10322f9e9","user":{"login":"sakai-y","id":10514428,"node_id":"MDQ6VXNlcjEwNTE0NDI4","avatar_url":"https://avatars3.githubusercontent.com/u/10514428?v=4","gravatar_id":"","url":"https://api.github.com/users/sakai-y","html_url":"https://github.com/sakai-y","followers_url":"https://api.github.com/users/sakai-y/followers","following_url":"https://api.github.com/users/sakai-y/following{/other_user}","gists_url":"https://api.github.com/users/sakai-y/gists{/gist_id}","starred_url":"https://api.github.com/users/sakai-y/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sakai-y/subscriptions","organizations_url":"https://api.github.com/users/sakai-y/orgs","repos_url":"https://api.github.com/users/sakai-y/repos","events_url":"https://api.github.com/users/sakai-y/events{/privacy}","received_events_url":"https://api.github.com/users/sakai-y/received_events","type":"User","site_admin":false},"body":"`Division.from(div).toString()`すると、結局元の`div`に戻る・・・？","created_at":"2018-07-19T08:51:18Z","updated_at":"2018-07-19T08:53:13Z","html_url":"https://github.com/ikoamu/Zaseki/pull/5#discussion_r203648015","pull_request_url":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ikoamu/Zaseki/pulls/comments/203648015"},"html":{"href":"https://github.com/ikoamu/Zaseki/pull/5#discussion_r203648015"},"pull_request":{"href":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5","id":202466619,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNDY2NjE5","html_url":"https://github.com/ikoamu/Zaseki/pull/5","diff_url":"https://github.com/ikoamu/Zaseki/pull/5.diff","patch_url":"https://github.com/ikoamu/Zaseki/pull/5.patch","issue_url":"https://api.github.com/repos/ikoamu/Zaseki/issues/5","number":5,"state":"open","locked":false,"title":"URIの設計を修正","user":{"login":"ikoamu","id":38206334,"node_id":"MDQ6VXNlcjM4MjA2MzM0","avatar_url":"https://avatars0.githubusercontent.com/u/38206334?v=4","gravatar_id":"","url":"https://api.github.com/users/ikoamu","html_url":"https://github.com/ikoamu","followers_url":"https://api.github.com/users/ikoamu/followers","following_url":"https://api.github.com/users/ikoamu/following{/other_user}","gists_url":"https://api.github.com/users/ikoamu/gists{/gist_id}","starred_url":"https://api.github.com/users/ikoamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikoamu/subscriptions","organizations_url":"https://api.github.com/users/ikoamu/orgs","repos_url":"https://api.github.com/users/ikoamu/repos","events_url":"https://api.github.com/users/ikoamu/events{/privacy}","received_events_url":"https://api.github.com/users/ikoamu/received_events","type":"User","site_admin":false},"body":"URIを`http://localhost:8080/member?furigana=ふりがな&div=部署名`\r\nという形になるように修正しました。レビューをお願いします。","created_at":"2018-07-19T07:21:02Z","updated_at":"2018-07-19T08:53:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"814e2084024fd7d90552013a8918dd001cf1f047","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5/commits","review_comments_url":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5/comments","review_comment_url":"https://api.github.com/repos/ikoamu/Zaseki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ikoamu/Zaseki/issues/5/comments","statuses_url":"https://api.github.com/repos/ikoamu/Zaseki/statuses/90dd7cd28e9ed167d97184904bc2d0f10322f9e9","head":{"label":"ikoamu:fix_uri","ref":"fix_uri","sha":"90dd7cd28e9ed167d97184904bc2d0f10322f9e9","user":{"login":"ikoamu","id":38206334,"node_id":"MDQ6VXNlcjM4MjA2MzM0","avatar_url":"https://avatars0.githubusercontent.com/u/38206334?v=4","gravatar_id":"","url":"https://api.github.com/users/ikoamu","html_url":"https://github.com/ikoamu","followers_url":"https://api.github.com/users/ikoamu/followers","following_url":"https://api.github.com/users/ikoamu/following{/other_user}","gists_url":"https://api.github.com/users/ikoamu/gists{/gist_id}","starred_url":"https://api.github.com/users/ikoamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikoamu/subscriptions","organizations_url":"https://api.github.com/users/ikoamu/orgs","repos_url":"https://api.github.com/users/ikoamu/repos","events_url":"https://api.github.com/users/ikoamu/events{/privacy}","received_events_url":"https://api.github.com/users/ikoamu/received_events","type":"User","site_admin":false},"repo":{"id":140215744,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAyMTU3NDQ=","name":"Zaseki","full_name":"ikoamu/Zaseki","owner":{"login":"ikoamu","id":38206334,"node_id":"MDQ6VXNlcjM4MjA2MzM0","avatar_url":"https://avatars0.githubusercontent.com/u/38206334?v=4","gravatar_id":"","url":"https://api.github.com/users/ikoamu","html_url":"https://github.com/ikoamu","followers_url":"https://api.github.com/users/ikoamu/followers","following_url":"https://api.github.com/users/ikoamu/following{/other_user}","gists_url":"https://api.github.com/users/ikoamu/gists{/gist_id}","starred_url":"https://api.github.com/users/ikoamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikoamu/subscriptions","organizations_url":"https://api.github.com/users/ikoamu/orgs","repos_url":"https://api.github.com/users/ikoamu/repos","events_url":"https://api.github.com/users/ikoamu/events{/privacy}","received_events_url":"https://api.github.com/users/ikoamu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ikoamu/Zaseki","description":"座席検索アプリ","fork":false,"url":"https://api.github.com/repos/ikoamu/Zaseki","forks_url":"https://api.github.com/repos/ikoamu/Zaseki/forks","keys_url":"https://api.github.com/repos/ikoamu/Zaseki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ikoamu/Zaseki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ikoamu/Zaseki/teams","hooks_url":"https://api.github.com/repos/ikoamu/Zaseki/hooks","issue_events_url":"https://api.github.com/repos/ikoamu/Zaseki/issues/events{/number}","events_url":"https://api.github.com/repos/ikoamu/Zaseki/events","assignees_url":"https://api.github.com/repos/ikoamu/Zaseki/assignees{/user}","branches_url":"https://api.github.com/repos/ikoamu/Zaseki/branches{/branch}","tags_url":"https://api.github.com/repos/ikoamu/Zaseki/tags","blobs_url":"https://api.github.com/repos/ikoamu/Zaseki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ikoamu/Zaseki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ikoamu/Zaseki/git/refs{/sha}","trees_url":"https://api.github.com/repos/ikoamu/Zaseki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ikoamu/Zaseki/statuses/{sha}","languages_url":"https://api.github.com/repos/ikoamu/Zaseki/languages","stargazers_url":"https://api.github.com/repos/ikoamu/Zaseki/stargazers","contributors_url":"https://api.github.com/repos/ikoamu/Zaseki/contributors","subscribers_url":"https://api.github.com/repos/ikoamu/Zaseki/subscribers","subscription_url":"https://api.github.com/repos/ikoamu/Zaseki/subscription","commits_url":"https://api.github.com/repos/ikoamu/Zaseki/commits{/sha}","git_commits_url":"https://api.github.com/repos/ikoamu/Zaseki/git/commits{/sha}","comments_url":"https://api.github.com/repos/ikoamu/Zaseki/comments{/number}","issue_comment_url":"https://api.github.com/repos/ikoamu/Zaseki/issues/comments{/number}","contents_url":"https://api.github.com/repos/ikoamu/Zaseki/contents/{+path}","compare_url":"https://api.github.com/repos/ikoamu/Zaseki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ikoamu/Zaseki/merges","archive_url":"https://api.github.com/repos/ikoamu/Zaseki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ikoamu/Zaseki/downloads","issues_url":"https://api.github.com/repos/ikoamu/Zaseki/issues{/number}","pulls_url":"https://api.github.com/repos/ikoamu/Zaseki/pulls{/number}","milestones_url":"https://api.github.com/repos/ikoamu/Zaseki/milestones{/number}","notifications_url":"https://api.github.com/repos/ikoamu/Zaseki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ikoamu/Zaseki/labels{/name}","releases_url":"https://api.github.com/repos/ikoamu/Zaseki/releases{/id}","deployments_url":"https://api.github.com/repos/ikoamu/Zaseki/deployments","created_at":"2018-07-09T01:21:39Z","updated_at":"2018-07-18T01:49:10Z","pushed_at":"2018-07-19T08:43:55Z","git_url":"git://github.com/ikoamu/Zaseki.git","ssh_url":"git@github.com:ikoamu/Zaseki.git","clone_url":"https://github.com/ikoamu/Zaseki.git","svn_url":"https://github.com/ikoamu/Zaseki","homepage":null,"size":84,"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,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ikoamu:master","ref":"master","sha":"094ff06a43e71e652789fef3ca1e1cc6c9e35103","user":{"login":"ikoamu","id":38206334,"node_id":"MDQ6VXNlcjM4MjA2MzM0","avatar_url":"https://avatars0.githubusercontent.com/u/38206334?v=4","gravatar_id":"","url":"https://api.github.com/users/ikoamu","html_url":"https://github.com/ikoamu","followers_url":"https://api.github.com/users/ikoamu/followers","following_url":"https://api.github.com/users/ikoamu/following{/other_user}","gists_url":"https://api.github.com/users/ikoamu/gists{/gist_id}","starred_url":"https://api.github.com/users/ikoamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikoamu/subscriptions","organizations_url":"https://api.github.com/users/ikoamu/orgs","repos_url":"https://api.github.com/users/ikoamu/repos","events_url":"https://api.github.com/users/ikoamu/events{/privacy}","received_events_url":"https://api.github.com/users/ikoamu/received_events","type":"User","site_admin":false},"repo":{"id":140215744,"node_id":"MDEwOlJlcG9zaXRvcnkxNDAyMTU3NDQ=","name":"Zaseki","full_name":"ikoamu/Zaseki","owner":{"login":"ikoamu","id":38206334,"node_id":"MDQ6VXNlcjM4MjA2MzM0","avatar_url":"https://avatars0.githubusercontent.com/u/38206334?v=4","gravatar_id":"","url":"https://api.github.com/users/ikoamu","html_url":"https://github.com/ikoamu","followers_url":"https://api.github.com/users/ikoamu/followers","following_url":"https://api.github.com/users/ikoamu/following{/other_user}","gists_url":"https://api.github.com/users/ikoamu/gists{/gist_id}","starred_url":"https://api.github.com/users/ikoamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ikoamu/subscriptions","organizations_url":"https://api.github.com/users/ikoamu/orgs","repos_url":"https://api.github.com/users/ikoamu/repos","events_url":"https://api.github.com/users/ikoamu/events{/privacy}","received_events_url":"https://api.github.com/users/ikoamu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ikoamu/Zaseki","description":"座席検索アプリ","fork":false,"url":"https://api.github.com/repos/ikoamu/Zaseki","forks_url":"https://api.github.com/repos/ikoamu/Zaseki/forks","keys_url":"https://api.github.com/repos/ikoamu/Zaseki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ikoamu/Zaseki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ikoamu/Zaseki/teams","hooks_url":"https://api.github.com/repos/ikoamu/Zaseki/hooks","issue_events_url":"https://api.github.com/repos/ikoamu/Zaseki/issues/events{/number}","events_url":"https://api.github.com/repos/ikoamu/Zaseki/events","assignees_url":"https://api.github.com/repos/ikoamu/Zaseki/assignees{/user}","branches_url":"https://api.github.com/repos/ikoamu/Zaseki/branches{/branch}","tags_url":"https://api.github.com/repos/ikoamu/Zaseki/tags","blobs_url":"https://api.github.com/repos/ikoamu/Zaseki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ikoamu/Zaseki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ikoamu/Zaseki/git/refs{/sha}","trees_url":"https://api.github.com/repos/ikoamu/Zaseki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ikoamu/Zaseki/statuses/{sha}","languages_url":"https://api.github.com/repos/ikoamu/Zaseki/languages","stargazers_url":"https://api.github.com/repos/ikoamu/Zaseki/stargazers","contributors_url":"https://api.github.com/repos/ikoamu/Zaseki/contributors","subscribers_url":"https://api.github.com/repos/ikoamu/Zaseki/subscribers","subscription_url":"https://api.github.com/repos/ikoamu/Zaseki/subscription","commits_url":"https://api.github.com/repos/ikoamu/Zaseki/commits{/sha}","git_commits_url":"https://api.github.com/repos/ikoamu/Zaseki/git/commits{/sha}","comments_url":"https://api.github.com/repos/ikoamu/Zaseki/comments{/number}","issue_comment_url":"https://api.github.com/repos/ikoamu/Zaseki/issues/comments{/number}","contents_url":"https://api.github.com/repos/ikoamu/Zaseki/contents/{+path}","compare_url":"https://api.github.com/repos/ikoamu/Zaseki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ikoamu/Zaseki/merges","archive_url":"https://api.github.com/repos/ikoamu/Zaseki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ikoamu/Zaseki/downloads","issues_url":"https://api.github.com/repos/ikoamu/Zaseki/issues{/number}","pulls_url":"https://api.github.com/repos/ikoamu/Zaseki/pulls{/number}","milestones_url":"https://api.github.com/repos/ikoamu/Zaseki/milestones{/number}","notifications_url":"https://api.github.com/repos/ikoamu/Zaseki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ikoamu/Zaseki/labels{/name}","releases_url":"https://api.github.com/repos/ikoamu/Zaseki/releases{/id}","deployments_url":"https://api.github.com/repos/ikoamu/Zaseki/deployments","created_at":"2018-07-09T01:21:39Z","updated_at":"2018-07-18T01:49:10Z","pushed_at":"2018-07-19T08:43:55Z","git_url":"git://github.com/ikoamu/Zaseki.git","ssh_url":"git@github.com:ikoamu/Zaseki.git","clone_url":"https://github.com/ikoamu/Zaseki.git","svn_url":"https://github.com/ikoamu/Zaseki","homepage":null,"size":84,"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,"open_issues_count":3,"license":null,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5"},"html":{"href":"https://github.com/ikoamu/Zaseki/pull/5"},"issue":{"href":"https://api.github.com/repos/ikoamu/Zaseki/issues/5"},"comments":{"href":"https://api.github.com/repos/ikoamu/Zaseki/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/ikoamu/Zaseki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ikoamu/Zaseki/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/ikoamu/Zaseki/statuses/90dd7cd28e9ed167d97184904bc2d0f10322f9e9"}},"author_association":"OWNER"}}
{"actor":{"display_login":"sakai-y"}}