-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* ♻️ refactor: 분봉 데이터 callback 형태로 바꿔 우선순위 큐 적용, 리팩토링 * ♻️ refactor: 분단위 데이터 수집 stock limit 200, 콜백함수로 리팩토링 * 🐛 fix: afterUpdate 적용 위한 upsert구문으로 변경 * 💄 style: 분단위 테스트 이후 테스트 코드 삭제 및 조건 원복 * 💄 style: dto 안 쓰이는 속성 삭제 * 💄 style: console.log 삭제 * 📝 docs: liveData에 unsubscribe, subscribe 메시지 info로 출력 추가 * 🐛 fix: 알람을 한번만 보내고 삭제처리하게 만듦
- Loading branch information
1 parent
981f190
commit bde9d72
Showing
6 changed files
with
138 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 49 additions & 11 deletions
60
packages/backend/src/scraper/openapi/type/openapiMinuteData.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,73 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
export type MinuteData = { | ||
export type MinuteDataOutput1 = { | ||
prdy_vrss: string; | ||
prdy_vrss_sign: string; | ||
prdy_ctrt: string; | ||
stck_prdy_clpr: string; | ||
acml_vol: string; | ||
acml_tr_pbmn: string; | ||
hts_kor_isnm: string; | ||
stck_prpr: string; | ||
}; | ||
|
||
export type MinuteDataOutput2 = { | ||
stck_bsop_date: string; | ||
stck_cntg_hour: string; | ||
acml_tr_pbmn: string; | ||
stck_prpr: string; | ||
stck_oprc: string; | ||
stck_hgpr: string; | ||
stck_lwpr: string; | ||
cntg_vol: string; | ||
}; | ||
|
||
export type MinuteData = { | ||
stck_bsop_date: string; | ||
stck_cntg_hour: string; | ||
acml_tr_pbmn: string; | ||
acml_vol: string; | ||
stck_prpr: string; | ||
stck_oprc: string; | ||
stck_hgpr: string; | ||
stck_lwpr: string; | ||
cntg_vol: string; | ||
}; | ||
|
||
export type UpdateStockQuery = { | ||
fid_etc_cls_code: string; | ||
fid_cond_mrkt_div_code: 'J' | 'W'; | ||
fid_input_iscd: string; | ||
fid_input_hour_1: string; | ||
fid_pw_data_incu_yn: 'Y' | 'N'; | ||
export const isMinuteDataOutput1 = (data: any): data is MinuteDataOutput1 => { | ||
return ( | ||
data !== null && | ||
typeof data === 'object' && | ||
typeof data.prdy_vrss === 'string' && | ||
typeof data.prdy_vrss_sign === 'string' && | ||
typeof data.prdy_ctrt === 'string' && | ||
typeof data.stck_prdy_clpr === 'string' && | ||
typeof data.acml_vol === 'string' && | ||
typeof data.acml_tr_pbmn === 'string' && | ||
typeof data.hts_kor_isnm === 'string' && | ||
typeof data.stck_prpr === 'string' | ||
); | ||
}; | ||
|
||
export const isMinuteData = (data: any) => { | ||
export const isMinuteDataOutput2 = (data: any): data is MinuteDataOutput2 => { | ||
return ( | ||
data && | ||
data !== null && | ||
typeof data === 'object' && | ||
typeof data.stck_bsop_date === 'string' && | ||
typeof data.stck_cntg_hour === 'string' && | ||
typeof data.acml_tr_pbmn === 'string' && | ||
typeof data.stck_prpr === 'string' && | ||
typeof data.stck_oprc === 'string' && | ||
typeof data.stck_hgpr === 'string' && | ||
typeof data.stck_lwpr === 'string' && | ||
typeof data.cntg_vol === 'string' && | ||
typeof data.acml_tr_pbmn === 'string' | ||
typeof data.cntg_vol === 'string' | ||
); | ||
}; | ||
|
||
export type UpdateStockQuery = { | ||
fid_etc_cls_code: string; | ||
fid_cond_mrkt_div_code: 'J' | 'W'; | ||
fid_input_iscd: string; | ||
fid_input_hour_1: string; | ||
fid_pw_data_incu_yn: 'Y' | 'N'; | ||
}; |