generated from Medici-Mansion/basic-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10f2e6f
commit 3b2074f
Showing
17 changed files
with
140 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ export class LoginRequestDTO { | |
|
||
@ApiProperty({ | ||
description: '로그인에 사용할 아이디', | ||
example: '[email protected]', | ||
example: '01099999999', | ||
}) | ||
@IsString() | ||
id: string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { IsNotEmpty, IsString, Length } from 'class-validator' | ||
|
||
export class CheckNicknameDTO { | ||
@ApiProperty({ | ||
title: '닉네임 중복 체크', | ||
example: 'raymond', | ||
}) | ||
@IsString() | ||
@IsNotEmpty() | ||
@Length(2, 15) | ||
nickname: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { ApiProperty } from '@nestjs/swagger' | ||
import { | ||
IsEmail, | ||
IsEnum, | ||
IsNotEmpty, | ||
IsOptional, | ||
IsPhoneNumber, | ||
|
@@ -10,7 +8,6 @@ import { | |
} from 'class-validator' | ||
import { Transform } from 'class-transformer' | ||
|
||
import { IsAccountId } from '@/shared/validators/is-account-id.validator' | ||
import { IsAccountPassword } from '@/shared/validators/is-account-password.validator' | ||
import { IsOnlyDate } from '@/shared/validators/is-date-string.validator' | ||
import { IsUserId } from '@/shared/validators/is-user-id.validator' | ||
|
@@ -36,8 +33,8 @@ interface CreateUserArgs { | |
} | ||
|
||
export class CreateUserDTO { | ||
@IsAccountId() | ||
id: string | ||
// @IsAccountId() | ||
// id: string | ||
@IsAccountPassword() | ||
password: string | ||
|
||
|
@@ -58,14 +55,6 @@ export class CreateUserDTO { | |
@MaxLength(16, { message: '닉네임은 16글자 이상으로 작성할 수 없어요.' }) | ||
nickname: string | ||
|
||
@ApiProperty({ | ||
description: '사용자 성별', | ||
type: Gender, | ||
enum: Gender, | ||
}) | ||
@IsEnum(Gender, { message: '유효하지 않은 성별이에요.' }) | ||
gender: Gender | ||
|
||
@ApiProperty({ | ||
description: '사용자 전화번호', | ||
example: '01093367663', | ||
|
@@ -76,36 +65,44 @@ export class CreateUserDTO { | |
@IsPhoneNumber('KR', { message: '유효하지 않은 번호에요.' }) | ||
phone: string | ||
|
||
@ApiProperty({ | ||
description: '사용자 이메일', | ||
example: '[email protected]', | ||
nullable: true, | ||
}) | ||
@Transform(({ value }) => (value === '' ? null : value)) | ||
@IsOptional() | ||
@IsEmail({}, { message: '유효하지 않은 이메일이에요.' }) | ||
email: string | ||
// @ApiProperty({ | ||
// description: '사용자 성별', | ||
// type: Gender, | ||
// enum: Gender, | ||
// }) | ||
// @IsEnum(Gender, { message: '유효하지 않은 성별이에요.' }) | ||
// gender: Gender | ||
|
||
// @ApiProperty({ | ||
// description: '사용자 이메일', | ||
// example: '[email protected]', | ||
// nullable: true, | ||
// }) | ||
// @Transform(({ value }) => (value === '' ? null : value)) | ||
// @IsOptional() | ||
// @IsEmail({}, { message: '유효하지 않은 이메일이에요.' }) | ||
// email: string | ||
} | ||
|
||
export class CreateUserResponseDTO { | ||
@IsUserId() | ||
id: string | ||
|
||
@ApiProperty({ | ||
description: '사용자 아이디', | ||
description: '사용자 닉네임', | ||
example: 'poopcoco123', | ||
maxLength: 16, | ||
minLength: 6, | ||
}) | ||
@IsNotEmpty({ message: '아이디는 필수에요.' }) | ||
accountId: string | ||
@IsNotEmpty({ message: '닉네임은 필수에요.' }) | ||
nickname: string | ||
|
||
@IsYYYYMMDD() | ||
birthday: Date | ||
|
||
constructor(user: CreateUserArgs) { | ||
this.id = user.id | ||
this.accountId = user.accountId | ||
this.nickname = user.nickname | ||
this.birthday = user.birthday | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ import { IsOnlyDate } from '@/shared/validators/is-date-string.validator' | |
import { ApiProperty } from '@nestjs/swagger' | ||
import { Transform } from 'class-transformer' | ||
import { | ||
IsEmail, | ||
IsEnum, | ||
IsOptional, | ||
IsPhoneNumber, | ||
|
@@ -55,17 +54,17 @@ export class GetMeResponseDTO { | |
@Transform(({ value }) => (value === '' ? undefined : value)) | ||
@IsOptional() | ||
@IsPhoneNumber('KR', { message: '유효하지 않은 번호에요.' }) | ||
phone?: string | null | ||
phone: string | null | ||
|
||
@ApiProperty({ | ||
description: '사용자 이메일', | ||
example: '[email protected]', | ||
nullable: true, | ||
}) | ||
@Transform(({ value }) => (value === '' ? null : value)) | ||
@IsOptional() | ||
@IsEmail({}, { message: '유효하지 않은 이메일이에요.' }) | ||
email?: string | null | ||
// @ApiProperty({ | ||
// description: '사용자 이메일', | ||
// example: '[email protected]', | ||
// nullable: true, | ||
// }) | ||
// @Transform(({ value }) => (value === '' ? null : value)) | ||
// @IsOptional() | ||
// @IsEmail({}, { message: '유효하지 않은 이메일이에요.' }) | ||
// email?: string | null | ||
|
||
@ApiProperty({ | ||
description: '인증 일자', | ||
|
@@ -79,9 +78,7 @@ export class GetMeResponseDTO { | |
this.id = user.id | ||
this.birthday = dayjs(user.birthday).format('YYYY-MM-DD') | ||
this.nickname = user.nickname | ||
this.gender = user.gender | ||
this.phone = user.phone | ||
this.email = user.email | ||
this.verified = user.verified | ||
this.latestProfileId = user.latestProfileId | ||
} | ||
|
Oops, something went wrong.