MCPcopy Create free account
hub / github.com/coderwhy/coderhub / create

Method create

src/controller/moment.controller.js:8–16  ·  view source on GitHub ↗
(ctx, next)

Source from the content-addressed store, hash-verified

6
7class 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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected