전일대비 부호 및 API 데이터 파싱 로직 개선:
Some checks failed
Build Push and Restart Compose / deploy (push) Failing after 1m13s

- `utils.ts`: 전일대비 부호 매핑 로직(1=상한가, 4=하한가) 수정 및 관련 함수(`sigToArrow`, `sigClass`) 업데이트.
- `types.ts`: `IndexQuote` 인터페이스의 `value` 필드명을 `price`로 수정.
- `kiwoom_ws_service.go`, `theme_service.go`, `kiwoom_service.go`: 전일대비 데이터 파싱 시 부호 결정 로직 추가(`signedChange`, `signedChangeBySig`) 및 관련 함수 호출로 대체.
- 기존 `predPre` 처리 부분을 양수/음수를 정확히 계산하도록 변경.
- `kospi200_service.go`: `PredPre` 필드 부호 처리 로직(`signedChangeBySig`) 추가.
- Svelte 페이지 업데이트:
  - `+page.svelte` 파일에서 `value` 필드를 `price`로 대체.
  - `theme` 및 `kospi200` 페이지에서 전일대비 표시값 절댓값으로 렌더링되도록 수정 (`Math.abs` 적용).
This commit is contained in:
hayato5246
2026-04-08 19:53:51 +09:00
parent ba18887ed8
commit 2f8a6ea349
9 changed files with 53 additions and 21 deletions

View File

@@ -85,7 +85,7 @@ func (s *Kospi200Service) GetStocks() ([]models.Kospi200Stock, error) {
Name: s.StkNm,
CurPrc: absParseIntSafe(s.CurPrc),
PredPreSig: s.PredPreSig,
PredPre: parseIntSafe(s.PredPre),
PredPre: signedChangeBySig(s.PredPre, s.PredPreSig),
FluRt: parseFloatSafe(s.FluRt),
Volume: absParseIntSafe(s.NowTrdeQty),
Open: absParseIntSafe(s.OpenPric),