Skip to content

Commit

Permalink
Merge pull request #95 from boostcampwm-2024/feature/api/stockList-#57
Browse files Browse the repository at this point in the history
📝 docs : swagger 문서 Parameter 필수 수정
  • Loading branch information
jinddings authored Nov 14, 2024
2 parents e42261d + c570788 commit 0d2fc52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 7 additions & 3 deletions BE/src/stock/list/dto/stock-list-response.dto.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion BE/src/stock/list/stock-list.controller.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0d2fc52

Please sign in to comment.