|
|
@ -7,6 +7,7 @@ import { |
|
|
|
Param, |
|
|
|
Param, |
|
|
|
Delete, |
|
|
|
Delete, |
|
|
|
UseGuards, |
|
|
|
UseGuards, |
|
|
|
|
|
|
|
Req, |
|
|
|
} from '@nestjs/common'; |
|
|
|
} from '@nestjs/common'; |
|
|
|
import { StarlightService } from './starlight.service'; |
|
|
|
import { StarlightService } from './starlight.service'; |
|
|
|
import { CreateStarlightDto } from './dto/create-starlight.dto'; |
|
|
|
import { CreateStarlightDto } from './dto/create-starlight.dto'; |
|
|
@ -48,4 +49,20 @@ export class StarlightController { |
|
|
|
remove(@Param('id') id: string) { |
|
|
|
remove(@Param('id') id: string) { |
|
|
|
return this.starlightService.remove(+id); |
|
|
|
return this.starlightService.remove(+id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Post('/file') |
|
|
|
|
|
|
|
async upFile(@Req() request: any): Promise<string> { |
|
|
|
|
|
|
|
const files = await request.saveRequestFiles(); |
|
|
|
|
|
|
|
console.log('FILE', files); |
|
|
|
|
|
|
|
console.log( |
|
|
|
|
|
|
|
'FILE:filepath', |
|
|
|
|
|
|
|
files[0].filepath, |
|
|
|
|
|
|
|
files[0].fieldname, |
|
|
|
|
|
|
|
files[0].filename, |
|
|
|
|
|
|
|
files[0].encoding, |
|
|
|
|
|
|
|
files[0].mimetype, |
|
|
|
|
|
|
|
// files[0].fields,
|
|
|
|
|
|
|
|
files[0].file.bytesRead, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
return 'Hello World'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|