File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
sample/03-microservices/src/math Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { Controller , Get , Inject } from '@nestjs/common' ;
2
- import {
3
- ClientProxy ,
4
- CONTEXT ,
5
- MessagePattern ,
6
- RequestContext ,
7
- } from '@nestjs/microservices' ;
2
+ import { ClientProxy , MessagePattern } from '@nestjs/microservices' ;
8
3
import { Observable } from 'rxjs' ;
9
4
import { MATH_SERVICE } from './math.constants' ;
10
5
11
6
@Controller ( )
12
7
export class MathController {
13
- constructor (
14
- @Inject ( MATH_SERVICE ) private readonly client : ClientProxy ,
15
- @Inject ( CONTEXT ) private readonly ctx : RequestContext < number [ ] > ,
16
- ) { }
8
+ constructor ( @Inject ( MATH_SERVICE ) private readonly client : ClientProxy ) { }
17
9
18
10
@Get ( )
19
11
execute ( ) : Observable < number > {
@@ -24,7 +16,6 @@ export class MathController {
24
16
25
17
@MessagePattern ( { cmd : 'sum' } )
26
18
sum ( data : number [ ] ) : number {
27
- console . log ( this . ctx ) ;
28
19
return ( data || [ ] ) . reduce ( ( a , b ) => a + b ) ;
29
20
}
30
21
}
You can’t perform that action at this time.
0 commit comments