feat: 调整项目层级
This commit is contained in:
23
server/src/modules/system/files/files.controller.ts
Normal file
23
server/src/modules/system/files/files.controller.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {
|
||||
Controller,
|
||||
Post,
|
||||
UseInterceptors,
|
||||
UploadedFile,
|
||||
ParseFilePipe,
|
||||
} from '@nestjs/common';
|
||||
import { FilesService } from './files.service';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
|
||||
@Controller()
|
||||
export class FilesController {
|
||||
constructor(private readonly filesService: FilesService) {}
|
||||
|
||||
@Post()
|
||||
@UseInterceptors(FileInterceptor('file'))
|
||||
upload(
|
||||
@UploadedFile(new ParseFilePipe({ validators: [] }))
|
||||
file: Express.Multer.File,
|
||||
) {
|
||||
return this.filesService.upload(file);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user