From 2d0b9cfba9609dafe65f7ac692fde99a510bae7a Mon Sep 17 00:00:00 2001 From: seo-wo <4nyth4me@gmail.com> Date: Fri, 1 Dec 2023 16:25:08 +0900 Subject: [PATCH] feat: use dto for types #18 --- src/user/dto/create-user.dto.ts | 18 ++++++++++++++++++ src/user/dto/signup-user.dto.ts | 10 ++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/user/dto/create-user.dto.ts create mode 100644 src/user/dto/signup-user.dto.ts diff --git a/src/user/dto/create-user.dto.ts b/src/user/dto/create-user.dto.ts new file mode 100644 index 0000000..25b13a1 --- /dev/null +++ b/src/user/dto/create-user.dto.ts @@ -0,0 +1,18 @@ +import { IsEmail, IsNotEmpty, IsString } from 'class-validator'; + +export class CreateUserDto { + @IsString() + @IsNotEmpty() + readonly nickname: string; + + @IsString() + readonly slackId: string; + + @IsEmail() + @IsNotEmpty() + readonly email: string; + + @IsString() + @IsNotEmpty() + readonly googleId: string; +} diff --git a/src/user/dto/signup-user.dto.ts b/src/user/dto/signup-user.dto.ts new file mode 100644 index 0000000..1c8629b --- /dev/null +++ b/src/user/dto/signup-user.dto.ts @@ -0,0 +1,10 @@ +import { IsNotEmpty, IsString } from 'class-validator'; + +export class SignUpUserDto { + @IsString() + @IsNotEmpty() + readonly nickname: string; + + @IsString() + readonly slackId: string; +}