From 7ca6c8c38789b924ba66748cb7edc4ad8b44f617 Mon Sep 17 00:00:00 2001 From: JeonHeena Date: Thu, 12 Dec 2024 14:07:13 +0900 Subject: [PATCH] =?UTF-8?q?feat/#41/dto=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/items/dto/item-changeStatus.dto.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/items/dto/item-changeStatus.dto.ts b/src/items/dto/item-changeStatus.dto.ts index 5e1cde3..d16d9b6 100644 --- a/src/items/dto/item-changeStatus.dto.ts +++ b/src/items/dto/item-changeStatus.dto.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { IsInt, Min } from 'class-validator'; +import { IsArray, ArrayNotEmpty, IsInt, Min } from 'class-validator'; export class ItemChangeStatusDto { @ApiProperty({ @@ -21,7 +21,14 @@ export class ItemChangeStatusDto { itemId: number; } -// export class EquipItemDto extends ItemChangeStatusDto {} -// export class UnequipItemDto extends ItemChangeStatusDto {} -// export class BuyItemDto extends ItemChangeStatusDto {} -// export class AddItemDto extends ItemChangeStatusDto {} +export class BuyItemDto extends ItemChangeStatusDto { + @ApiProperty({ + description: '아이템 ID 배열', + example: [1, 2, 3], + }) + @IsArray() + @ArrayNotEmpty() //비어있는 배열 안된다 + @IsInt({ each: true }) + @Min(1, { each: true }) + itemIds: number[]; +}