Skip to content

Commit

Permalink
✨ feat: 오늘의 상/하위 종목 리스트 API Controller 구현#12
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuo3o committed Nov 6, 2024
1 parent 2af0a7d commit f8c7046
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions BE/src/stocks/topfive/topfive.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { ApiOperation, ApiQuery, ApiResponse } from '@nestjs/swagger';
import { Controller, Get, Query } from '@nestjs/common';
import { TopFiveService, MarketType } from './topfive.service';
import { StockRankingResponseDto } from './dto/stock-ranking-response.dto';

@Controller('/api/stocks')
export class TopfiveController {
constructor(private readonly topFiveService: TopFiveService) {}

@Get('topfive')
@ApiOperation({ summary: '오늘의 상/하위 종목 조회 API' })
@ApiQuery({
name: 'market',
enum: MarketType,
required: true,
description:
'주식 시장 구분\n' +
'ALL: 전체, KOSPI: 코스피, KOSDAQ: 코스닥, KOSPI200: 코스피200',
})
@ApiResponse({
status: 200,
description: '주식 시장별 순위 조회 성공',
type: StockRankingResponseDto,
})
async getTopFive(@Query('market') market: MarketType) {
return this.topFiveService.getMarketRanking(market);
}
}

0 comments on commit f8c7046

Please sign in to comment.