Commit 4c8cf63d authored by nanahira's avatar nanahira

fix

parent 9486cafa
Pipeline #41201 failed with stages
in 26 seconds
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
ApiBody, ApiBody,
ApiConsumes, ApiConsumes,
ApiOkResponse, ApiOkResponse,
ApiOperation,
ApiProduces, ApiProduces,
} from '@nestjs/swagger'; } from '@nestjs/swagger';
import { FileInterceptor } from '@nestjs/platform-express'; import { FileInterceptor } from '@nestjs/platform-express';
...@@ -22,6 +23,9 @@ export class AppController { ...@@ -22,6 +23,9 @@ export class AppController {
constructor(private readonly appService: AppService) {} constructor(private readonly appService: AppService) {}
@Post('fill') @Post('fill')
@ApiOperation({
summary: '生成卡组登记表 PDF',
})
@ApiProduces('application/pdf') @ApiProduces('application/pdf')
@UseInterceptors(FileInterceptor('file')) @UseInterceptors(FileInterceptor('file'))
@ApiConsumes('multipart/form-data') @ApiConsumes('multipart/form-data')
......
...@@ -147,7 +147,7 @@ export class AppService extends ConsoleLogger { ...@@ -147,7 +147,7 @@ export class AppService extends ConsoleLogger {
return new StreamableFile(Buffer.from(await doc.save()), { return new StreamableFile(Buffer.from(await doc.save()), {
type: 'application/pdf', type: 'application/pdf',
disposition: `attachment; filename="deck_${dto.name || Date.now()}.pdf"`, disposition: `attachment; filename="deck_${Date.now()}.pdf"`,
}); });
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment