| 1 | // 创建组 Dto |
| 2 | import { IsArray, IsNumber, IsOptional, IsString } from 'class-validator'; |
| 3 | import { ApiProperty } from '@nestjs/swagger'; |
| 4 | import { Expose } from 'class-transformer'; |
| 5 | |
| 6 | export class CreateAccountGroupDto { |
| 7 | @ApiProperty({ description: '组名称' }) |
| 8 | @IsString() |
| 9 | @Expose() |
| 10 | name: string; |
| 11 | |
| 12 | @ApiProperty({ description: '组排序,默认为 1' }) |
| 13 | @IsNumber() |
| 14 | @IsOptional() |
| 15 | @Expose() |
| 16 | rank?: number; |
| 17 | } |
| 18 | |
| 19 | export class UpdateAccountGroupDto extends CreateAccountGroupDto { |
| 20 | @ApiProperty({ description: '更新ID' }) |
| 21 | @IsNumber() |
| 22 | @Expose() |
| 23 | id: number; |
| 24 | } |
| 25 | |
| 26 | export class DeleteAccountGroupDto { |
| 27 | @ApiProperty({ description: '要删除的ID' }) |
| 28 | @IsArray() |
| 29 | @IsNumber({}, { each: true }) |
| 30 | @Expose() |
| 31 | ids: number[]; |
| 32 | } |
| 33 |