Skip to content

Commit

Permalink
docs: Update service.md (#3191)
Browse files Browse the repository at this point in the history
  • Loading branch information
qidaneix authored and atian25 committed Nov 13, 2018
1 parent 327fa17 commit ff79101
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/en/basics/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module.exports = app => {
const Controller = require('egg').Controller;
class UserController extends Controller {
async info() {
const { ctx } = this;
const userId = ctx.params.id;
const userInfo = await ctx.service.user.find(userId);
ctx.body = userInfo;
Expand Down
1 change: 1 addition & 0 deletions docs/source/zh-cn/basics/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module.exports = app => {
const Controller = require('egg').Controller;
class UserController extends Controller {
async info() {
const { ctx } = this;
const userId = ctx.params.id;
const userInfo = await ctx.service.user.find(userId);
ctx.body = userInfo;
Expand Down

0 comments on commit ff79101

Please sign in to comment.