(ctx, next)
| 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 | |
| 39 | module.exports = new FileController(); |
nothing calls this directly
no test coverage detected