{"action":"created","comment":{"url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/comments/35752868","id":35752868,"diff_hunk":"@@ -0,0 +1,54 @@\n+package com.asiantech.controller;\n+\n+import java.util.List;\n+\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.web.bind.annotation.RequestBody;\n+import org.springframework.web.bind.annotation.RequestMapping;\n+import org.springframework.web.bind.annotation.RequestParam;\n+import org.springframework.web.bind.annotation.RestController;\n+\n+import com.asiantech.entity.User;\n+import com.asiantech.service.UserService;\n+\n+\n+@RestController\n+public class UserController {\n+\t@Autowired\n+\tprivate UserService userService;\n+\t\n+\t@RequestMapping(value=\"/listuser\")\n+\tpublic List<User> saveUser(){\n+\t\treturn  userService.getUsers();\n+\t}\n+\t@RequestMapping(value=\"/add\")\n+\tpublic User addUser(@RequestParam(value=\"firstname\") String firstname,\n+\t\t\t@RequestParam(value=\"lastname\") String lastname,@RequestParam(value=\"email\") String email,\n+\t\t\t@RequestParam(value=\"password\") String password){\n+\t\tUser user =null;\n+\t\tif(userService.getUserbyEmail(email)==null){\n+\t\t\tuser= new User(\"\",firstname,lastname,email,password);\n+\t\t\t\n+\t\t}\n+\t\treturn userService.save(user);\n+\t\t\n+\t}","path":"src/main/java/com/asiantech/controller/UserController.java","position":35,"original_position":35,"commit_id":"bf6d4a5354e2ac36b7572caae1cb5e84d328e443","original_commit_id":"bf6d4a5354e2ac36b7572caae1cb5e84d328e443","user":{"login":"luongbangnguyen","id":10724386,"avatar_url":"https://avatars.githubusercontent.com/u/10724386?v=3","gravatar_id":"","url":"https://api.github.com/users/luongbangnguyen","html_url":"https://github.com/luongbangnguyen","followers_url":"https://api.github.com/users/luongbangnguyen/followers","following_url":"https://api.github.com/users/luongbangnguyen/following{/other_user}","gists_url":"https://api.github.com/users/luongbangnguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/luongbangnguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luongbangnguyen/subscriptions","organizations_url":"https://api.github.com/users/luongbangnguyen/orgs","repos_url":"https://api.github.com/users/luongbangnguyen/repos","events_url":"https://api.github.com/users/luongbangnguyen/events{/privacy}","received_events_url":"https://api.github.com/users/luongbangnguyen/received_events","type":"User","site_admin":false},"body":"không tìm kiếm user trên controller trước khi delete công việc này phải được thực hiện dưới service","created_at":"2015-07-29T12:27:21Z","updated_at":"2015-07-29T12:27:21Z","html_url":"https://github.com/thanhtue2011/GradleDemo/pull/1#discussion_r35752868","pull_request_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/comments/35752868"},"html":{"href":"https://github.com/thanhtue2011/GradleDemo/pull/1#discussion_r35752868"},"pull_request":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1","id":41110316,"html_url":"https://github.com/thanhtue2011/GradleDemo/pull/1","diff_url":"https://github.com/thanhtue2011/GradleDemo/pull/1.diff","patch_url":"https://github.com/thanhtue2011/GradleDemo/pull/1.patch","issue_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/1","number":1,"state":"open","locked":false,"title":"commit moi ngay 29/7","user":{"login":"thanhtue2011","id":12273375,"avatar_url":"https://avatars.githubusercontent.com/u/12273375?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtue2011","html_url":"https://github.com/thanhtue2011","followers_url":"https://api.github.com/users/thanhtue2011/followers","following_url":"https://api.github.com/users/thanhtue2011/following{/other_user}","gists_url":"https://api.github.com/users/thanhtue2011/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtue2011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtue2011/subscriptions","organizations_url":"https://api.github.com/users/thanhtue2011/orgs","repos_url":"https://api.github.com/users/thanhtue2011/repos","events_url":"https://api.github.com/users/thanhtue2011/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtue2011/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-29T10:57:26Z","updated_at":"2015-07-29T12:27:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0629590f1fedff462421f138a8d48a01089dcf8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1/commits","review_comments_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1/comments","review_comment_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/1/comments","statuses_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/statuses/bf6d4a5354e2ac36b7572caae1cb5e84d328e443","head":{"label":"thanhtue2011:dev","ref":"dev","sha":"bf6d4a5354e2ac36b7572caae1cb5e84d328e443","user":{"login":"thanhtue2011","id":12273375,"avatar_url":"https://avatars.githubusercontent.com/u/12273375?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtue2011","html_url":"https://github.com/thanhtue2011","followers_url":"https://api.github.com/users/thanhtue2011/followers","following_url":"https://api.github.com/users/thanhtue2011/following{/other_user}","gists_url":"https://api.github.com/users/thanhtue2011/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtue2011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtue2011/subscriptions","organizations_url":"https://api.github.com/users/thanhtue2011/orgs","repos_url":"https://api.github.com/users/thanhtue2011/repos","events_url":"https://api.github.com/users/thanhtue2011/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtue2011/received_events","type":"User","site_admin":false},"repo":{"id":39871205,"name":"GradleDemo","full_name":"thanhtue2011/GradleDemo","owner":{"login":"thanhtue2011","id":12273375,"avatar_url":"https://avatars.githubusercontent.com/u/12273375?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtue2011","html_url":"https://github.com/thanhtue2011","followers_url":"https://api.github.com/users/thanhtue2011/followers","following_url":"https://api.github.com/users/thanhtue2011/following{/other_user}","gists_url":"https://api.github.com/users/thanhtue2011/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtue2011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtue2011/subscriptions","organizations_url":"https://api.github.com/users/thanhtue2011/orgs","repos_url":"https://api.github.com/users/thanhtue2011/repos","events_url":"https://api.github.com/users/thanhtue2011/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtue2011/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thanhtue2011/GradleDemo","description":"","fork":false,"url":"https://api.github.com/repos/thanhtue2011/GradleDemo","forks_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/forks","keys_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/teams","hooks_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/hooks","issue_events_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/events{/number}","events_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/events","assignees_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/assignees{/user}","branches_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/branches{/branch}","tags_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/tags","blobs_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/refs{/sha}","trees_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/statuses/{sha}","languages_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/languages","stargazers_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/stargazers","contributors_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/contributors","subscribers_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/subscribers","subscription_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/subscription","commits_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/commits{/sha}","git_commits_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/commits{/sha}","comments_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/comments{/number}","issue_comment_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/comments{/number}","contents_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/contents/{+path}","compare_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/merges","archive_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/downloads","issues_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues{/number}","pulls_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls{/number}","milestones_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/milestones{/number}","notifications_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/labels{/name}","releases_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/releases{/id}","created_at":"2015-07-29T03:31:25Z","updated_at":"2015-07-29T03:36:39Z","pushed_at":"2015-07-29T10:57:26Z","git_url":"git://github.com/thanhtue2011/GradleDemo.git","ssh_url":"git@github.com:thanhtue2011/GradleDemo.git","clone_url":"https://github.com/thanhtue2011/GradleDemo.git","svn_url":"https://github.com/thanhtue2011/GradleDemo","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"thanhtue2011:master","ref":"master","sha":"55c6b3fc88a8c5c3804c0f3bfed4f8a0a493b95c","user":{"login":"thanhtue2011","id":12273375,"avatar_url":"https://avatars.githubusercontent.com/u/12273375?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtue2011","html_url":"https://github.com/thanhtue2011","followers_url":"https://api.github.com/users/thanhtue2011/followers","following_url":"https://api.github.com/users/thanhtue2011/following{/other_user}","gists_url":"https://api.github.com/users/thanhtue2011/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtue2011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtue2011/subscriptions","organizations_url":"https://api.github.com/users/thanhtue2011/orgs","repos_url":"https://api.github.com/users/thanhtue2011/repos","events_url":"https://api.github.com/users/thanhtue2011/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtue2011/received_events","type":"User","site_admin":false},"repo":{"id":39871205,"name":"GradleDemo","full_name":"thanhtue2011/GradleDemo","owner":{"login":"thanhtue2011","id":12273375,"avatar_url":"https://avatars.githubusercontent.com/u/12273375?v=3","gravatar_id":"","url":"https://api.github.com/users/thanhtue2011","html_url":"https://github.com/thanhtue2011","followers_url":"https://api.github.com/users/thanhtue2011/followers","following_url":"https://api.github.com/users/thanhtue2011/following{/other_user}","gists_url":"https://api.github.com/users/thanhtue2011/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhtue2011/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhtue2011/subscriptions","organizations_url":"https://api.github.com/users/thanhtue2011/orgs","repos_url":"https://api.github.com/users/thanhtue2011/repos","events_url":"https://api.github.com/users/thanhtue2011/events{/privacy}","received_events_url":"https://api.github.com/users/thanhtue2011/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thanhtue2011/GradleDemo","description":"","fork":false,"url":"https://api.github.com/repos/thanhtue2011/GradleDemo","forks_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/forks","keys_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/teams","hooks_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/hooks","issue_events_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/events{/number}","events_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/events","assignees_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/assignees{/user}","branches_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/branches{/branch}","tags_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/tags","blobs_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/refs{/sha}","trees_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/statuses/{sha}","languages_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/languages","stargazers_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/stargazers","contributors_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/contributors","subscribers_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/subscribers","subscription_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/subscription","commits_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/commits{/sha}","git_commits_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/git/commits{/sha}","comments_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/comments{/number}","issue_comment_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/comments{/number}","contents_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/contents/{+path}","compare_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/merges","archive_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/downloads","issues_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues{/number}","pulls_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls{/number}","milestones_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/milestones{/number}","notifications_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/labels{/name}","releases_url":"https://api.github.com/repos/thanhtue2011/GradleDemo/releases{/id}","created_at":"2015-07-29T03:31:25Z","updated_at":"2015-07-29T03:36:39Z","pushed_at":"2015-07-29T10:57:26Z","git_url":"git://github.com/thanhtue2011/GradleDemo.git","ssh_url":"git@github.com:thanhtue2011/GradleDemo.git","clone_url":"https://github.com/thanhtue2011/GradleDemo.git","svn_url":"https://github.com/thanhtue2011/GradleDemo","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1"},"html":{"href":"https://github.com/thanhtue2011/GradleDemo/pull/1"},"issue":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/1"},"comments":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/thanhtue2011/GradleDemo/statuses/bf6d4a5354e2ac36b7572caae1cb5e84d328e443"}}}}