diff --git a/BE/src/stock/list/dto/stock-list-response.dto.ts b/BE/src/stock/list/dto/stock-list-response.dto.ts index b1dcb7b9..d7df39b4 100644 --- a/BE/src/stock/list/dto/stock-list-response.dto.ts +++ b/BE/src/stock/list/dto/stock-list-response.dto.ts @@ -1,13 +1,17 @@ import { ApiProperty } from '@nestjs/swagger'; export class StockListResponseDto { - @ApiProperty({ example: '005930', description: '종목 코드' }) + @ApiProperty({ example: '005930', description: '종목 코드', required: false }) code: string; - @ApiProperty({ example: '삼성전자', description: '종목 이름' }) + @ApiProperty({ + example: '삼성전자', + description: '종목 이름', + required: false, + }) name: string; - @ApiProperty({ example: 'KOSPI', description: '시장' }) + @ApiProperty({ example: 'KOSPI', description: '시장', required: false }) market: string; constructor(code: string, name: string, market: string) { diff --git a/BE/src/stock/list/stock-list.controller.ts b/BE/src/stock/list/stock-list.controller.ts index 33f7d2ee..427f9ff8 100644 --- a/BE/src/stock/list/stock-list.controller.ts +++ b/BE/src/stock/list/stock-list.controller.ts @@ -1,5 +1,5 @@ import { Controller, Get, Query } from '@nestjs/common'; -import { ApiOperation, ApiResponse, ApiTags } from '@nestjs/swagger'; +import { ApiOperation, ApiQuery, ApiResponse, ApiTags } from '@nestjs/swagger'; import { StockListService } from './stock-list.service'; import { StockListResponseDto } from './dto/stock-list-response.dto'; @@ -28,6 +28,9 @@ export class StockListController { type: StockListResponseDto, isArray: true, }) + @ApiQuery({ name: 'name', required: false }) + @ApiQuery({ name: 'market', required: false }) + @ApiQuery({ name: 'code', required: false }) @Get('/search') async searchWithQuery( @Query('name') name?: string,