1. NestJs에 사용되는 기본 decorator

  1. Class Decorator

@Module()

모듈 클래스를 정의

@Controller()

컨트롤러 클래스

@Injectable()

서비스 클래스 (’다른 클래스에 의존성 주입이 가능하다’라는 메서드)

  1. Method Decorator

예시로, HTTP 요청 데코레이터가 있다.

Untitled

  1. Parameter Decorator

Controller의 method에서 들어오는 Request를 처리할 때, 필요한 데이터를 추출하는데 사용

@Body(), @Query(), @Param()

Untitled

@Req(), @Res()