From afc77fbdda087353cddee53e110f15a599cda62b Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 14:15:10 +0900 Subject: [PATCH 01/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=A3=BC=EC=8B=9D?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EA=B0=80=20API=20=EC=9A=94=EC=B2=AD=EC=97=90?= =?UTF-8?q?=20=EB=8C=80=ED=95=9C=20=EC=9D=91=EB=8B=B5=EA=B0=92=20interface?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interface/stock-detail.interface.ts | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 BE/src/stock/detail/interface/stock-detail.interface.ts diff --git a/BE/src/stock/detail/interface/stock-detail.interface.ts b/BE/src/stock/detail/interface/stock-detail.interface.ts new file mode 100644 index 00000000..00eb2045 --- /dev/null +++ b/BE/src/stock/detail/interface/stock-detail.interface.ts @@ -0,0 +1,85 @@ +export interface InquirePriceOutputData { + iscd_stat_cls_code: string; + marg_rate: string; + rprs_mrkt_kor_name: string; + new_hgpr_lwpr_cls_code: string; + btsp_kor_isnm: string; + temp_stop_yn: string; + oprc_rang_cont_yn: string; + clpr_rang_cont_yn: string; + crdt_able_yn: string; + grmn_rate_cls_code: string; + elw_pblc_yn: string; + stck_prpr: string; + prdy_vrss: string; + prdy_vrss_sign: string; + prdy_ctrt: string; + acml_tr_pbmn: string; + acml_vol: string; + prdy_vrss_vol_rate: string; + stck_oprc: string; + stck_hgpr: string; + stck_lwpr: string; + stck_mxpr: string; + stck_llam: string; + stck_sdpr: string; + wghn_avrg_stck_prc: string; + hts_frgn_ehrt: string; + frgn_ntby_qty: string; + pgtr_ntby_qty: string; + dmrs_val: string; + dmsp_val: string; + cpfn: string; + rstc_wdth_prc: string; + stck_fcam: string; + stck_sspr: string; + aspr_unit: string; + hts_deal_qty_unit_val: string; + lstn_stcn: string; + hts_avls: string; + per: string; + pbr: string; + stac_month: string; + vol_tnrt: string; + eps: string; + bps: string; + d250_hgpr: string; + d250_hgpr_date: string; + d250_hgpr_vrss_prpr_rate: string; + d250_lwpr: string; + d250_lwpr_date: string; + d250_lwpr_vrss_prpr_rate: string; + stck_dryy_hgpr: string; + dryy_hgpr_vrss_prpr_rate: string; + dryy_hgpr_date: string; + stck_dryy_lwpr: string; + dryy_lwpr_vrss_prpr_rate: string; + dryy_lwpr_date: string; + w52_hgpr: string; + w52_hgpr_vrss_prpr_ctrt: string; + w52_hgpr_date: string; + w52_lwpr: string; + w52_lwpr_vrss_prpr_ctrt: string; + w52_lwpr_date: string; + whol_loan_rmnd_rate: string; + ssts_yn: string; + stck_shrn_iscd: string; + fcam_cnnm: string; + cpfn_cnnm: string; + apprch_rate: string; + frgn_hldn_qty: string; + vi_cls_code: string; + ovtm_vi_cls_code: string; + last_ssts_cntg_qty: string; + invt_caful_yn: string; + mrkt_warn_cls_code: string; + short_over_yn: string; + sltr_yn: string; +} + +export interface InquirePriceApiResponse { + output: InquirePriceOutputData[]; + rt_cd: string; + msg_cd: string; + msg1: string; +} From 1a48a8b83aca488979f4a9aed07fb0fd0093d79a Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 14:15:29 +0900 Subject: [PATCH 02/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=A3=BC=EC=8B=9D?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EA=B0=80=20API=20=EC=9A=94=EC=B2=AD=EC=97=90?= =?UTF-8?q?=20=ED=95=84=EC=9A=94=ED=95=9C=20=EC=BF=BC=EB=A6=AC=20=ED=8C=8C?= =?UTF-8?q?=EB=9D=BC=EB=AF=B8=ED=84=B0=20DTO=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stock/detail/dto/stock-detail-request.dto.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 BE/src/stock/detail/dto/stock-detail-request.dto.ts diff --git a/BE/src/stock/detail/dto/stock-detail-request.dto.ts b/BE/src/stock/detail/dto/stock-detail-request.dto.ts new file mode 100644 index 00000000..46392101 --- /dev/null +++ b/BE/src/stock/detail/dto/stock-detail-request.dto.ts @@ -0,0 +1,16 @@ +/** + * 주식 현재가 시세 API를 사용할 때 쿼리 파라미터로 사용할 요청값 DTO + */ +export class StockDetailQueryParameterDto { + /** + * 조건 시장 분류 코드 + * 'J' 주식 + */ + fid_cond_mrkt_div_code: string; + + /** + * 주식 종목 코드 + * (ex) 005930 + */ + fid_input_iscd: string; +} From 3053dd2df0249186ff07f76b037141c5c87ef0d6 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 14:17:45 +0900 Subject: [PATCH 03/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=A3=BC=EC=8B=9D?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EA=B0=80=20API=20=EC=9A=94=EC=B2=AD=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/stock/detail/stock-detail.service.ts | 62 +++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 BE/src/stock/detail/stock-detail.service.ts diff --git a/BE/src/stock/detail/stock-detail.service.ts b/BE/src/stock/detail/stock-detail.service.ts new file mode 100644 index 00000000..ff7a5864 --- /dev/null +++ b/BE/src/stock/detail/stock-detail.service.ts @@ -0,0 +1,62 @@ +import axios from 'axios'; +import { Injectable, Logger } from '@nestjs/common'; +import { KoreaInvestmentService } from '../../koreaInvestment/korea-investment.service'; +import { getHeader } from '../../util/get-header'; +import { getFullURL } from '../../util/get-full-URL'; +import { StockDetailQueryParameterDto } from './dto/stock-detail-request.dto'; +import { InquirePriceApiResponse } from './interface/stock-detail.interface'; + +@Injectable() +export class StockDetailService { + private readonly logger = new Logger(); + + constructor(private readonly koreaInvetmentService: KoreaInvestmentService) {} + + /** + * @private 한국투자 Open API - [국내주식] 기본시세 - 주식현재가 시세 호출 함수 + * @param {StockDetailQueryParameterDto} queryParams - API 요청 시 필요한 쿼리 파라미터 DTO + * @returns - 주식현재가 시세 데이터 + * + * @author uuuo3o + */ + private async requestApi(queryParams: StockDetailQueryParameterDto) { + try { + const accessToken = await this.koreaInvetmentService.getAccessToken(); + const headers = getHeader(accessToken, 'FHKST01010100'); + const url = getFullURL( + '/uapi/domestic-stock/v1/quotations/inquire-price', + ); + const params = this.getInquirePriceParams(queryParams); + + const response = await axios.get(url, { + headers, + params, + }); + + return response.data; + } catch (error) { + this.logger.error('API Error Details:', { + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + headers: error.response?.config?.headers, + message: error.message, + }); + throw error; + } + } + + /** + * @private 주식현재가 시세 요청을 위한 쿼리 파라미터 객체 생성 함수 + * @param {StockDetailQueryParameterDto} params - API 요청에 필요한 쿼리 파라미터 DTO + * @returns - API 요청에 필요한 쿼리 파라미터 객체 + * + * @author uuuo3o + */ + private getInquirePriceParams(params: StockDetailQueryParameterDto) { + return { + fid_cond_mrkt_div_code: params.fid_cond_mrkt_div_code, + fid_input_iscd: params.fid_input_iscd, + }; + } +} From 05200cf7a2ce5dd293eb224b29b762251ea238b7 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 14:57:29 +0900 Subject: [PATCH 04/14] =?UTF-8?q?=F0=9F=94=A7=20fix:=20output=EC=97=90=20?= =?UTF-8?q?=EB=8C=80=ED=95=9C=20=EC=A0=95=EB=B3=B4=EA=B0=80=20=EC=9E=98?= =?UTF-8?q?=EB=AA=BB=EB=90=9C=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/stock/detail/interface/stock-detail.interface.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/src/stock/detail/interface/stock-detail.interface.ts b/BE/src/stock/detail/interface/stock-detail.interface.ts index 00eb2045..9a7dc8c4 100644 --- a/BE/src/stock/detail/interface/stock-detail.interface.ts +++ b/BE/src/stock/detail/interface/stock-detail.interface.ts @@ -78,7 +78,7 @@ export interface InquirePriceOutputData { } export interface InquirePriceApiResponse { - output: InquirePriceOutputData[]; + output: InquirePriceOutputData; rt_cd: string; msg_cd: string; msg1: string; From 35b332dfe8bdaa158bec5ae9989c740427c10e9b Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 15:00:34 +0900 Subject: [PATCH 05/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=A3=BC=EC=8B=9D?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EA=B0=80=20API=EB=A1=9C=EB=B6=80=ED=84=B0=20?= =?UTF-8?q?=EB=B0=9B=EC=95=84=EC=98=A8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=A0=95=EC=A0=9C=20=EB=B0=8F=20=EB=B0=98=ED=99=98=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/dto/stock-detail-request.dto.ts | 5 ++ BE/src/stock/detail/stock-detail.service.ts | 52 ++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/BE/src/stock/detail/dto/stock-detail-request.dto.ts b/BE/src/stock/detail/dto/stock-detail-request.dto.ts index 46392101..3f5655d6 100644 --- a/BE/src/stock/detail/dto/stock-detail-request.dto.ts +++ b/BE/src/stock/detail/dto/stock-detail-request.dto.ts @@ -13,4 +13,9 @@ export class StockDetailQueryParameterDto { * (ex) 005930 */ fid_input_iscd: string; + + constructor(fid_cond_mrkt_div_code: string, fid_input_iscd: string) { + this.fid_cond_mrkt_div_code = fid_cond_mrkt_div_code; + this.fid_input_iscd = fid_input_iscd; + } } diff --git a/BE/src/stock/detail/stock-detail.service.ts b/BE/src/stock/detail/stock-detail.service.ts index ff7a5864..d8e6dbaf 100644 --- a/BE/src/stock/detail/stock-detail.service.ts +++ b/BE/src/stock/detail/stock-detail.service.ts @@ -4,7 +4,11 @@ import { KoreaInvestmentService } from '../../koreaInvestment/korea-investment.s import { getHeader } from '../../util/get-header'; import { getFullURL } from '../../util/get-full-URL'; import { StockDetailQueryParameterDto } from './dto/stock-detail-request.dto'; -import { InquirePriceApiResponse } from './interface/stock-detail.interface'; +import { + InquirePriceApiResponse, + InquirePriceOutputData, +} from './interface/stock-detail.interface'; +import { StockDetailDataDto } from './dto/stock-detail-data.dto'; @Injectable() export class StockDetailService { @@ -12,6 +16,32 @@ export class StockDetailService { constructor(private readonly koreaInvetmentService: KoreaInvestmentService) {} + /** + * 특정 주식의 주식현재가 시세 데이터를 반환하는 함수 + * @param {string} stockCode - 종목코드 + * @returns - 주식현재가 시세 데이터 객체 반환 + * + * @author uuuo3o + */ + async getInquirePrice(stockCode: string) { + try { + const queryParams = new StockDetailQueryParameterDto('J', stockCode); + + const response = await this.requestApi(queryParams); + + return this.formatStockData(response.output); + } catch (error) { + this.logger.error('API Error Details:', { + status: error.response?.status, + statusText: error.response?.statusText, + data: error.response?.data, + headers: error.response?.config?.headers, // 실제 요청 헤더 + message: error.message, + }); + throw error; + } + } + /** * @private 한국투자 Open API - [국내주식] 기본시세 - 주식현재가 시세 호출 함수 * @param {StockDetailQueryParameterDto} queryParams - API 요청 시 필요한 쿼리 파라미터 DTO @@ -46,6 +76,26 @@ export class StockDetailService { } } + /** + * @private API에서 받은 주식현재가 시세 데이터를 필요한 정보로 정제하는 함수 + * @param {InquirePriceOutputData} stock - API 응답에서 받은 원시 데이터 + * @returns - 필요한 정보만 추출한 데이터 배열 + * + * @author uuuo3o + */ + private formatStockData(stock: InquirePriceOutputData) { + const stockData = new StockDetailDataDto(); + stockData.stck_shrn_iscd = stock.stck_shrn_iscd; + stockData.stck_prpr = stock.stck_prpr; + stockData.prdy_vrss = stock.prdy_vrss; + stockData.prdy_vrss_sign = stock.prdy_vrss_sign; + stockData.prdy_ctrt = stock.prdy_ctrt; + stockData.hts_avls = stock.hts_avls; + stockData.per = stock.per; + + return stockData; + } + /** * @private 주식현재가 시세 요청을 위한 쿼리 파라미터 객체 생성 함수 * @param {StockDetailQueryParameterDto} params - API 요청에 필요한 쿼리 파라미터 DTO From 08bb77d92b86e2b50ec04a623e22384d2cf2e0fb Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 15:00:56 +0900 Subject: [PATCH 06/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=ED=8A=B9=EC=A0=95=20?= =?UTF-8?q?=EC=A3=BC=EC=8B=9D=EC=9D=98=20=EC=A3=BC=EC=8B=9D=ED=98=84?= =?UTF-8?q?=EC=9E=AC=EA=B0=80=20=EC=8B=9C=EC=84=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=EB=A5=BC=20=EB=B0=98=ED=99=98=ED=95=98=EB=8A=94=20con?= =?UTF-8?q?troller=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/app.module.ts | 2 ++ .../stock/detail/stock-detail.controller.ts | 27 +++++++++++++++++++ BE/src/stock/detail/stock-detail.module.ts | 11 ++++++++ 3 files changed, 40 insertions(+) create mode 100644 BE/src/stock/detail/stock-detail.controller.ts create mode 100644 BE/src/stock/detail/stock-detail.module.ts diff --git a/BE/src/app.module.ts b/BE/src/app.module.ts index 114ecadf..4773fba1 100644 --- a/BE/src/app.module.ts +++ b/BE/src/app.module.ts @@ -10,6 +10,7 @@ import { StockIndexModule } from './stock/index/stock-index.module'; import { StockTopfiveModule } from './stock/topfive/stock-topfive.module'; import { KoreaInvestmentModule } from './koreaInvestment/korea-investment.module'; import { SocketModule } from './websocket/socket.module'; +import { StockDetailModule } from './stock/detail/stock-detail.module'; @Module({ imports: [ @@ -30,6 +31,7 @@ import { SocketModule } from './websocket/socket.module'; StockIndexModule, StockTopfiveModule, SocketModule, + StockDetailModule, ], controllers: [AppController], providers: [AppService], diff --git a/BE/src/stock/detail/stock-detail.controller.ts b/BE/src/stock/detail/stock-detail.controller.ts new file mode 100644 index 00000000..346e13b7 --- /dev/null +++ b/BE/src/stock/detail/stock-detail.controller.ts @@ -0,0 +1,27 @@ +import { Controller, Get, Param } from '@nestjs/common'; +import { ApiOperation, ApiParam, ApiResponse } from '@nestjs/swagger'; +import { StockDetailService } from './stock-detail.service'; +import { StockDetailDataDto } from './dto/stock-detail-data.dto'; + +@Controller('/api/stocks') +export class StockDetailController { + constructor(private readonly stockDetailService: StockDetailService) {} + + @Get(':stockCode') + @ApiOperation({ summary: '단일 주식 종목 detail 페이지 상단부 조회 API' }) + @ApiParam({ + name: 'stockCode', + required: true, + description: + '종목 코드\n' + + '(ex) 005930 삼성전자 / 005380 현대차 / 001500 현대차증권', + }) + @ApiResponse({ + status: 200, + description: '단일 주식 종목 기본값 조회 성공', + type: StockDetailDataDto, + }) + getStockDetail(@Param('stockCode') stockCode: string) { + return this.stockDetailService.getInquirePrice(stockCode); + } +} diff --git a/BE/src/stock/detail/stock-detail.module.ts b/BE/src/stock/detail/stock-detail.module.ts new file mode 100644 index 00000000..cfb2b57b --- /dev/null +++ b/BE/src/stock/detail/stock-detail.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common'; +import { KoreaInvestmentModule } from '../../koreaInvestment/korea-investment.module'; +import { StockDetailController } from './stock-detail.controller'; +import { StockDetailService } from './stock-detail.service'; + +@Module({ + imports: [KoreaInvestmentModule], + controllers: [StockDetailController], + providers: [StockDetailService], +}) +export class StockDetailModule {} From 59ecabb10fca05c92a6105237a8759cd69d1122b Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 15:28:18 +0900 Subject: [PATCH 07/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=ED=8A=B9=EC=A0=95=20?= =?UTF-8?q?=EC=A3=BC=EC=8B=9D=EC=9D=98=20=EC=A3=BC=EC=8B=9D=ED=98=84?= =?UTF-8?q?=EC=9E=AC=EA=B0=80=20=EC=8B=9C=EC=84=B8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EB=B0=98=ED=99=98=20DTO=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stock/detail/dto/stock-detail-data.dto.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 BE/src/stock/detail/dto/stock-detail-data.dto.ts diff --git a/BE/src/stock/detail/dto/stock-detail-data.dto.ts b/BE/src/stock/detail/dto/stock-detail-data.dto.ts new file mode 100644 index 00000000..0ecaba3e --- /dev/null +++ b/BE/src/stock/detail/dto/stock-detail-data.dto.ts @@ -0,0 +1,27 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class StockDetailDataDto { + @ApiProperty({ description: 'HTS 한글 종목명' }) + hts_kor_isnm: string; + + @ApiProperty({ description: '종목코드' }) + stck_shrn_iscd: string; + + @ApiProperty({ description: '주식 현재가' }) + stck_prpr: string; + + @ApiProperty({ description: '전일 대비' }) + prdy_vrss: string; + + @ApiProperty({ description: '전일 대비 부호' }) + prdy_vrss_sign: string; + + @ApiProperty({ description: '전일 대비율' }) + prdy_ctrt: string; + + @ApiProperty({ description: 'HTS 시가총액' }) + hts_avls: string; + + @ApiProperty({ description: 'per' }) + per: string; +} From c1ff7ee752f696f674707a31900680dc59f3d3aa Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 15:31:06 +0900 Subject: [PATCH 08/14] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20chore:=20=EB=A6=B0?= =?UTF-8?q?=ED=8A=B8=20=EA=B7=9C=EC=B9=99=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/.eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/BE/.eslintrc.js b/BE/.eslintrc.js index 0cea1c7c..b54cc5a8 100644 --- a/BE/.eslintrc.js +++ b/BE/.eslintrc.js @@ -34,5 +34,6 @@ module.exports = { 'class-methods-use-this': 'off', '@typescript-eslint/no-unsafe-assignment': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/naming-convention': 'off', }, }; From b760a202d76abfefffd029c5483addbd367f3d1e Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 16:20:48 +0900 Subject: [PATCH 09/14] =?UTF-8?q?=F0=9F=94=A7=20fix:=20=EA=B5=AD=EB=82=B4?= =?UTF-8?q?=EC=A3=BC=EC=8B=9D=EA=B8=B0=EA=B0=84=EB=B3=84=EC=8B=9C=EC=84=B8?= =?UTF-8?q?=20API=EC=97=90=20=EC=82=AC=EC=9A=A9=ED=95=A0=20interface?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interface/stock-detail.interface.ts | 103 +++++++----------- 1 file changed, 37 insertions(+), 66 deletions(-) diff --git a/BE/src/stock/detail/interface/stock-detail.interface.ts b/BE/src/stock/detail/interface/stock-detail.interface.ts index 9a7dc8c4..1169eb90 100644 --- a/BE/src/stock/detail/interface/stock-detail.interface.ts +++ b/BE/src/stock/detail/interface/stock-detail.interface.ts @@ -1,84 +1,55 @@ -export interface InquirePriceOutputData { - iscd_stat_cls_code: string; - marg_rate: string; - rprs_mrkt_kor_name: string; - new_hgpr_lwpr_cls_code: string; - btsp_kor_isnm: string; - temp_stop_yn: string; - oprc_rang_cont_yn: string; - clpr_rang_cont_yn: string; - crdt_able_yn: string; - grmn_rate_cls_code: string; - elw_pblc_yn: string; - stck_prpr: string; +export interface InquirePriceOutput1Data { prdy_vrss: string; prdy_vrss_sign: string; prdy_ctrt: string; - acml_tr_pbmn: string; + stck_prdy_clpr: string; acml_vol: string; - prdy_vrss_vol_rate: string; + acml_tr_pbmn: string; + hts_kor_isnm: string; + stck_prpr: string; + stck_shrn_iscd: string; + prdy_vol: string; + stck_mxpr: string; + stck_llam: string; stck_oprc: string; stck_hgpr: string; stck_lwpr: string; - stck_mxpr: string; - stck_llam: string; - stck_sdpr: string; - wghn_avrg_stck_prc: string; - hts_frgn_ehrt: string; - frgn_ntby_qty: string; - pgtr_ntby_qty: string; - dmrs_val: string; - dmsp_val: string; - cpfn: string; - rstc_wdth_prc: string; + stck_prdy_oprc: string; + stck_prdy_hgpr: string; + stck_prdy_lwpr: string; + askp: string; + bidp: string; + prdy_vrss_vol: string; + vol_tnrt: string; stck_fcam: string; - stck_sspr: string; - aspr_unit: string; - hts_deal_qty_unit_val: string; lstn_stcn: string; + cpfn: string; hts_avls: string; per: string; - pbr: string; - stac_month: string; - vol_tnrt: string; eps: string; - bps: string; - d250_hgpr: string; - d250_hgpr_date: string; - d250_hgpr_vrss_prpr_rate: string; - d250_lwpr: string; - d250_lwpr_date: string; - d250_lwpr_vrss_prpr_rate: string; - stck_dryy_hgpr: string; - dryy_hgpr_vrss_prpr_rate: string; - dryy_hgpr_date: string; - stck_dryy_lwpr: string; - dryy_lwpr_vrss_prpr_rate: string; - dryy_lwpr_date: string; - w52_hgpr: string; - w52_hgpr_vrss_prpr_ctrt: string; - w52_hgpr_date: string; - w52_lwpr: string; - w52_lwpr_vrss_prpr_ctrt: string; - w52_lwpr_date: string; - whol_loan_rmnd_rate: string; - ssts_yn: string; - stck_shrn_iscd: string; - fcam_cnnm: string; - cpfn_cnnm: string; - apprch_rate: string; - frgn_hldn_qty: string; - vi_cls_code: string; - ovtm_vi_cls_code: string; - last_ssts_cntg_qty: string; - invt_caful_yn: string; - mrkt_warn_cls_code: string; - short_over_yn: string; - sltr_yn: string; + pbr: string; + itewhol_loan_rmnd_ratem_name: string; +} + +export interface InquirePriceOutput2Data { + stck_bsop_date: string; + stck_clpr: string; + stck_oprc: string; + stck_hgpr: string; + stck_lwpr: string; + acml_vol: string; + acml_tr_pbmn: string; + flng_cls_code: string; + prtt_rate: string; + mod_yn: string; + prdy_vrss_sign: string; + prdy_vrss: string; + revl_issu_reas: string; } export interface InquirePriceApiResponse { - output: InquirePriceOutputData; + output1: InquirePriceOutput1Data; + output2: InquirePriceOutput2Data[]; rt_cd: string; msg_cd: string; msg1: string; From 1c163ea419199815146205ea1d659ec84cea42d5 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 16:54:16 +0900 Subject: [PATCH 10/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=EA=B5=AD=EB=82=B4?= =?UTF-8?q?=EC=A3=BC=EC=8B=9D=EA=B8=B0=EA=B0=84=EB=B3=84=EC=8B=9C=EC=84=B8?= =?UTF-8?q?=20API=EC=97=90=20=EC=82=AC=EC=9A=A9=ED=95=A0=20DTO=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ata.dto.ts => stock-detail-output1.dto.ts} | 4 +- .../detail/dto/stock-detail-output2.dto.ts | 42 +++++++++++++++++++ .../detail/dto/stock-detail-request.dto.ts | 27 ++++++++++-- .../detail/dto/stock-detail-response.dto.ts | 14 +++++++ .../stock/detail/stock-detail.controller.ts | 4 +- 5 files changed, 83 insertions(+), 8 deletions(-) rename BE/src/stock/detail/dto/{stock-detail-data.dto.ts => stock-detail-output1.dto.ts} (88%) create mode 100644 BE/src/stock/detail/dto/stock-detail-output2.dto.ts create mode 100644 BE/src/stock/detail/dto/stock-detail-response.dto.ts diff --git a/BE/src/stock/detail/dto/stock-detail-data.dto.ts b/BE/src/stock/detail/dto/stock-detail-output1.dto.ts similarity index 88% rename from BE/src/stock/detail/dto/stock-detail-data.dto.ts rename to BE/src/stock/detail/dto/stock-detail-output1.dto.ts index 0ecaba3e..aa911bd1 100644 --- a/BE/src/stock/detail/dto/stock-detail-data.dto.ts +++ b/BE/src/stock/detail/dto/stock-detail-output1.dto.ts @@ -1,6 +1,6 @@ import { ApiProperty } from '@nestjs/swagger'; -export class StockDetailDataDto { +export class InquirePriceOutput1Dto { @ApiProperty({ description: 'HTS 한글 종목명' }) hts_kor_isnm: string; @@ -22,6 +22,6 @@ export class StockDetailDataDto { @ApiProperty({ description: 'HTS 시가총액' }) hts_avls: string; - @ApiProperty({ description: 'per' }) + @ApiProperty({ description: 'PER' }) per: string; } diff --git a/BE/src/stock/detail/dto/stock-detail-output2.dto.ts b/BE/src/stock/detail/dto/stock-detail-output2.dto.ts new file mode 100644 index 00000000..c6df900f --- /dev/null +++ b/BE/src/stock/detail/dto/stock-detail-output2.dto.ts @@ -0,0 +1,42 @@ +import { ApiProperty } from '@nestjs/swagger'; + +export class InquirePriceOutput2Dto { + @ApiProperty({ description: '주식 영업 일자' }) + stck_bsop_date: string; + + @ApiProperty({ description: '주식 종가' }) + stck_clpr: string; + + @ApiProperty({ description: '주식 시가' }) + stck_oprc: string; + + @ApiProperty({ description: '주식 최고가' }) + stck_hgpr: string; + + @ApiProperty({ description: '주식 최저가' }) + stck_lwpr: string; + + @ApiProperty({ description: '누적 거래량' }) + acml_vol: string; + + @ApiProperty({ description: '누적 거래 대금' }) + acml_tr_pbmn: string; + + @ApiProperty({ description: '락 구분 코드' }) + flng_cls_code: string; + + @ApiProperty({ description: '분할 비율' }) + prtt_rate: string; + + @ApiProperty({ description: '분할변경여부' }) + mod_yn: string; + + @ApiProperty({ description: '전일 대비 부호' }) + prdy_vrss_sign: string; + + @ApiProperty({ description: '전일 대비' }) + prdy_vrss: string; + + @ApiProperty({ description: '재평가사유코드' }) + revl_issu_reas: string; +} diff --git a/BE/src/stock/detail/dto/stock-detail-request.dto.ts b/BE/src/stock/detail/dto/stock-detail-request.dto.ts index 3f5655d6..0fae03b9 100644 --- a/BE/src/stock/detail/dto/stock-detail-request.dto.ts +++ b/BE/src/stock/detail/dto/stock-detail-request.dto.ts @@ -14,8 +14,27 @@ export class StockDetailQueryParameterDto { */ fid_input_iscd: string; - constructor(fid_cond_mrkt_div_code: string, fid_input_iscd: string) { - this.fid_cond_mrkt_div_code = fid_cond_mrkt_div_code; - this.fid_input_iscd = fid_input_iscd; - } + /** + * 조회 시작일자 + * (ex) 20220501 + */ + fid_input_date_1: string; + + /** + * 조회 종료일자 + * (ex) 20220530 + */ + fid_input_date_2: string; + + /** + * 기간 분류 코드 + * D:일봉, W:주봉, M:월봉, Y:년봉 + */ + fid_period_div_code: string; + + /** + * 수정주가 원주가 가격 여부 + * 0:수정주가 1:원주가 + */ + fid_org_adj_prc: string; } diff --git a/BE/src/stock/detail/dto/stock-detail-response.dto.ts b/BE/src/stock/detail/dto/stock-detail-response.dto.ts new file mode 100644 index 00000000..765394f7 --- /dev/null +++ b/BE/src/stock/detail/dto/stock-detail-response.dto.ts @@ -0,0 +1,14 @@ +import { ApiProperty } from '@nestjs/swagger'; +import { InquirePriceOutput1Dto } from './stock-detail-output1.dto'; +import { InquirePriceOutput2Dto } from './stock-detail-output2.dto'; + +/** + * 순위 정렬 후 FE에 보낼 DTO + */ +export class InquirePriceResponseDto { + @ApiProperty({ type: InquirePriceOutput1Dto, description: '상승률 순위' }) + output1: InquirePriceOutput1Dto; + + @ApiProperty({ type: [InquirePriceOutput2Dto], description: '하락률 순위' }) + output2: InquirePriceOutput2Dto[]; +} diff --git a/BE/src/stock/detail/stock-detail.controller.ts b/BE/src/stock/detail/stock-detail.controller.ts index 346e13b7..090d2528 100644 --- a/BE/src/stock/detail/stock-detail.controller.ts +++ b/BE/src/stock/detail/stock-detail.controller.ts @@ -1,7 +1,7 @@ import { Controller, Get, Param } from '@nestjs/common'; import { ApiOperation, ApiParam, ApiResponse } from '@nestjs/swagger'; import { StockDetailService } from './stock-detail.service'; -import { StockDetailDataDto } from './dto/stock-detail-data.dto'; +import { InquirePriceResponseDto } from './dto/stock-detail-response.dto'; @Controller('/api/stocks') export class StockDetailController { @@ -19,7 +19,7 @@ export class StockDetailController { @ApiResponse({ status: 200, description: '단일 주식 종목 기본값 조회 성공', - type: StockDetailDataDto, + type: InquirePriceResponseDto, }) getStockDetail(@Param('stockCode') stockCode: string) { return this.stockDetailService.getInquirePrice(stockCode); From 80dd58304c36cc119845d9f14442d0aa5a375c57 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 17:11:46 +0900 Subject: [PATCH 11/14] =?UTF-8?q?=F0=9F=9A=9A=20rename:=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=EC=9D=84=20=EB=AA=85=ED=99=95=ED=95=98?= =?UTF-8?q?=EA=B2=8C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-detail-request.dto.ts => stock-detail-query-parameter.dto.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename BE/src/stock/detail/dto/{stock-detail-request.dto.ts => stock-detail-query-parameter.dto.ts} (100%) diff --git a/BE/src/stock/detail/dto/stock-detail-request.dto.ts b/BE/src/stock/detail/dto/stock-detail-query-parameter.dto.ts similarity index 100% rename from BE/src/stock/detail/dto/stock-detail-request.dto.ts rename to BE/src/stock/detail/dto/stock-detail-query-parameter.dto.ts From 12abb63fc14c029b5b3d33095b067003d9cded60 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 17:33:24 +0900 Subject: [PATCH 12/14] =?UTF-8?q?=E2=9C=A8=20feat:=20=EA=B5=AD=EB=82=B4?= =?UTF-8?q?=EC=A3=BC=EC=8B=9D=EA=B8=B0=EA=B0=84=EB=B3=84=EC=8B=9C=EC=84=B8?= =?UTF-8?q?=20API=20=EC=9A=94=EA=B5=AC=EC=82=AC=ED=95=AD=EC=97=90=20?= =?UTF-8?q?=EB=A7=9E=EC=B6=B0=20service,=20controller=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/dto/stock-detail-request.dto.ts | 17 ++++ .../stock/detail/stock-detail.controller.ts | 30 +++++-- BE/src/stock/detail/stock-detail.service.ts | 78 +++++++++++++------ 3 files changed, 96 insertions(+), 29 deletions(-) create mode 100644 BE/src/stock/detail/dto/stock-detail-request.dto.ts diff --git a/BE/src/stock/detail/dto/stock-detail-request.dto.ts b/BE/src/stock/detail/dto/stock-detail-request.dto.ts new file mode 100644 index 00000000..7bd1b1d8 --- /dev/null +++ b/BE/src/stock/detail/dto/stock-detail-request.dto.ts @@ -0,0 +1,17 @@ +import { ApiProperty } from '@nestjs/swagger'; + +/** + * 국내주식기간별시세(일/주/월/년) API를 이용할 때 필요한 요청 데이터를 담고 있는 DTO + */ +export class StockDetailRequestDto { + @ApiProperty({ description: '조회 시작일자 (ex) 20220501' }) + fid_input_date_1: string; + + @ApiProperty({ description: '조회 종료일자 (ex) 20220530' }) + fid_input_date_2: string; + + @ApiProperty({ + description: '기간 분류 코드 (ex) D(일봉) W(주봉) M(월봉) Y(년봉)', + }) + fid_period_div_code: string; +} diff --git a/BE/src/stock/detail/stock-detail.controller.ts b/BE/src/stock/detail/stock-detail.controller.ts index 090d2528..c89a00e0 100644 --- a/BE/src/stock/detail/stock-detail.controller.ts +++ b/BE/src/stock/detail/stock-detail.controller.ts @@ -1,27 +1,45 @@ -import { Controller, Get, Param } from '@nestjs/common'; -import { ApiOperation, ApiParam, ApiResponse } from '@nestjs/swagger'; +import { Body, Controller, Param, Post } from '@nestjs/common'; +import { ApiBody, ApiOperation, ApiParam, ApiResponse } from '@nestjs/swagger'; import { StockDetailService } from './stock-detail.service'; +import { StockDetailRequestDto } from './dto/stock-detail-request.dto'; import { InquirePriceResponseDto } from './dto/stock-detail-response.dto'; @Controller('/api/stocks') export class StockDetailController { constructor(private readonly stockDetailService: StockDetailService) {} - @Get(':stockCode') + @Post(':stockCode') @ApiOperation({ summary: '단일 주식 종목 detail 페이지 상단부 조회 API' }) @ApiParam({ name: 'stockCode', required: true, description: - '종목 코드\n' + + '종목 코드\n\n' + '(ex) 005930 삼성전자 / 005380 현대차 / 001500 현대차증권', }) + @ApiBody({ + description: + '주식 상세 조회에 필요한 데이터\n\n' + + 'fid_input_date_1: 조회 시작일자 (ex) 20240505\n\n' + + 'fid_input_date_2: 조회 종료일자 (ex) 20241111\n\n' + + 'fid_period_div_code: 기간 분류 코드 (ex) D(일봉), W(주봉), M(월봉), Y(년봉)', + type: StockDetailRequestDto, + }) @ApiResponse({ status: 200, description: '단일 주식 종목 기본값 조회 성공', type: InquirePriceResponseDto, }) - getStockDetail(@Param('stockCode') stockCode: string) { - return this.stockDetailService.getInquirePrice(stockCode); + getStockDetail( + @Param('stockCode') stockCode: string, + @Body() body: StockDetailRequestDto, + ) { + const { fid_input_date_1, fid_input_date_2, fid_period_div_code } = body; + return this.stockDetailService.getInquirePrice( + stockCode, + fid_input_date_1, + fid_input_date_2, + fid_period_div_code, + ); } } diff --git a/BE/src/stock/detail/stock-detail.service.ts b/BE/src/stock/detail/stock-detail.service.ts index d8e6dbaf..de6a4adb 100644 --- a/BE/src/stock/detail/stock-detail.service.ts +++ b/BE/src/stock/detail/stock-detail.service.ts @@ -3,12 +3,9 @@ import { Injectable, Logger } from '@nestjs/common'; import { KoreaInvestmentService } from '../../koreaInvestment/korea-investment.service'; import { getHeader } from '../../util/get-header'; import { getFullURL } from '../../util/get-full-URL'; -import { StockDetailQueryParameterDto } from './dto/stock-detail-request.dto'; -import { - InquirePriceApiResponse, - InquirePriceOutputData, -} from './interface/stock-detail.interface'; -import { StockDetailDataDto } from './dto/stock-detail-data.dto'; +import { InquirePriceApiResponse } from './interface/stock-detail.interface'; +import { StockDetailQueryParameterDto } from './dto/stock-detail-query-parameter.dto'; +import { InquirePriceResponseDto } from './dto/stock-detail-response.dto'; @Injectable() export class StockDetailService { @@ -17,19 +14,32 @@ export class StockDetailService { constructor(private readonly koreaInvetmentService: KoreaInvestmentService) {} /** - * 특정 주식의 주식현재가 시세 데이터를 반환하는 함수 + * 특정 주식의 기간별시세 데이터를 반환하는 함수 * @param {string} stockCode - 종목코드 - * @returns - 주식현재가 시세 데이터 객체 반환 + * @param {string} date1 - 조회 시작일자 + * @param {string} date2 - 조회 종료일자 + * @param {string} periodDivCode - 기간 분류 코드 + * @returns - 특정 주식의 기간별시세 데이터 객체 반환 * * @author uuuo3o */ - async getInquirePrice(stockCode: string) { + async getInquirePrice( + stockCode: string, + date1: string, + date2: string, + periodDivCode: string, + ) { try { - const queryParams = new StockDetailQueryParameterDto('J', stockCode); + const queryParams = new StockDetailQueryParameterDto(); + queryParams.fid_cond_mrkt_div_code = 'J'; + queryParams.fid_input_iscd = stockCode; + queryParams.fid_input_date_1 = date1; + queryParams.fid_input_date_2 = date2; + queryParams.fid_period_div_code = periodDivCode; const response = await this.requestApi(queryParams); - return this.formatStockData(response.output); + return this.formatStockData(response); } catch (error) { this.logger.error('API Error Details:', { status: error.response?.status, @@ -52,9 +62,9 @@ export class StockDetailService { private async requestApi(queryParams: StockDetailQueryParameterDto) { try { const accessToken = await this.koreaInvetmentService.getAccessToken(); - const headers = getHeader(accessToken, 'FHKST01010100'); + const headers = getHeader(accessToken, 'FHKST03010100'); const url = getFullURL( - '/uapi/domestic-stock/v1/quotations/inquire-price', + '/uapi/domestic-stock/v1/quotations/inquire-daily-itemchartprice', ); const params = this.getInquirePriceParams(queryParams); @@ -78,20 +88,38 @@ export class StockDetailService { /** * @private API에서 받은 주식현재가 시세 데이터를 필요한 정보로 정제하는 함수 - * @param {InquirePriceOutputData} stock - API 응답에서 받은 원시 데이터 + * @param {InquirePriceApiResponse} response - API 응답에서 받은 원시 데이터 * @returns - 필요한 정보만 추출한 데이터 배열 * * @author uuuo3o */ - private formatStockData(stock: InquirePriceOutputData) { - const stockData = new StockDetailDataDto(); - stockData.stck_shrn_iscd = stock.stck_shrn_iscd; - stockData.stck_prpr = stock.stck_prpr; - stockData.prdy_vrss = stock.prdy_vrss; - stockData.prdy_vrss_sign = stock.prdy_vrss_sign; - stockData.prdy_ctrt = stock.prdy_ctrt; - stockData.hts_avls = stock.hts_avls; - stockData.per = stock.per; + private formatStockData(response: InquirePriceApiResponse) { + const stockData = new InquirePriceResponseDto(); + const { output1, output2 } = response; + + const { + hts_kor_isnm, + stck_shrn_iscd, + stck_prpr, + prdy_vrss, + prdy_vrss_sign, + prdy_ctrt, + hts_avls, + per, + } = output1; + + stockData.output1 = { + hts_kor_isnm, + stck_shrn_iscd, + stck_prpr, + prdy_vrss, + prdy_vrss_sign, + prdy_ctrt, + hts_avls, + per, + }; + + stockData.output2 = output2; return stockData; } @@ -107,6 +135,10 @@ export class StockDetailService { return { fid_cond_mrkt_div_code: params.fid_cond_mrkt_div_code, fid_input_iscd: params.fid_input_iscd, + fid_input_date_1: params.fid_input_date_1, + fid_input_date_2: params.fid_input_date_2, + fid_period_div_code: params.fid_period_div_code, + fid_org_adj_prc: 0, }; } } From 351c474a9447bb608410dfc26eb3cf8fc6602375 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 17:51:18 +0900 Subject: [PATCH 13/14] =?UTF-8?q?=F0=9F=92=A1=20comment:=20=EC=A3=BC?= =?UTF-8?q?=EC=84=9D=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stock/detail/dto/stock-detail-query-parameter.dto.ts | 6 ------ BE/src/stock/detail/dto/stock-detail-response.dto.ts | 2 +- BE/src/stock/detail/stock-detail.service.ts | 8 ++++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/BE/src/stock/detail/dto/stock-detail-query-parameter.dto.ts b/BE/src/stock/detail/dto/stock-detail-query-parameter.dto.ts index 0fae03b9..feb9ca0f 100644 --- a/BE/src/stock/detail/dto/stock-detail-query-parameter.dto.ts +++ b/BE/src/stock/detail/dto/stock-detail-query-parameter.dto.ts @@ -31,10 +31,4 @@ export class StockDetailQueryParameterDto { * D:일봉, W:주봉, M:월봉, Y:년봉 */ fid_period_div_code: string; - - /** - * 수정주가 원주가 가격 여부 - * 0:수정주가 1:원주가 - */ - fid_org_adj_prc: string; } diff --git a/BE/src/stock/detail/dto/stock-detail-response.dto.ts b/BE/src/stock/detail/dto/stock-detail-response.dto.ts index 765394f7..a86f9e04 100644 --- a/BE/src/stock/detail/dto/stock-detail-response.dto.ts +++ b/BE/src/stock/detail/dto/stock-detail-response.dto.ts @@ -3,7 +3,7 @@ import { InquirePriceOutput1Dto } from './stock-detail-output1.dto'; import { InquirePriceOutput2Dto } from './stock-detail-output2.dto'; /** - * 순위 정렬 후 FE에 보낼 DTO + * 국내주식기간별시세(일/주/월/년) API 응답값 정제 후 FE에 보낼 DTO */ export class InquirePriceResponseDto { @ApiProperty({ type: InquirePriceOutput1Dto, description: '상승률 순위' }) diff --git a/BE/src/stock/detail/stock-detail.service.ts b/BE/src/stock/detail/stock-detail.service.ts index de6a4adb..c0629406 100644 --- a/BE/src/stock/detail/stock-detail.service.ts +++ b/BE/src/stock/detail/stock-detail.service.ts @@ -53,9 +53,9 @@ export class StockDetailService { } /** - * @private 한국투자 Open API - [국내주식] 기본시세 - 주식현재가 시세 호출 함수 + * @private 한국투자 Open API - [국내주식] 기본시세 - 국내주식기간별시세(일/주/월/년) 호출 함수 * @param {StockDetailQueryParameterDto} queryParams - API 요청 시 필요한 쿼리 파라미터 DTO - * @returns - 주식현재가 시세 데이터 + * @returns - 국내주식기간별시세(일/주/월/년) 데이터 * * @author uuuo3o */ @@ -87,7 +87,7 @@ export class StockDetailService { } /** - * @private API에서 받은 주식현재가 시세 데이터를 필요한 정보로 정제하는 함수 + * @private API에서 받은 국내주식기간별시세(일/주/월/년) 데이터를 필요한 정보로 정제하는 함수 * @param {InquirePriceApiResponse} response - API 응답에서 받은 원시 데이터 * @returns - 필요한 정보만 추출한 데이터 배열 * @@ -125,7 +125,7 @@ export class StockDetailService { } /** - * @private 주식현재가 시세 요청을 위한 쿼리 파라미터 객체 생성 함수 + * @private 국내주식기간별시세(일/주/월/년) 요청을 위한 쿼리 파라미터 객체 생성 함수 * @param {StockDetailQueryParameterDto} params - API 요청에 필요한 쿼리 파라미터 DTO * @returns - API 요청에 필요한 쿼리 파라미터 객체 * From 344278662f511e223880b8f54322c3b241e30de0 Mon Sep 17 00:00:00 2001 From: JIN Date: Mon, 11 Nov 2024 18:30:27 +0900 Subject: [PATCH 14/14] =?UTF-8?q?=F0=9F=93=9D=20docs:=20swagger=EC=97=90?= =?UTF-8?q?=20=EC=9E=98=EB=AA=BB=20=EC=9E=91=EC=84=B1=EB=90=9C=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BE/src/stock/detail/stock-detail.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BE/src/stock/detail/stock-detail.controller.ts b/BE/src/stock/detail/stock-detail.controller.ts index c89a00e0..5c4cfa85 100644 --- a/BE/src/stock/detail/stock-detail.controller.ts +++ b/BE/src/stock/detail/stock-detail.controller.ts @@ -26,7 +26,7 @@ export class StockDetailController { type: StockDetailRequestDto, }) @ApiResponse({ - status: 200, + status: 201, description: '단일 주식 종목 기본값 조회 성공', type: InquirePriceResponseDto, })