{"action":"created","comment":{"url":"https://api.github.com/repos/leancloud/docs/pulls/comments/30822732","id":30822732,"diff_hunk":"@@ -163,13 +95,27 @@ LeanEngine 上有一些平台相关的环境变量，可以在你的代码中使\n {% block init_middleware %}{% endblock %}\n \n 请保证在使用任何数据存储功能前执行这段代码。\n-\n-数据存储相关功能请参考 {% block sdk_guide_link %}{% endblock %}。\n {% endblock%}\n \n+### 使用数据存储\n+\n+你可以直接在 LeanEngine 上使用我们的 [数据存储](https://leancloud.cn/features/storage.html) 服务，相关功能请参考 {% block sdk_guide_link %}{% endblock %}。\n+\n ## Cloud 函数\n \n-让我们看一个明显更复杂的例子来展示Cloud Code的用途。在云端进行计算的一个重要理由是，你不需要将大量的数据发送到设备上做计算，而是将这些计算放到服务端，并返回结果这一点点信息就好。例如，假设你写了一个App，可以让用户对电影评分，一个评分对象大概是这样：\n+当你开发移动端应用时，可能会有下列需求：\n+\n+* 应用有 Android、iOS 甚至 WindowsPhone 客户端，但是很多业务逻辑都是一样的，你希望能将这部分逻辑抽取出来，只维护一份。\n+* 有些逻辑希望能够较灵活的调整（比如某些个性化列表的排序规则），但又不想频繁的更新和发布移动客户端。\n+* 有些逻辑需要的数据量很大，或者运算成本高（比如某些统计汇总需求），你不希望在移动客户端进行运算，因为这样会消耗大量的网络流量和手机运算能力。\n+* 你希望能在特定操作时触发一段逻辑（我们成为 Hook 函数），比如：用户注册后对该用户增加一些信息记录用于统计；或某业务数据发生变化后希望做一些别的业务操作。这些代码不适合放在移动客户端（比如因为上面提到的几个原因）。","path":"views/leanengine_guide.tmpl","position":214,"original_position":214,"commit_id":"1eb222275e883a62604c0426399f838b491874c0","original_commit_id":"1eb222275e883a62604c0426399f838b491874c0","user":{"login":"myleslee","id":108758,"avatar_url":"https://avatars.githubusercontent.com/u/108758?v=3","gravatar_id":"","url":"https://api.github.com/users/myleslee","html_url":"https://github.com/myleslee","followers_url":"https://api.github.com/users/myleslee/followers","following_url":"https://api.github.com/users/myleslee/following{/other_user}","gists_url":"https://api.github.com/users/myleslee/gists{/gist_id}","starred_url":"https://api.github.com/users/myleslee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myleslee/subscriptions","organizations_url":"https://api.github.com/users/myleslee/orgs","repos_url":"https://api.github.com/users/myleslee/repos","events_url":"https://api.github.com/users/myleslee/events{/privacy}","received_events_url":"https://api.github.com/users/myleslee/received_events","type":"User","site_admin":false},"body":"typo：（我们【成为】 Hook 函数）","created_at":"2015-05-21T17:02:32Z","updated_at":"2015-05-21T17:02:32Z","html_url":"https://github.com/leancloud/docs/pull/307#discussion_r30822732","pull_request_url":"https://api.github.com/repos/leancloud/docs/pulls/307","_links":{"self":{"href":"https://api.github.com/repos/leancloud/docs/pulls/comments/30822732"},"html":{"href":"https://github.com/leancloud/docs/pull/307#discussion_r30822732"},"pull_request":{"href":"https://api.github.com/repos/leancloud/docs/pulls/307"}}},"pull_request":{"url":"https://api.github.com/repos/leancloud/docs/pulls/307","id":35914371,"html_url":"https://github.com/leancloud/docs/pull/307","diff_url":"https://github.com/leancloud/docs/pull/307.diff","patch_url":"https://github.com/leancloud/docs/pull/307.patch","issue_url":"https://api.github.com/repos/leancloud/docs/issues/307","number":307,"state":"open","locked":false,"title":"补充 LeanEngine 的文档","user":{"login":"sdjcw","id":1127984,"avatar_url":"https://avatars.githubusercontent.com/u/1127984?v=3","gravatar_id":"","url":"https://api.github.com/users/sdjcw","html_url":"https://github.com/sdjcw","followers_url":"https://api.github.com/users/sdjcw/followers","following_url":"https://api.github.com/users/sdjcw/following{/other_user}","gists_url":"https://api.github.com/users/sdjcw/gists{/gist_id}","starred_url":"https://api.github.com/users/sdjcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdjcw/subscriptions","organizations_url":"https://api.github.com/users/sdjcw/orgs","repos_url":"https://api.github.com/users/sdjcw/repos","events_url":"https://api.github.com/users/sdjcw/events{/privacy}","received_events_url":"https://api.github.com/users/sdjcw/received_events","type":"User","site_admin":false},"body":"重新整理的文档的结构。","created_at":"2015-05-21T09:19:17Z","updated_at":"2015-05-21T17:02:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1f4ce9f28ccc23ffb20814bcb6e75cbc4985c9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/leancloud/docs/pulls/307/commits","review_comments_url":"https://api.github.com/repos/leancloud/docs/pulls/307/comments","review_comment_url":"https://api.github.com/repos/leancloud/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leancloud/docs/issues/307/comments","statuses_url":"https://api.github.com/repos/leancloud/docs/statuses/1eb222275e883a62604c0426399f838b491874c0","head":{"label":"sdjcw:master","ref":"master","sha":"1eb222275e883a62604c0426399f838b491874c0","user":{"login":"sdjcw","id":1127984,"avatar_url":"https://avatars.githubusercontent.com/u/1127984?v=3","gravatar_id":"","url":"https://api.github.com/users/sdjcw","html_url":"https://github.com/sdjcw","followers_url":"https://api.github.com/users/sdjcw/followers","following_url":"https://api.github.com/users/sdjcw/following{/other_user}","gists_url":"https://api.github.com/users/sdjcw/gists{/gist_id}","starred_url":"https://api.github.com/users/sdjcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdjcw/subscriptions","organizations_url":"https://api.github.com/users/sdjcw/orgs","repos_url":"https://api.github.com/users/sdjcw/repos","events_url":"https://api.github.com/users/sdjcw/events{/privacy}","received_events_url":"https://api.github.com/users/sdjcw/received_events","type":"User","site_admin":false},"repo":{"id":33997989,"name":"leancloud-docs","full_name":"sdjcw/leancloud-docs","owner":{"login":"sdjcw","id":1127984,"avatar_url":"https://avatars.githubusercontent.com/u/1127984?v=3","gravatar_id":"","url":"https://api.github.com/users/sdjcw","html_url":"https://github.com/sdjcw","followers_url":"https://api.github.com/users/sdjcw/followers","following_url":"https://api.github.com/users/sdjcw/following{/other_user}","gists_url":"https://api.github.com/users/sdjcw/gists{/gist_id}","starred_url":"https://api.github.com/users/sdjcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdjcw/subscriptions","organizations_url":"https://api.github.com/users/sdjcw/orgs","repos_url":"https://api.github.com/users/sdjcw/repos","events_url":"https://api.github.com/users/sdjcw/events{/privacy}","received_events_url":"https://api.github.com/users/sdjcw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdjcw/leancloud-docs","description":"LeanCloud Documentation","fork":true,"url":"https://api.github.com/repos/sdjcw/leancloud-docs","forks_url":"https://api.github.com/repos/sdjcw/leancloud-docs/forks","keys_url":"https://api.github.com/repos/sdjcw/leancloud-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdjcw/leancloud-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdjcw/leancloud-docs/teams","hooks_url":"https://api.github.com/repos/sdjcw/leancloud-docs/hooks","issue_events_url":"https://api.github.com/repos/sdjcw/leancloud-docs/issues/events{/number}","events_url":"https://api.github.com/repos/sdjcw/leancloud-docs/events","assignees_url":"https://api.github.com/repos/sdjcw/leancloud-docs/assignees{/user}","branches_url":"https://api.github.com/repos/sdjcw/leancloud-docs/branches{/branch}","tags_url":"https://api.github.com/repos/sdjcw/leancloud-docs/tags","blobs_url":"https://api.github.com/repos/sdjcw/leancloud-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdjcw/leancloud-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdjcw/leancloud-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdjcw/leancloud-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdjcw/leancloud-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/sdjcw/leancloud-docs/languages","stargazers_url":"https://api.github.com/repos/sdjcw/leancloud-docs/stargazers","contributors_url":"https://api.github.com/repos/sdjcw/leancloud-docs/contributors","subscribers_url":"https://api.github.com/repos/sdjcw/leancloud-docs/subscribers","subscription_url":"https://api.github.com/repos/sdjcw/leancloud-docs/subscription","commits_url":"https://api.github.com/repos/sdjcw/leancloud-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdjcw/leancloud-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdjcw/leancloud-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdjcw/leancloud-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdjcw/leancloud-docs/contents/{+path}","compare_url":"https://api.github.com/repos/sdjcw/leancloud-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdjcw/leancloud-docs/merges","archive_url":"https://api.github.com/repos/sdjcw/leancloud-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdjcw/leancloud-docs/downloads","issues_url":"https://api.github.com/repos/sdjcw/leancloud-docs/issues{/number}","pulls_url":"https://api.github.com/repos/sdjcw/leancloud-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/sdjcw/leancloud-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/sdjcw/leancloud-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdjcw/leancloud-docs/labels{/name}","releases_url":"https://api.github.com/repos/sdjcw/leancloud-docs/releases{/id}","created_at":"2015-04-15T14:15:29Z","updated_at":"2015-05-05T07:11:39Z","pushed_at":"2015-05-21T15:09:52Z","git_url":"git://github.com/sdjcw/leancloud-docs.git","ssh_url":"git@github.com:sdjcw/leancloud-docs.git","clone_url":"https://github.com/sdjcw/leancloud-docs.git","svn_url":"https://github.com/sdjcw/leancloud-docs","homepage":"http://leancloud.cn/docs/","size":19237,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"leancloud:master","ref":"master","sha":"5a4ec2344592d534a883c6d790a13237029570d7","user":{"login":"leancloud","id":6660518,"avatar_url":"https://avatars.githubusercontent.com/u/6660518?v=3","gravatar_id":"","url":"https://api.github.com/users/leancloud","html_url":"https://github.com/leancloud","followers_url":"https://api.github.com/users/leancloud/followers","following_url":"https://api.github.com/users/leancloud/following{/other_user}","gists_url":"https://api.github.com/users/leancloud/gists{/gist_id}","starred_url":"https://api.github.com/users/leancloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leancloud/subscriptions","organizations_url":"https://api.github.com/users/leancloud/orgs","repos_url":"https://api.github.com/users/leancloud/repos","events_url":"https://api.github.com/users/leancloud/events{/privacy}","received_events_url":"https://api.github.com/users/leancloud/received_events","type":"Organization","site_admin":false},"repo":{"id":25067518,"name":"docs","full_name":"leancloud/docs","owner":{"login":"leancloud","id":6660518,"avatar_url":"https://avatars.githubusercontent.com/u/6660518?v=3","gravatar_id":"","url":"https://api.github.com/users/leancloud","html_url":"https://github.com/leancloud","followers_url":"https://api.github.com/users/leancloud/followers","following_url":"https://api.github.com/users/leancloud/following{/other_user}","gists_url":"https://api.github.com/users/leancloud/gists{/gist_id}","starred_url":"https://api.github.com/users/leancloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leancloud/subscriptions","organizations_url":"https://api.github.com/users/leancloud/orgs","repos_url":"https://api.github.com/users/leancloud/repos","events_url":"https://api.github.com/users/leancloud/events{/privacy}","received_events_url":"https://api.github.com/users/leancloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leancloud/docs","description":"LeanCloud Documentation","fork":false,"url":"https://api.github.com/repos/leancloud/docs","forks_url":"https://api.github.com/repos/leancloud/docs/forks","keys_url":"https://api.github.com/repos/leancloud/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leancloud/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leancloud/docs/teams","hooks_url":"https://api.github.com/repos/leancloud/docs/hooks","issue_events_url":"https://api.github.com/repos/leancloud/docs/issues/events{/number}","events_url":"https://api.github.com/repos/leancloud/docs/events","assignees_url":"https://api.github.com/repos/leancloud/docs/assignees{/user}","branches_url":"https://api.github.com/repos/leancloud/docs/branches{/branch}","tags_url":"https://api.github.com/repos/leancloud/docs/tags","blobs_url":"https://api.github.com/repos/leancloud/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leancloud/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leancloud/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/leancloud/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leancloud/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/leancloud/docs/languages","stargazers_url":"https://api.github.com/repos/leancloud/docs/stargazers","contributors_url":"https://api.github.com/repos/leancloud/docs/contributors","subscribers_url":"https://api.github.com/repos/leancloud/docs/subscribers","subscription_url":"https://api.github.com/repos/leancloud/docs/subscription","commits_url":"https://api.github.com/repos/leancloud/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/leancloud/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/leancloud/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/leancloud/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/leancloud/docs/contents/{+path}","compare_url":"https://api.github.com/repos/leancloud/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leancloud/docs/merges","archive_url":"https://api.github.com/repos/leancloud/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leancloud/docs/downloads","issues_url":"https://api.github.com/repos/leancloud/docs/issues{/number}","pulls_url":"https://api.github.com/repos/leancloud/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/leancloud/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/leancloud/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leancloud/docs/labels{/name}","releases_url":"https://api.github.com/repos/leancloud/docs/releases{/id}","created_at":"2014-10-11T07:14:37Z","updated_at":"2015-05-21T02:12:01Z","pushed_at":"2015-05-21T15:09:53Z","git_url":"git://github.com/leancloud/docs.git","ssh_url":"git@github.com:leancloud/docs.git","clone_url":"https://github.com/leancloud/docs.git","svn_url":"https://github.com/leancloud/docs","homepage":"http://leancloud.cn/docs/","size":25117,"stargazers_count":63,"watchers_count":63,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":30,"forks":65,"open_issues":30,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/leancloud/docs/pulls/307"},"html":{"href":"https://github.com/leancloud/docs/pull/307"},"issue":{"href":"https://api.github.com/repos/leancloud/docs/issues/307"},"comments":{"href":"https://api.github.com/repos/leancloud/docs/issues/307/comments"},"review_comments":{"href":"https://api.github.com/repos/leancloud/docs/pulls/307/comments"},"review_comment":{"href":"https://api.github.com/repos/leancloud/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leancloud/docs/pulls/307/commits"},"statuses":{"href":"https://api.github.com/repos/leancloud/docs/statuses/1eb222275e883a62604c0426399f838b491874c0"}}}}