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

Method savePictureInfo

src/controller/file.controller.js:23–36  ·  view source on GitHub ↗
(ctx, next)

Source from the content-addressed store, hash-verified

21 }
22
23 async savePictureInfo(ctx, next) {
24 // 1.获取图像信息
25 const files = ctx.req.files;
26 const { id } = ctx.user;
27 const { momentId } = ctx.query;
28
29 // 2.将所有的文件信息保存到数据库中
30 for (let file of files) {
31 const { filename, mimetype, size } = file;
32 await fileService.createFile(filename, mimetype, size, id, momentId);
33 }
34
35 ctx.body = '动态配图上传完成~'
36 }
37}
38
39module.exports = new FileController();

Callers

nothing calls this directly

Calls 1

createFileMethod · 0.80

Tested by

no test coverage detected