Skip to content

Commit

Permalink
feat: Add UploadImageDTO for image uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
suk-6 committed Sep 17, 2024
1 parent d4d4285 commit 662353d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/product/dto/upload.image.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';

export class UploadImageDTO {
@ApiProperty({ description: 'base64 이미지', type: 'string' })
image: string;
}
5 changes: 5 additions & 0 deletions src/modules/product/product.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { CreateProductDTO } from './dto/create.product.dto';
import { CreateProductQnADTO } from './dto/create.qna.dto';
import { GetProductDTO, GetProductsDTO } from './dto/get.product.dto';
import { SearchProductDTO } from './dto/search.product.dto';
import { UploadImageDTO } from './dto/upload.image.dto';
import { ProductService } from './product.service';

@Controller('product')
Expand Down Expand Up @@ -55,6 +56,10 @@ export class ProductController {
@Put('image')
@ApiBearerAuth()
@UseGuards(AuthGuard('access'))
@ApiBody({
type: UploadImageDTO,
description: 'Upload product image',
})
@ApiOperation({ summary: '상품 이미지 업로드' })
@ApiOkResponse({ description: 'Success' })
@ApiUnauthorizedResponse({ description: 'Unauthorized' })
Expand Down

0 comments on commit 662353d

Please sign in to comment.