Ben Lin
2024-07-31 08d4018e84039c5a9d400790704fa931afdc861b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import FileService from '../service/FileService';
 
class FileController {
  private service: FileService = new FileService();
 
  upload = async (ctx) => {
    const files = ctx.request.files.file;
    console.log(files);
 
    if (files.length === undefined) {
      this.service.upload(ctx, files, false);
    } else {
      this.service.upload(ctx, files, true);
    }
  };
}
 
export default new FileController();