Skip to content

Commit

Permalink
fex: pipe-test string->number
Browse files Browse the repository at this point in the history
  • Loading branch information
QuarkGluonPlasma committed Jun 10, 2023
1 parent 9200459 commit 4c2080f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pipe-test/src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 4c2080f

Please sign in to comment.