(ctx, next)
| 6 | |
| 7 | class MomentController { |
| 8 | async create(ctx, next) { |
| 9 | // 1.获取数据(user_id, content) |
| 10 | const userId = ctx.user.id; |
| 11 | const content = ctx.request.body.content; |
| 12 | |
| 13 | // 2.将数据插入到数据库 |
| 14 | const result = await momentService.create(userId, content); |
| 15 | ctx.body = result; |
| 16 | } |
| 17 | |
| 18 | async detail(ctx, next) { |
| 19 | // 1.获取数据(momentId) |
nothing calls this directly
no outgoing calls
no test coverage detected