Skip to content

Commit

Permalink
✨ feat: 오늘의 상/하위 종목 조회에 사용할 DTO 구현#12
Browse files Browse the repository at this point in the history
오늘의 상/하위 종목 조회를 위해 필요한 DTO 구현
  • Loading branch information
uuuo3o committed Nov 6, 2024
1 parent a86bf21 commit 414b03c
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
21 changes: 21 additions & 0 deletions BE/src/stocks/topfive/dto/stock-ranking-data.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ApiProperty } from '@nestjs/swagger';

/**
* 등락률 API 요청 후 받은 응답값 정제용 DTO
*/
export class StockRankingDataDto {
@ApiProperty({ description: 'HTS 한글 종목명' })
hts_kor_isnm: string;

@ApiProperty({ description: '주식 현재가' })
stck_prpr: string;

@ApiProperty({ description: '전일 대비' })
prdy_vrss: string;

@ApiProperty({ description: '전일 대비 부호' })
prdy_vrss_sign: string;

@ApiProperty({ description: '전일 대비율' })
prdy_ctrt: string;
}
23 changes: 23 additions & 0 deletions BE/src/stocks/topfive/dto/stock-ranking-request.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* 등락률 API를 사용할 때 쿼리 파라미터로 사용할 요청값 DTO
*/
export class StockRankigRequestDto {
/**
* 조건 시장 분류 코드
* 'J' 주식
*/
fid_cond_mrkt_div_code: string;

/**
* 입력 종목 코드
* '0000' 전체 / '0001' 코스피
* '1001' 코스닥 / '2001' 코스피200
*/
fid_input_iscd: string;

/**
* 순위 정렬 구분 코드
* '0' 상승률 / '1' 하락률
*/
fid_rank_sort_cls_code: string;
}
13 changes: 13 additions & 0 deletions BE/src/stocks/topfive/dto/stock-ranking-response.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ApiProperty } from '@nestjs/swagger';
import { StockRankingDataDto } from './stock-ranking-data.dto';

/**
* 순위 정렬 후 FE에 보낼 DTO
*/
export class StockRankingResponseDto {
@ApiProperty({ type: [StockRankingDataDto], description: '상승률 순위' })
high: StockRankingDataDto[];

@ApiProperty({ type: [StockRankingDataDto], description: '하락률 순위' })
low: StockRankingDataDto[];
}

0 comments on commit 414b03c

Please sign in to comment.