/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
integration/scopes/src/msvc/hello.controller.ts
24 строки
723 B
Kamil Myśliwiec
fix(microservices): fix request scoped enhancers #2489
02 июл 2019, 14:51
Не верифицирован
02 июл 2019, 14:51
7a93b0d
Код
Авторство
О чём код?
import { Controller, UseGuards, UseInterceptors } from '@nestjs/common'; import { MessagePattern } from '@nestjs/microservices'; import { Guard } from './guards/request-scoped.guard'; import { HelloService } from './hello.service'; import { Interceptor } from './interceptors/logging.interceptor'; import { UsersService } from './users/users.service'; @Controller() export class HelloController { static COUNTER = 0; constructor( private readonly helloService: HelloService, private readonly usersService: UsersService, ) { HelloController.COUNTER++; } @UseGuards(Guard) @UseInterceptors(Interceptor) @MessagePattern('test') greeting(): string { return this.helloService.greeting(); } }