(
@UploadedFile() file: Express.Multer.File,
)
| 86 | }), |
| 87 | ) |
| 88 | async oos( |
| 89 | @UploadedFile() file: Express.Multer.File, |
| 90 | ): Promise<Response<Express.Multer.File>> { |
| 91 | // 上传的时候我们运行你上传到内存中 然后发送给第三方但是这样做不好, |
| 92 | // 如果存储文件太多或者并非量 你的机器会撑不住,因此我们建议的做法是先存到某 |
| 93 | // 临时目录,然后调用第三方去upload 最后由定时job删除这个up目录就好了 |
| 94 | // 主要还是文件的上传和下载 上传比较简单 |
| 95 | const result = await this.ossClient.put( |
| 96 | `/upload/${moment().format('YYYYMMDD')}/${file.filename}`, |
| 97 | normalize(file.path), |
| 98 | ); |
| 99 | return responseMessage(result); |
| 100 | } |
| 101 | } |
nothing calls this directly
no test coverage detected