From 4c2080f29bbf85561b7f5435dbb4938ecafa5939 Mon Sep 17 00:00:00 2001 From: guang Date: Sat, 10 Jun 2023 09:58:15 +0800 Subject: [PATCH] fex: pipe-test string->number --- pipe-test/src/app.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipe-test/src/app.controller.ts b/pipe-test/src/app.controller.ts index 09b6020..044860d 100644 --- a/pipe-test/src/app.controller.ts +++ b/pipe-test/src/app.controller.ts @@ -17,14 +17,14 @@ export class AppController { constructor(private readonly appService: AppService) {} @Get() - getHello(@Query('aa', ParseIntPipe) aa: string): string { + getHello(@Query('aa', ParseIntPipe) aa: number): number { return aa + 1; } @Get('aa') aa(@Query('aa', new ParseIntPipe({ errorHttpStatusCode: HttpStatus.NOT_FOUND - })) aa: string): string { + })) aa: number): number { return aa + 1; } @@ -34,7 +34,7 @@ export class AppController { console.log(msg); throw new HttpException('xxx ' + msg, HttpStatus.NOT_IMPLEMENTED) } - })) aa: string): string { + })) aa: number): number { return aa + 1; }