NestJS

· NestJS
DTO 란? DTO (Data Transfer Object) 란, 계층 간 데이터 전송을 위해 사용되는 객체이다. DTO의 역할 요청에서 받아온 데이터를 타입에 맞게 바인딩하고 유효성 검사 수행 Controller 계층과 Service 계층 사이에 데이터를 전달 응답 객체로 데이터를 클라이언트에 전달 NestJS에서의 DTO의 형태 export class CreateUserDto { @IsNotEmpty() name: string; @IsNotEmpty() password: string; @IsNotEmpty() email: string; @IsOptional() gender?: string; } 클래스로 선언 Typescript와 class-validator 사용 강력한 데이터 유효성 검사 기능 DTO..
Asher Park
'NestJS' 카테고리의 글 목록