| 1 | import { ApiProperty } from '@nestjs/swagger'; |
| 2 | import { IsNotEmpty, IsOptional, IsString } from 'class-validator'; |
| 3 | |
| 4 | export class LoginDto { |
| 5 | @ApiProperty({ description: '账号' }) |
| 6 | @IsString() |
| 7 | @IsNotEmpty() |
| 8 | account: string; |
| 9 | |
| 10 | @ApiProperty({ description: '密码' }) |
| 11 | @IsString() |
| 12 | @IsNotEmpty() |
| 13 | password: string; |
| 14 | } |
| 15 | |
| 16 | export class CreateManagerDto { |
| 17 | @ApiProperty({ description: '账号' }) |
| 18 | @IsString() |
| 19 | @IsNotEmpty() |
| 20 | account: string; |
| 21 | |
| 22 | @ApiProperty({ description: '密码' }) |
| 23 | @IsString() |
| 24 | @IsNotEmpty() |
| 25 | password: string; |
| 26 | |
| 27 | @ApiProperty({ description: '姓名' }) |
| 28 | @IsString() |
| 29 | @IsNotEmpty() |
| 30 | name: string; |
| 31 | |
| 32 | @ApiProperty({ description: '手机号', required: false }) |
| 33 | @IsString() |
| 34 | @IsOptional() |
| 35 | phone?: string; |
| 36 | } |
| 37 | |
| 38 | export class UpdateManagerDto { |
| 39 | @ApiProperty({ description: '姓名', required: false }) |
| 40 | @IsString() |
| 41 | @IsOptional() |
| 42 | name?: string; |
| 43 | |
| 44 | @ApiProperty({ description: '手机号', required: false }) |
| 45 | @IsString() |
| 46 | @IsOptional() |
| 47 | phone?: string; |
| 48 | |
| 49 | @ApiProperty({ description: '头像', required: false }) |
| 50 | @IsString() |
| 51 | @IsOptional() |
| 52 | avatar?: string; |
| 53 | |
| 54 | @ApiProperty({ description: '密码', required: false }) |
| 55 | @IsString() |
| 56 | @IsOptional() |
| 57 | password?: string; |
| 58 | |
| 59 | @ApiProperty({ description: '盐', required: false }) |
| 60 | @IsString() |
| 61 | @IsOptional() |
| 62 | salt?: string; |
| 63 | } |
| 64 |