{"action":"created","comment":{"url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/comments/152726921","pull_request_review_id":78631072,"id":152726921,"diff_hunk":"@@ -0,0 +1,139 @@\n+const Storage = require('./storage').Storage;\n+const filename = '../data/user.json';\n+const path = require(\"path\");\n+const storage = new Storage(path.resolve(path.dirname(__filename), filename));\n+\n+\n+let users = {};\n+\n+let sockets = [];\n+\n+function User(username, password) {\n+    this.username = username;\n+    this.email = username;\n+    this.password = password;\n+}\n+\n+User.register = function (socket, username, password,cb) {\n+    console.log('register\\n');\n+    storage.read(function(error,users){\n+       if(error){\n+           cb(error);\n+           return;\n+       }\n+       if(users[username]){\n+           console.log('账户已经存在');\n+           cb(true);\n+           return;\n+       }\n+       users[username] = new User(username,password);\n+       \n+       storage.save(users,function (error) {\n+           if(error){\n+               cb(error);\n+           }\n+           cb(false);\n+       });\n+    });\n+};\n+\n+User.login = function (socket, username, password, cb) {\n+    console.log(\"user manager login\");\n+    storage.read(function (error,users) {\n+        if(error){","path":"cd/2017-11-21/entities/user.js","position":43,"original_position":43,"commit_id":"bb2baa58f2f944ddac99d77e3c042b8a84174287","original_commit_id":"bb2baa58f2f944ddac99d77e3c042b8a84174287","user":{"login":"calidion","id":131776,"avatar_url":"https://avatars0.githubusercontent.com/u/131776?v=4","gravatar_id":"","url":"https://api.github.com/users/calidion","html_url":"https://github.com/calidion","followers_url":"https://api.github.com/users/calidion/followers","following_url":"https://api.github.com/users/calidion/following{/other_user}","gists_url":"https://api.github.com/users/calidion/gists{/gist_id}","starred_url":"https://api.github.com/users/calidion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calidion/subscriptions","organizations_url":"https://api.github.com/users/calidion/orgs","repos_url":"https://api.github.com/users/calidion/repos","events_url":"https://api.github.com/users/calidion/events{/privacy}","received_events_url":"https://api.github.com/users/calidion/received_events","type":"User","site_admin":false},"body":"同上","created_at":"2017-11-23T05:55:36Z","updated_at":"2017-11-23T05:57:36Z","html_url":"https://github.com/rugao-web-fullstack/homeworks/pull/144#discussion_r152726921","pull_request_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/comments/152726921"},"html":{"href":"https://github.com/rugao-web-fullstack/homeworks/pull/144#discussion_r152726921"},"pull_request":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144"}}},"pull_request":{"url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144","id":154295055,"html_url":"https://github.com/rugao-web-fullstack/homeworks/pull/144","diff_url":"https://github.com/rugao-web-fullstack/homeworks/pull/144.diff","patch_url":"https://github.com/rugao-web-fullstack/homeworks/pull/144.patch","issue_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues/144","number":144,"state":"open","locked":false,"title":"21号作业提交","user":{"login":"Eastwood95","id":31194686,"avatar_url":"https://avatars0.githubusercontent.com/u/31194686?v=4","gravatar_id":"","url":"https://api.github.com/users/Eastwood95","html_url":"https://github.com/Eastwood95","followers_url":"https://api.github.com/users/Eastwood95/followers","following_url":"https://api.github.com/users/Eastwood95/following{/other_user}","gists_url":"https://api.github.com/users/Eastwood95/gists{/gist_id}","starred_url":"https://api.github.com/users/Eastwood95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eastwood95/subscriptions","organizations_url":"https://api.github.com/users/Eastwood95/orgs","repos_url":"https://api.github.com/users/Eastwood95/repos","events_url":"https://api.github.com/users/Eastwood95/events{/privacy}","received_events_url":"https://api.github.com/users/Eastwood95/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-11-23T03:48:23Z","updated_at":"2017-11-23T05:57:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cdea117daf006a600acffb88a0743c5a4db6b55a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144/commits","review_comments_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144/comments","review_comment_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues/144/comments","statuses_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/statuses/bb2baa58f2f944ddac99d77e3c042b8a84174287","head":{"label":"Eastwood95:master","ref":"master","sha":"bb2baa58f2f944ddac99d77e3c042b8a84174287","user":{"login":"Eastwood95","id":31194686,"avatar_url":"https://avatars0.githubusercontent.com/u/31194686?v=4","gravatar_id":"","url":"https://api.github.com/users/Eastwood95","html_url":"https://github.com/Eastwood95","followers_url":"https://api.github.com/users/Eastwood95/followers","following_url":"https://api.github.com/users/Eastwood95/following{/other_user}","gists_url":"https://api.github.com/users/Eastwood95/gists{/gist_id}","starred_url":"https://api.github.com/users/Eastwood95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eastwood95/subscriptions","organizations_url":"https://api.github.com/users/Eastwood95/orgs","repos_url":"https://api.github.com/users/Eastwood95/repos","events_url":"https://api.github.com/users/Eastwood95/events{/privacy}","received_events_url":"https://api.github.com/users/Eastwood95/received_events","type":"User","site_admin":false},"repo":{"id":110908457,"name":"homeworks","full_name":"Eastwood95/homeworks","owner":{"login":"Eastwood95","id":31194686,"avatar_url":"https://avatars0.githubusercontent.com/u/31194686?v=4","gravatar_id":"","url":"https://api.github.com/users/Eastwood95","html_url":"https://github.com/Eastwood95","followers_url":"https://api.github.com/users/Eastwood95/followers","following_url":"https://api.github.com/users/Eastwood95/following{/other_user}","gists_url":"https://api.github.com/users/Eastwood95/gists{/gist_id}","starred_url":"https://api.github.com/users/Eastwood95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eastwood95/subscriptions","organizations_url":"https://api.github.com/users/Eastwood95/orgs","repos_url":"https://api.github.com/users/Eastwood95/repos","events_url":"https://api.github.com/users/Eastwood95/events{/privacy}","received_events_url":"https://api.github.com/users/Eastwood95/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Eastwood95/homeworks","description":null,"fork":true,"url":"https://api.github.com/repos/Eastwood95/homeworks","forks_url":"https://api.github.com/repos/Eastwood95/homeworks/forks","keys_url":"https://api.github.com/repos/Eastwood95/homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Eastwood95/homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Eastwood95/homeworks/teams","hooks_url":"https://api.github.com/repos/Eastwood95/homeworks/hooks","issue_events_url":"https://api.github.com/repos/Eastwood95/homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/Eastwood95/homeworks/events","assignees_url":"https://api.github.com/repos/Eastwood95/homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/Eastwood95/homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/Eastwood95/homeworks/tags","blobs_url":"https://api.github.com/repos/Eastwood95/homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Eastwood95/homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Eastwood95/homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Eastwood95/homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Eastwood95/homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/Eastwood95/homeworks/languages","stargazers_url":"https://api.github.com/repos/Eastwood95/homeworks/stargazers","contributors_url":"https://api.github.com/repos/Eastwood95/homeworks/contributors","subscribers_url":"https://api.github.com/repos/Eastwood95/homeworks/subscribers","subscription_url":"https://api.github.com/repos/Eastwood95/homeworks/subscription","commits_url":"https://api.github.com/repos/Eastwood95/homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Eastwood95/homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Eastwood95/homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Eastwood95/homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Eastwood95/homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/Eastwood95/homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Eastwood95/homeworks/merges","archive_url":"https://api.github.com/repos/Eastwood95/homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Eastwood95/homeworks/downloads","issues_url":"https://api.github.com/repos/Eastwood95/homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/Eastwood95/homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/Eastwood95/homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/Eastwood95/homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Eastwood95/homeworks/labels{/name}","releases_url":"https://api.github.com/repos/Eastwood95/homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/Eastwood95/homeworks/deployments","created_at":"2017-11-16T01:44:33Z","updated_at":"2017-11-16T01:44:34Z","pushed_at":"2017-11-23T03:47:36Z","git_url":"git://github.com/Eastwood95/homeworks.git","ssh_url":"git@github.com:Eastwood95/homeworks.git","clone_url":"https://github.com/Eastwood95/homeworks.git","svn_url":"https://github.com/Eastwood95/homeworks","homepage":null,"size":272,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rugao-web-fullstack:master","ref":"master","sha":"4679ffac1333b784fa3aef21ec11bfa00d855595","user":{"login":"rugao-web-fullstack","id":33480045,"avatar_url":"https://avatars1.githubusercontent.com/u/33480045?v=4","gravatar_id":"","url":"https://api.github.com/users/rugao-web-fullstack","html_url":"https://github.com/rugao-web-fullstack","followers_url":"https://api.github.com/users/rugao-web-fullstack/followers","following_url":"https://api.github.com/users/rugao-web-fullstack/following{/other_user}","gists_url":"https://api.github.com/users/rugao-web-fullstack/gists{/gist_id}","starred_url":"https://api.github.com/users/rugao-web-fullstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rugao-web-fullstack/subscriptions","organizations_url":"https://api.github.com/users/rugao-web-fullstack/orgs","repos_url":"https://api.github.com/users/rugao-web-fullstack/repos","events_url":"https://api.github.com/users/rugao-web-fullstack/events{/privacy}","received_events_url":"https://api.github.com/users/rugao-web-fullstack/received_events","type":"Organization","site_admin":false},"repo":{"id":110664626,"name":"homeworks","full_name":"rugao-web-fullstack/homeworks","owner":{"login":"rugao-web-fullstack","id":33480045,"avatar_url":"https://avatars1.githubusercontent.com/u/33480045?v=4","gravatar_id":"","url":"https://api.github.com/users/rugao-web-fullstack","html_url":"https://github.com/rugao-web-fullstack","followers_url":"https://api.github.com/users/rugao-web-fullstack/followers","following_url":"https://api.github.com/users/rugao-web-fullstack/following{/other_user}","gists_url":"https://api.github.com/users/rugao-web-fullstack/gists{/gist_id}","starred_url":"https://api.github.com/users/rugao-web-fullstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rugao-web-fullstack/subscriptions","organizations_url":"https://api.github.com/users/rugao-web-fullstack/orgs","repos_url":"https://api.github.com/users/rugao-web-fullstack/repos","events_url":"https://api.github.com/users/rugao-web-fullstack/events{/privacy}","received_events_url":"https://api.github.com/users/rugao-web-fullstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rugao-web-fullstack/homeworks","description":null,"fork":false,"url":"https://api.github.com/repos/rugao-web-fullstack/homeworks","forks_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/forks","keys_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/teams","hooks_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/hooks","issue_events_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues/events{/number}","events_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/events","assignees_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/assignees{/user}","branches_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/branches{/branch}","tags_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/tags","blobs_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/git/refs{/sha}","trees_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/statuses/{sha}","languages_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/languages","stargazers_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/stargazers","contributors_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/contributors","subscribers_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/subscribers","subscription_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/subscription","commits_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/commits{/sha}","git_commits_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/git/commits{/sha}","comments_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/comments{/number}","issue_comment_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues/comments{/number}","contents_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/contents/{+path}","compare_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/merges","archive_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/downloads","issues_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues{/number}","pulls_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls{/number}","milestones_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/milestones{/number}","notifications_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/labels{/name}","releases_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/releases{/id}","deployments_url":"https://api.github.com/repos/rugao-web-fullstack/homeworks/deployments","created_at":"2017-11-14T08:51:33Z","updated_at":"2017-11-15T12:20:58Z","pushed_at":"2017-11-23T05:37:22Z","git_url":"git://github.com/rugao-web-fullstack/homeworks.git","ssh_url":"git@github.com:rugao-web-fullstack/homeworks.git","clone_url":"https://github.com/rugao-web-fullstack/homeworks.git","svn_url":"https://github.com/rugao-web-fullstack/homeworks","homepage":null,"size":392,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"archived":false,"open_issues_count":10,"forks":28,"open_issues":10,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144"},"html":{"href":"https://github.com/rugao-web-fullstack/homeworks/pull/144"},"issue":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues/144"},"comments":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/issues/144/comments"},"review_comments":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144/comments"},"review_comment":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/pulls/144/commits"},"statuses":{"href":"https://api.github.com/repos/rugao-web-fullstack/homeworks/statuses/bb2baa58f2f944ddac99d77e3c042b8a84174287"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"calidion"}}