-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- api : 유틸함수, api에서 가져오는 정보 유형, 타입등을 기준으로 폴더를 생성하고 api,ts를 보다 상세하게 파일로 생성해 분류 - 상수 : 상수 변수명을 대문자로 변경, 상수들을 단순히 나열하는 것이 아니라 관련된 것끼리 모아서 객체를 생성하고 이에 따라 타입과 메서드 변경 ,상수들을 모아서 관련별로 파일을 생성해 contstants폴더로 이동
- Loading branch information
1 parent
931d584
commit 21239ee
Showing
38 changed files
with
2,685 additions
and
3,220 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,97 @@ | ||
import { Api } from "../modules/api/types/weather"; | ||
|
||
export const SORT = { | ||
shortFcast: "VilageFcstInfoService_2.0", | ||
midFcast: "MidFcstInfoService", | ||
}; | ||
export const AP_INFORM_API_URL = | ||
"http://apis.data.go.kr/B552584/ArpltnInforInqireSvc"; | ||
|
||
export const SUN_API_URL = | ||
"http://apis.data.go.kr/B090041/openapi/service/RiseSetInfoService"; | ||
|
||
/** | ||
* 단기 예보 | ||
* ultraSrtNcst: 초단기실황조회 :현재, | ||
* ultraSrtFcst:초단기예보조회 : 현재부터 6시간이내 | ||
* vilageFcst : 단기예보조회 :현재부터 3일 이내 | ||
*/ | ||
export const INQURY_SHORT = { | ||
ultraSrtNcst: "getUltraSrtNcst", | ||
ultraSrtFcst: "getUltraSrtFcst", | ||
vilageFcst: "getVilageFcst", | ||
}; | ||
/** | ||
*중기 예보 | ||
*midLandFcst :중기 육상예보:강수확률,날씨; | ||
*midTa :중기기온조회; | ||
*/ | ||
export const INQURY_MID = { | ||
midLandFcst: "getMidLandFcst", | ||
midTa: "getMidTa", | ||
}; | ||
/** | ||
* 대기오염 예보 | ||
* ctprvnRltmMesureDnsty : 시도별 실시간 대기오염 측정 정보 조회 | ||
* minuDustFrcstDspth :시도별 대기오염 예보 | ||
*/ | ||
export const INQURY_AIR = { | ||
ctprvnRltmMesureDnsty: "getCtprvnRltmMesureDnsty", | ||
minuDustFrcstDspth: "getMinuDustFrcstDspth", | ||
}; | ||
|
||
export const INQURY_SUN = "getLCRiseSetInfo"; | ||
|
||
export const FETCH_URL = { | ||
svfcast: "svfcast", | ||
sky: "sky", | ||
usncst: "usncst", | ||
midFcastLandItems: "midFcast_landItems", | ||
midFcastTaItems: "midFcast_taItems", | ||
apNow: "apNow", | ||
apfcst: "apfcst", | ||
}; | ||
|
||
export const SVF_BASE_TIME = { | ||
am2: "0200", | ||
am5: "0500", | ||
am8: "0800", | ||
am11: "1100", | ||
pm2: "1400", | ||
pm5: "1700", | ||
pm8: "2000", | ||
pm11: "2300", | ||
}; | ||
|
||
/** | ||
* Api for short-term forecast | ||
*/ | ||
const API_URL = "https://apis.data.go.kr/1360000/"; | ||
|
||
export const SHORT_FCAST_API: Api = { | ||
url: `${API_URL}${SORT.shortFcast}`, | ||
inqury: INQURY_SHORT, | ||
}; | ||
/** | ||
* Api for medium term forecas | ||
*/ | ||
export const MID_FCAST_API: Api = { | ||
url: `${API_URL}${SORT.midFcast}`, | ||
inqury: INQURY_MID, | ||
}; | ||
|
||
/** | ||
* Api for air pollution | ||
*/ | ||
export const AP_INFORMATION_API: Api = { | ||
url: AP_INFORM_API_URL, | ||
inqury: INQURY_AIR, | ||
}; | ||
|
||
/** | ||
* Api for sunset and sunrise | ||
*/ | ||
export const SUN_API: Api = { | ||
url: SUN_API_URL, | ||
inqury: INQURY_SUN, | ||
}; |
Oops, something went wrong.