Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

egg #27

Open
semi-xi opened this issue Jul 23, 2020 · 0 comments
Open

egg #27

semi-xi opened this issue Jul 23, 2020 · 0 comments

Comments

@semi-xi
Copy link
Owner

semi-xi commented Jul 23, 2020

Router

处理用户的输入信息

中间件

拦截用户的请求,并在前后做一些事情

Controller

负责解析用户的输入,处理返回后的结果

// 固定挂载 
this.ctx
this.app
this.service
this.config
this.logger

参数

this.ctx.query
this.ctx.queries
this.ctx.params
不要搞混this.ctx.request.body 以及this.ctx.body 后面指的是this.cex.response.body

Service

处理业务,并把业务结果封装返回给Controller
一般用于第三发服务的调用

// 固定挂载 
this.ctx
this.app
this.service
this.config
this.logger

schedule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant