| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2024-06-17 20:12:31 |
| 4 | * @LastEditTime: 2025-05-06 15:49:03 |
| 5 | * @LastEditors: nevin |
| 6 | * @Description: 用户 |
| 7 | */ |
| 8 | import { ApiProperty } from '@nestjs/swagger'; |
| 9 | import { Expose } from 'class-transformer'; |
| 10 | import { IsEmail, IsOptional, IsString } from 'class-validator'; |
| 11 | |
| 12 | export class MailLoginDto { |
| 13 | @ApiProperty({ title: '邮箱', required: true }) |
| 14 | @IsEmail({}, { message: '邮箱' }) |
| 15 | @Expose() |
| 16 | readonly mail: string; |
| 17 | |
| 18 | @ApiProperty({ required: true }) |
| 19 | @IsString({ message: '密码' }) |
| 20 | @Expose() |
| 21 | readonly password: string; |
| 22 | } |
| 23 | |
| 24 | export class MailRegistUrlDto { |
| 25 | @ApiProperty({ title: '邮箱', required: true }) |
| 26 | @IsEmail({}, { message: '邮箱' }) |
| 27 | @Expose() |
| 28 | readonly mail: string; |
| 29 | |
| 30 | @ApiProperty({ required: true }) |
| 31 | @IsString({ message: '验证码' }) |
| 32 | @Expose() |
| 33 | readonly code: string; |
| 34 | } |
| 35 | |
| 36 | export class GetRegistByMailBackDto { |
| 37 | @ApiProperty({ required: true }) |
| 38 | @IsString({ message: '验证码' }) |
| 39 | @Expose() |
| 40 | readonly code: string; |
| 41 | |
| 42 | @ApiProperty({ title: '邮箱', required: true }) |
| 43 | @IsEmail({}, { message: '邮箱' }) |
| 44 | @Expose() |
| 45 | readonly mail: string; |
| 46 | |
| 47 | @ApiProperty({ required: true }) |
| 48 | @IsString({ message: '密码' }) |
| 49 | @Expose() |
| 50 | readonly password: string; |
| 51 | |
| 52 | @ApiProperty({ required: false }) |
| 53 | @IsString({ message: '邀请码' }) |
| 54 | @IsOptional() |
| 55 | @Expose() |
| 56 | readonly inviteCode?: string; |
| 57 | } |
| 58 | |
| 59 | export class MailRepasswordDto { |
| 60 | @ApiProperty({ title: '邮箱', required: true }) |
| 61 | @IsEmail({}, { message: '邮箱' }) |
| 62 | @Expose() |
| 63 | readonly mail: string; |
| 64 | } |
| 65 |