-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 중앙 차트 상단 주식개요 관련 갱신 로직 구현 - 특정 종목 선택 혹은 검색 시 주가 차트와 함께 상단 개요 항목도 변경되도록 로직 구현 - 일부 예외처리 및 CSS 디자인 추가 구현 예정 Issues #14
- Loading branch information
1 parent
8ce617f
commit 8dd73e9
Showing
6 changed files
with
211 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { useQuery } from "react-query"; | ||
import axios from "axios"; | ||
|
||
const useGetStockInfo = (companyId: number) => { | ||
const { data, isLoading, error } = useQuery(`stockInfo${companyId}`, () => getStockInfo(companyId), {}); | ||
|
||
return { data, isLoading, error }; | ||
}; | ||
|
||
const getStockInfo = async (companyId: number) => { | ||
const res = await axios.get(`http://ec2-13-125-246-160.ap-northeast-2.compute.amazonaws.com:8080/companies/${companyId}`); | ||
const stockInfo = res.data; | ||
return stockInfo; | ||
}; | ||
|
||
export default useGetStockInfo; | ||
|
||
interface StockOverviewProps { | ||
companyId: number; | ||
code: string; | ||
korName: string; | ||
stockAsBiResponseDto: StockPriceProps; | ||
stockInfResponseDto: StockInfoProps; | ||
} | ||
|
||
interface StockPriceProps { | ||
stockAsBiId: number; | ||
companyId: number; | ||
askp1: string; | ||
askp2: string; | ||
askp3: string; | ||
askp4: string; | ||
askp5: string; | ||
askp_rsqn1: string; | ||
askp_rsqn2: string; | ||
askp_rsqn3: string; | ||
askp_rsqn4: string; | ||
askp_rsqn5: string; | ||
bidp1: string; | ||
bidp2: string; | ||
bidp3: string; | ||
bidp4: string; | ||
bidp5: string; | ||
bidp_rsqn1: string; | ||
bidp_rsqn2: string; | ||
bidp_rsqn3: string; | ||
bidp_rsqn4: string; | ||
bidp_rsqn5: string; | ||
} | ||
|
||
interface StockInfoProps { | ||
stockInfId: number; | ||
companyId: number; | ||
stck_prpr: string; | ||
prdy_vrss: string; | ||
prdy_ctrt: string; | ||
acml_vol: string; | ||
acml_tr_pbmn: string; | ||
} |