Blame view

test/server/controller/FileController.ts 415 Bytes
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();