-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewbie-jwt.dto.ts
81 lines (66 loc) · 1.62 KB
/
newbie-jwt.dto.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsInt, IsString, Length } from 'class-validator';
export class CharacterIdParam {
@ApiProperty({
description: 'Character ID',
example: 10,
})
@IsInt()
characterId!: number;
}
export class EmailSignUpBody {
@IsEmail()
@ApiProperty({ description: 'Email' })
email!: string;
@IsString()
@ApiProperty({ description: 'Email Verify Code' })
emailVerifyCode!: string;
@IsString()
@ApiProperty({ description: 'Password' })
@Length(8, 32)
password!: string;
@IsString()
@ApiProperty({ description: 'Character name' })
characterName!: string;
}
export class EmailSignInBody {
@IsEmail()
@ApiProperty({ description: 'Email' })
email!: string;
@IsString()
@ApiProperty({ description: 'Password' })
password!: string;
}
export class TokenResponse {
@IsString()
@ApiProperty({ description: 'JWT token' })
token!: string;
}
export class SignupVerifyEmailBody {
@IsEmail()
@ApiProperty({ description: 'Email' })
email!: string;
}
export class VerifyEmailVerifyCodeBody {
@IsEmail()
@ApiProperty({ description: 'Email' })
email!: string;
@ApiProperty({ description: 'Verify Code' })
code!: string;
}
export class SuccessResponse {
@ApiProperty({ description: 'Is the request complete correctly' })
ok!: boolean;
}
export class ResetPasswordBody {
@IsEmail()
@ApiProperty({ description: 'Email' })
email!: string;
@IsString()
@ApiProperty({ description: 'Email Verify Code' })
emailVerifyCode!: string;
@IsString()
@ApiProperty({ description: 'Password' })
@Length(8, 32)
password!: string;
}